Skip to content

Commit

Permalink
remove epiweeks requirement for now, in preparation for conda-forge v…
Browse files Browse the repository at this point in the history
…ersion; bump version
  • Loading branch information
thurber committed Jun 4, 2021
1 parent bacde88 commit 073b6d2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions mosartwmpy/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from benedict import benedict
from bmipy import Bmi
from datetime import datetime, time, timedelta
from epiweeks import Week
# from epiweeks import Week
from pathlib import Path
from pathvalidate import sanitize_filename
from timeit import default_timer as timer
Expand Down Expand Up @@ -188,7 +188,7 @@ def update(self) -> None:
self.state.grid_cell_unmet_demand[:] = 0
# get streamflow for this time period
# TODO this is still written assuming monthly, but here's the epiweek for when that is relevant
epiweek = Week.fromdate(self.current_time).week
# epiweek = Week.fromdate(self.current_time).week
month = self.current_time.month
streamflow_time_name = self.config.get('water_management.reservoirs.streamflow_time_resolution')
self.state.reservoir_streamflow[:] = self.grid.reservoir_streamflow_schedule.sel({streamflow_time_name: month}).values
Expand Down
8 changes: 4 additions & 4 deletions mosartwmpy/reservoirs/reservoirs.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import numpy as np

from datetime import datetime
from epiweeks import Week
# from epiweeks import Week
from benedict.dicts import benedict as Benedict

from mosartwmpy.config.parameters import Parameters
Expand All @@ -14,7 +14,7 @@ def reservoir_release(state, grid, config, parameters, current_time):
# compute release from reservoirs

# TODO so much logic was dependent on monthly, so still assuming monthly for now, but here's the epiweek for when that is relevant
epiweek = Week.fromdate(current_time).week
# epiweek = Week.fromdate(current_time).week
month = current_time.month

# if it's the start of the operational year for the reservoir, set it's start of op year storage to the current storage
Expand All @@ -32,7 +32,7 @@ def regulation_release(state, grid, config, parameters, current_time):
# compute the expected monthly release based on Biemans (2011)

# TODO this is still written assuming monthly, but here's the epiweek for when that is relevant
epiweek = Week.fromdate(current_time).week
# epiweek = Week.fromdate(current_time).week
month = current_time.month
streamflow_time_name = config.get('water_management.reservoirs.streamflow_time_resolution')

Expand Down Expand Up @@ -78,7 +78,7 @@ def storage_targets(state: State, grid: Grid, config: Benedict, parameters: Para
# TODO the logic here is really hard to follow... can it be simplified or made more readable?

# TODO this is still written assuming monthly, but here's the epiweek for when that is relevant
epiweek = Week.fromdate(current_time).week
# epiweek = Week.fromdate(current_time).week
month = current_time.month
streamflow_time_name = config.get('water_management.reservoirs.streamflow_time_resolution')

Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
bmipy==2.0
dask[complete]==2021.5.1
epiweeks==2.1.2
matplotlib==3.4.2
nc-time-axis==1.2.0
netCDF4==1.5.6
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def get_requirements():

setup(
name='mosartwmpy',
version='0.0.4',
version='0.0.5',
packages=find_packages(),
url='https://github.com/IMMM-SFA/mosartwmpy',
license='BSD2-Simplified',
Expand All @@ -28,6 +28,6 @@ def get_requirements():
include_package_data=True,
install_requires=get_requirements(),
extras_require={
'dev': ['recommonmark==0.7.1', 'setuptools==54.1.2', 'sphinx==3.5.2', 'sphinx-rtd-theme==0.5.1']
'dev': ['build==0.4.0', 'recommonmark==0.7.1', 'setuptools==54.1.2', 'sphinx==3.5.2', 'sphinx-rtd-theme==0.5.1', 'twine==3.4.1']
}
)

0 comments on commit 073b6d2

Please sign in to comment.