Skip to content

Commit 71060d5

Browse files
authored
Merge pull request #99 from jmccreight/feat(intro_usage)
Feat(intro usage) #1
2 parents 670aebc + 77e9b17 commit 71060d5

29 files changed

+7622
-2289
lines changed

.gitignore

+14-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# python
22
build/
33
*.egg-info/
4+
*.pkl
45

56
# Jupyter Notebook
67
.ipynb_checkpoints
@@ -32,7 +33,6 @@ prms_src/prms5.3.0/msvs/x64/Release/
3233
# meson build information
3334
prms_src/prms5.3.0/builddir/
3435

35-
3636
# prms binaries
3737
prms_src/prms5.2.1/bin
3838
prms_src/prms5.3.0/bin
@@ -55,4 +55,16 @@ autotest/.coverage
5555
autotest/temp
5656

5757
# sphinx
58-
generated/
58+
generated/
59+
60+
# gis data
61+
examples/pynhm_gis
62+
63+
# graphics
64+
*.pnh
65+
*.svg
66+
*.jpg
67+
68+
# compressed/tarballs
69+
*.gz
70+
*.zip

README.md

+38
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,44 @@
44
[![Documentation Status](https://readthedocs.org/projects/pynhm/badge/?version=latest)](https://pynhm.readthedocs.io/en/latest/?badge=latest)
55
<img src="https://raw.githubusercontent.com/ec-usgs/pynhm/main/resources/images/prms_flow.png" alt="prms_flow" style="width:50;height:20">
66

7+
Overview
8+
==========
9+
The contents of directories at this level is described. Therein you may discover another README.md for more information.
10+
11+
```
12+
.github/ Github actions for deploying continuous integration (CI)
13+
autotest/ pynhm package testing using pytest
14+
bin/ PRMS executables distributed
15+
ci/ Python environments for CI
16+
doc/ Package/code documentation source code
17+
examples/ How to use the package, mostly jupyter notebooks
18+
prms_src/ PRMS source used for generating executables in bin/
19+
pynhm/ Package source
20+
reference/ Ancillary materials for development
21+
resources/ Static stuff like images
22+
test_data/ Data used for automated testing
23+
```
24+
25+
26+
Requirements and Python Environments
27+
==========
28+
Git and python 3.8 - 3.10 are required.
29+
30+
We suggest installing the python dependencies using conda and the following yaml files.
31+
32+
* Minimal: ci/requirements/environment.yml
33+
* Documentation: ci/requirements/doc.yml
34+
* Notebooks: examples/examples_env.yml
35+
36+
```conda env create -f env_of_choice.yml```
37+
38+
More detailed installation instructions using conda can be found in `examples/00_python_virtual_env.ipynb`.
39+
40+
There are aksi .txt equivalents that can be used for installing from pip, like so:
41+
42+
```pip install -r env_of_choice.txt```
43+
44+
745
Disclaimer
846
==========
947

autotest/test_model.py

+10-6
Original file line numberDiff line numberDiff line change
@@ -181,18 +181,18 @@ def test_model(domain, control, processes, tmp_path):
181181
9: {
182182
"PRMSChannel": {
183183
"seg_outflow": {
184-
"drb_2yr": 1306.7499262980173,
185-
"hru_1": 13.690165950142445,
186-
"ucb_2yr": 1694.4729153330018,
184+
"drb_2yr": 1152.9343097732165,
185+
"hru_1": 13.37194463307104,
186+
"ucb_2yr": 1694.47282087809,
187187
},
188188
},
189189
},
190190
99: {
191191
"PRMSChannel": {
192192
"seg_outflow": {
193-
"drb_2yr": 1818.6285476625615,
194-
"hru_1": 14.70413315830374,
195-
"ucb_2yr": 710.2513423457016,
193+
"drb_2yr": 1785.102361378249,
194+
"hru_1": 14.614890968139237,
195+
"ucb_2yr": 710.4918051193282,
196196
},
197197
},
198198
},
@@ -233,6 +233,8 @@ def test_model(domain, control, processes, tmp_path):
233233
if not success:
234234
fail_prms_compare = True
235235
all_success = False
236+
if failfast:
237+
assert False, "PRMS comparison failfast"
236238

237239
# Regression checking
238240
if istep in regression_ans:
@@ -251,6 +253,8 @@ def test_model(domain, control, processes, tmp_path):
251253
if not success:
252254
fail_regression = True
253255
all_success = False
256+
if failfast:
257+
assert False, "Regression failffast"
254258

255259
# check at the end and error if one or more steps didn't pass
256260
if not all_success:

autotest/test_soilzone.py

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ def test_init(self, domain, control, tmp_path):
3737
"soil_lower",
3838
# "soil_lower_ratio",
3939
"soil_moist",
40+
"soil_moist_prev",
4041
"soil_moist_tot",
4142
"soil_rechr",
4243
"soil_to_gw",

doc/api/atmosphere.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ Atmospheric forcing models.
1111
:toctree: generated/
1212

1313
PRMSSolarGeometry
14-
PRMSBoundaryLayer
14+
PRMSAtmosphere

doc/api/base.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Base classes for the modeling system.
1313
Accessor
1414
Adapter
1515
Control
16-
Meta
16+
meta
1717
Budget
1818
StorageUnit
1919
Model

doc/api/pynhm.ControlVariables.rst

-24
This file was deleted.

doc/api/pynhm.PrmsParameters.rst

-24
This file was deleted.

0 commit comments

Comments
 (0)