Skip to content

Commit 16d420d

Browse files
authored
Merge pull request #397 from NREL/ndr/minor-doc-fixes
Minor doc fixes
2 parents 986187b + b5242e2 commit 16d420d

4 files changed

Lines changed: 20 additions & 28 deletions

File tree

docs/_toc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ parts:
1616
- file: examples/02_different_powertrains_example
1717
- file: examples/03_time_energy_tradeoff_example
1818
- file: examples/04_charging_stations_example
19+
- file: examples/05_ambient_temperature_example
1920

2021
- caption: User Reference
2122
chapters:

docs/examples/01_open_street_maps_example.py

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,9 @@
4545
4646
```{note}
4747
In order to get the most accurate energy results from the routee-powertrain vehicle models, it's important to include road grade information since it plays a large factor in vehicle energy consumption.
48-
That being said, adding grade can be a big lift computationally. In our case, we pull digital elevation model (DEM) raster files from USGS and then use osmnx to append elevation and grade to the graph. If the graph is large, this can take a while to download and could take up a lot of disk space.
48+
That being said, adding grade can be a big lift computationally. In our case, we pull digital elevation model (DEM) raster files from USGS and then use osmnx to append elevation and grade to the graph.
49+
If the graph is large, this can take a while to download and could take up a lot of disk space.
4950
So, we recommend that you include grade information in your graph but want to be clear about the requirements for doing so.
50-
51-
If you do not wish to impute grade from node elevations, remove "grade" from the "phases" argument.
5251
```
5352
"""
5453

@@ -289,15 +288,9 @@ def pretty_print(dict):
289288
shortest_time_result["route"]["cost"]["total_cost"]
290289
- least_energy_result["route"]["cost"]["total_cost"]
291290
)
292-
dist_unit = shortest_time_result["route"]["state_model"]["trip_distance"]["Distance"][
293-
"output_unit"
294-
]
295-
time_unit = shortest_time_result["route"]["state_model"]["trip_time"]["Time"][
296-
"output_unit"
297-
]
298-
enrg_unit = shortest_time_result["route"]["state_model"]["trip_energy"]["Energy"][
299-
"output_unit"
300-
]
291+
dist_unit = shortest_time_result["route"]["state_model"]["trip_distance"]["output_unit"]
292+
time_unit = shortest_time_result["route"]["state_model"]["trip_time"]["output_unit"]
293+
enrg_unit = shortest_time_result["route"]["state_model"]["trip_energy"]["output_unit"]
301294
print(f" - distance: {dist_diff:.2f} {dist_unit} further with time-optimal")
302295
print(f" - time: {-time_diff:.2f} {time_unit} longer with energy-optimal")
303296
print(f" - energy: {enrg_diff:.2f} {enrg_unit} more with time-optimal")

docs/examples/05_ambient_temperature_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
# %%
6262
temp_results = []
6363
for temp in [0, 15, 32, 50, 72, 90, 110]:
64-
query["ambient_temperature"] = {"value": temp, "unit": "fahrenheit"}
64+
query["ambient_temperature"] = {"value": temp, "unit": "fahrenheit"}
6565
result = app.run(query)
6666
if "error" in result:
6767
print(result["error"])

python/nrel/routee/compass/io/generate_dataset.py

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,9 @@
3434

3535
class GeneratePipelinePhase(enum.Enum):
3636
GRAPH = 1
37-
GRADE = 2
38-
CONFIG = 3
39-
POWERTRAIN = 4
40-
CHARGING_STATIONS = 5
37+
CONFIG = 2
38+
POWERTRAIN = 3
39+
CHARGING_STATIONS = 4
4140

4241
@classmethod
4342
def default(cls) -> List[GeneratePipelinePhase]:
@@ -109,7 +108,7 @@ def generate_compass_dataset(
109108
g1 = ox.add_edge_speeds(g1, hwy_speeds=hwy_speeds, fallback=fallback, agg=agg)
110109
g1 = ox.add_edge_bearings(g1)
111110

112-
if GeneratePipelinePhase.GRADE in phases:
111+
if GeneratePipelinePhase.POWERTRAIN in phases:
113112
log.info("adding grade information")
114113
g1 = add_grade_to_graph(
115114
g1, resolution_arc_seconds=raster_resolution_arc_seconds
@@ -198,7 +197,7 @@ def replace_id(vertex_uuid: pd.Index) -> pd.Series[int]:
198197
compression="gzip",
199198
)
200199

201-
if GeneratePipelinePhase.GRADE in phases:
200+
if GeneratePipelinePhase.POWERTRAIN in phases:
202201
e.grade.to_csv(
203202
output_directory / "edges-grade-enumerated.txt.gz",
204203
index=False,
@@ -211,10 +210,15 @@ def replace_id(vertex_uuid: pd.Index) -> pd.Series[int]:
211210
base_config_files = [
212211
"osm_default_distance.toml",
213212
"osm_default_speed.toml",
214-
"osm_default_energy.toml",
215-
"osm_default_energy_all_vehicles.toml",
216-
"osm_default_temperature.toml",
217213
]
214+
if GeneratePipelinePhase.POWERTRAIN in phases:
215+
base_config_files.extend(
216+
[
217+
"osm_default_energy.toml",
218+
"osm_default_energy_all_vehicles.toml",
219+
"osm_default_temperature.toml",
220+
]
221+
)
218222
if GeneratePipelinePhase.CHARGING_STATIONS in phases:
219223
base_config_files.append("osm_default_charging.toml")
220224
for filename in base_config_files:
@@ -223,12 +227,6 @@ def replace_id(vertex_uuid: pd.Index) -> pd.Series[int]:
223227
) as init_toml_path:
224228
with init_toml_path.open() as f:
225229
init_toml: dict[str, Any] = tomlkit.load(f)
226-
if filename == "osm_default_energy.toml":
227-
if GeneratePipelinePhase.GRADE in phases:
228-
init_toml["traversal"]["grade_table_input_file"] = (
229-
"edges-grade-enumerated.txt.gz"
230-
)
231-
init_toml["traversal"]["grade_table_grade_unit"] = "decimal"
232230
with open(output_directory / filename, "w") as f:
233231
f.write(tomlkit.dumps(init_toml))
234232

0 commit comments

Comments
 (0)