From 073b6d2fd9e4c57a64d9ce7fa206ec6c43a0701a Mon Sep 17 00:00:00 2001 From: travis Date: Fri, 4 Jun 2021 14:45:22 -0700 Subject: [PATCH] remove epiweeks requirement for now, in preparation for conda-forge version; bump version --- mosartwmpy/model.py | 4 ++-- mosartwmpy/reservoirs/reservoirs.py | 8 ++++---- requirements.txt | 1 - setup.py | 4 ++-- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/mosartwmpy/model.py b/mosartwmpy/model.py index 598c2ae..b756c9c 100644 --- a/mosartwmpy/model.py +++ b/mosartwmpy/model.py @@ -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 @@ -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 diff --git a/mosartwmpy/reservoirs/reservoirs.py b/mosartwmpy/reservoirs/reservoirs.py index c348368..dfa3374 100644 --- a/mosartwmpy/reservoirs/reservoirs.py +++ b/mosartwmpy/reservoirs/reservoirs.py @@ -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 @@ -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 @@ -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') @@ -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') diff --git a/requirements.txt b/requirements.txt index 180fb68..52f3e4f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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 diff --git a/setup.py b/setup.py index 2b1f1a6..54690ed 100644 --- a/setup.py +++ b/setup.py @@ -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', @@ -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'] } )