diff --git a/nemreader/split_days.py b/nemreader/split_days.py index 523bc23..6626017 100644 --- a/nemreader/split_days.py +++ b/nemreader/split_days.py @@ -164,6 +164,12 @@ def make_set_interval( if r.uom and r.uom[-1].lower() == "h": grp_value = sum([x.read_value for x in grp_readings]) + elif r.uom and r.uom[-1].lower() == "v": + # Exclude zero values to avoid ~120V when averaging 0 and 240 V + voltages = [x.read_value for x in grp_readings if x.read_value] + if not voltages: # If all zero then that is okay + voltages = [x.read_value for x in grp_readings] + grp_value = mean(voltages) else: grp_value = mean([x.read_value for x in grp_readings]) diff --git a/requirements.txt b/requirements.txt index edcef9f..0d79a5a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,9 +7,9 @@ click==8.1.7 # typer click-default-group==1.2.4 # via sqlite-utils -coverage==7.5.3 +coverage==7.6.0 # via pytest-cov -exceptiongroup==1.2.1 +exceptiongroup==1.2.2 # via pytest iniconfig==2.0.0 # via pytest @@ -17,12 +17,12 @@ markdown-it-py==3.0.0 # via rich mdurl==0.1.2 # via markdown-it-py -mypy==1.10.0 +mypy==1.10.1 mypy-extensions==1.0.0 # via mypy -numpy==1.26.4 +numpy==2.0.0 # via pandas -packaging==24.0 +packaging==24.1 # via pytest pandas==2.2.2 pluggy==1.5.0 @@ -31,7 +31,7 @@ pluggy==1.5.0 # sqlite-utils pygments==2.18.0 # via rich -pytest==8.2.1 +pytest==8.2.2 # via pytest-cov pytest-cov==5.0.0 python-dateutil==2.9.0.post0 @@ -42,7 +42,7 @@ pytz==2024.1 # via pandas rich==13.7.1 # via typer -ruff==0.4.6 +ruff==0.5.2 shellingham==1.5.4 # via typer six==1.16.0 @@ -58,7 +58,7 @@ tomli==2.0.1 # mypy # pytest typer==0.12.3 -typing-extensions==4.12.0 +typing-extensions==4.12.2 # via # mypy # typer