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

Potential fix for #66 #67

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
1 change: 0 additions & 1 deletion docs/available_modules.md
Original file line number Diff line number Diff line change
@@ -72,7 +72,6 @@ Config tag:
| -------- | ----------- | -------- |
| runoff_module | The name of the runoff model to be used. Currently supported: abcd (for ABCD), gwam (for GWAM), and none (for cases where the user will provide their own runoff input file). | True |
| runoff_dir | The directory name of the runoff module chosen where its input files are stored | True |
| runoff_file | Only used if `runoff_module` is set to `none`. This will be a full path file with extension to the input runoff data in mm/month. Array must be 2-D, where (gridcell_idx, month_idx). File must be saved as a NumPy array file (.npy). | False |

### ABCD
Config tag:
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -4,3 +4,4 @@ pandas~=1.1.4
configobj>=5.0.6
joblib~=1.0.1
matplotlib~=3.4.2
requests~=2.27.1
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -34,6 +34,7 @@ def readme():
"configobj>=5.0.6",
"joblib~=1.0.1",
"matplotlib~=3.4.2",
"requests~=2.27.1"
],
python_requires='>=3.6',
include_package_data=True
1 change: 1 addition & 0 deletions xanthos/components.py
Original file line number Diff line number Diff line change
@@ -244,6 +244,7 @@ def calculate_runoff(self, step_num=None, pet=None):

# if user is providing a custom runoff file
if self.s.alt_runoff is not None:
self.PET = pet
self.Q = np.load(self.s.alt_runoff)

def calculate_routing(self, runoff):
2 changes: 1 addition & 1 deletion xanthos/configurations.py
Original file line number Diff line number Diff line change
@@ -59,7 +59,7 @@ def __init__(self, config):
"""
# acceptable components to run
PET_COMPONENTS = ['hs', 'hargreaves', 'pm', 'thornthwaite']
RUNOFF_COMPONENTS = ['abcd', 'gwam']
RUNOFF_COMPONENTS = ['abcd', 'gwam', 'none']
ROUTING_COMPONENTS = ['mrtm']

# runoff components that need the whole model to do spin-up
7 changes: 5 additions & 2 deletions xanthos/install_supplement.py
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@

import requests

from pkg_resources import get_distribution
from pkg_resources import get_distribution, DistributionNotFound
from io import BytesIO as BytesIO


@@ -28,7 +28,10 @@ def fetch_zenodo(self):
current Xanthos distribution."""

# get the current version of xanthos that is installed
current_version = get_distribution('xanthos').version
try:
current_version = get_distribution('xanthos').version
except DistributionNotFound:
current_version = list(InstallSupplement.DATA_VERSION_URLS.keys())[-1]

try:
data_link = InstallSupplement.DATA_VERSION_URLS[current_version]