3
3
import hashlib
4
4
import logging
5
5
from pathlib import Path
6
- from typing import NamedTuple , Tuple , Dict , Optional
6
+ from typing import NamedTuple , Tuple , Dict , Optional , Union
7
7
8
8
from nrel .hive .config .config_builder import ConfigBuilder
9
9
from nrel .hive .util import fs
@@ -19,14 +19,14 @@ class Input(NamedTuple):
19
19
bases_file : str
20
20
stations_file : str
21
21
mechatronics_file : str
22
- schedules_file : Optional [ str ]
23
- chargers_file : Optional [str ]
24
- road_network_file : Optional [str ]
25
- geofence_file : Optional [str ]
26
- rate_structure_file : Optional [str ]
27
- charging_price_file : Optional [str ]
28
- demand_forecast_file : Optional [str ]
29
- fleets_file : Optional [str ]
22
+ chargers_file : str
23
+ schedules_file : Optional [str ] = None
24
+ road_network_file : Optional [str ] = None
25
+ geofence_file : Optional [str ] = None
26
+ rate_structure_file : Optional [str ] = None
27
+ charging_price_file : Optional [str ] = None
28
+ demand_forecast_file : Optional [str ] = None
29
+ fleets_file : Optional [str ] = None
30
30
31
31
@classmethod
32
32
def default_config (cls ) -> Dict :
@@ -124,7 +124,7 @@ def from_dict(cls, d: Dict, scenario_file_path: Path, cache: Optional[Dict]) ->
124
124
else None
125
125
)
126
126
127
- input = {
127
+ input_config = {
128
128
"scenario_directory" : str (scenario_directory ),
129
129
"scenario_file" : scenario_file ,
130
130
"vehicles_file" : vehicles_file ,
@@ -147,11 +147,27 @@ def from_dict(cls, d: Dict, scenario_file_path: Path, cache: Optional[Dict]) ->
147
147
for (
148
148
name ,
149
149
path ,
150
- ) in input .items (): # input_config.asdict(absolute_paths=True).items():
150
+ ) in input_config .items (): # input_config.asdict(absolute_paths=True).items():
151
151
if path :
152
152
cls ._check_md5_checksum (path , cache [name ])
153
153
154
- return Input (** input )
154
+ return Input (
155
+ scenario_directory = str (scenario_directory ),
156
+ scenario_file = scenario_file ,
157
+ vehicles_file = vehicles_file ,
158
+ requests_file = requests_file ,
159
+ bases_file = bases_file ,
160
+ stations_file = stations_file ,
161
+ schedules_file = schedules_file ,
162
+ chargers_file = chargers_file ,
163
+ mechatronics_file = mechatronics_file ,
164
+ road_network_file = road_network_file ,
165
+ geofence_file = geofence_file ,
166
+ rate_structure_file = rate_structure_file ,
167
+ charging_price_file = charging_price_file ,
168
+ demand_forecast_file = demand_forecast_file ,
169
+ fleets_file = fleets_file ,
170
+ )
155
171
156
172
@staticmethod
157
173
def _check_md5_checksum (filepath : str , existing_md5_sum : str ):
0 commit comments