Skip to content

Commit

Permalink
Merge pull request #113 from nlaws-camus/fix-avg-div-by-zero
Browse files Browse the repository at this point in the history
make NodeVoltageMetric.window_size at least 1
  • Loading branch information
daniel-thom authored Oct 18, 2022
2 parents 8a208ea + db3c039 commit 127d531
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions PyDSS/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -649,9 +649,9 @@ def __init__(self, prop, dss_obj, settings):
start_time = get_start_time(settings)
sim_resolution = get_simulation_resolution(settings)
inputs = ReportBase.get_inputs_from_defaults(settings, "Voltage Metrics")
window_size = int(
window_size = max(1, int(
timedelta(minutes=inputs["window_size_minutes"]) / sim_resolution
)
))
self._voltage_metrics = NodeVoltageMetrics(
prop, start_time, sim_resolution, window_size, inputs["store_per_element_data"]
)
Expand Down

0 comments on commit 127d531

Please sign in to comment.