Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature voltage bugfix #61

Merged
merged 2 commits into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion urbanopt_ditto_reader/example_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"urbanopt_scenario_file": "example/baseline_scenario.csv",
"equipment_file": "urbanopt_ditto_reader/extended_catalog.json",
"opendss_folder": "example/run/baseline_scenario/opendss",
"urbanopt_geojson_file": "example/urbanopt_example.json",
"urbanopt_geojson_file": "example/example_project_with_electric_network.json",
"use_reopt": false,
"start_time": "2019/01/15 01:00:00",
"end_time": "2019/01/16 01:00:00",
Expand Down
6 changes: 3 additions & 3 deletions urbanopt_ditto_reader/urbanopt_ditto_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ def run(self, master_file):
if i == start_index:
for element in voltages:
with suppress(KeyError): # element is not a building
voltage_df_dic[building_map[element]] = [bldg_columns]
voltage_df_dic[building_map[element.replace("_", "-")]] = [bldg_columns]
for element in line_overloads:
line_df_dic[element] = [line_columns]
for element in overloaded_xfmrs:
Expand All @@ -456,7 +456,7 @@ def run(self, master_file):
# record the OpenDSS results in dictionaries
for element, volt_val in voltages.items():
with suppress(KeyError): # element is not a building
voltage_df_dic[building_map[element]].append(
voltage_df_dic[building_map[element.replace("_", "-")]].append(
[time, round(volt_val, 5), volt_val > 1.05, volt_val < 0.95]
)
for element, line_load_val in line_overloads.items():
Expand All @@ -466,7 +466,7 @@ def run(self, master_file):

# write the collected results into CSV files
for element, result_values in voltage_df_dic.items():
res_path = os.path.join(features_path, "%s.csv" % element.replace(":", ""))
res_path = os.path.join(features_path, "%s.csv" % element.replace("_", "-"))
self._write_csv(result_values, res_path)
for element, result_values in line_df_dic.items():
res_path = os.path.join(lines_path, "%s.csv" % element.replace(":", ""))
Expand Down