Skip to content

Commit bdfb4b9

Browse files
authored
Merge pull request #112 from UW-Hydro/develop
Develop
2 parents e687a7a + dd91a70 commit bdfb4b9

30 files changed

+1778
-251
lines changed

README.md

Lines changed: 48 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -1,109 +1,68 @@
1-
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/DavidChoi76/pysumma_binder_test.git/master)
1+
# pysumma
22

3-
# pySUMMA
4-
5-
The pySUMMA is an Object-Oriented Python wrapper for the manipulation, display and analysis of
6-
SUMMA model (Structure for Unifying Multiple Modeling Alternatives)
3+
pysumma is a Python wrapper for manipulating, running, managing, and analyzing
4+
of SUMMA (Structure for Unifying Multiple Modeling Alternatives)
75
* [SUMMA web site at UCAR ](https://www.rap.ucar.edu/projects/summa)
86

9-
## The pySUMMA is intended to provide
10-
11-
- Get and set model parameters and method (fileManager and Decision file)
12-
- Run SUMMA Model
13-
- Visualize netcdf of SUMMA outputs
14-
- Operate pySUMMA with jupyter notebook environment
15-
- Interact Hydorshare to download SUMMA TestCases and post the output of SUMMA
16-
- Automate model calibration or sensitivity analysis (Future work)
17-
18-
## How to run pySUMMA on HydroShare
19-
(Link YouTube: https://www.youtube.com/watch?v=pL-LNd474Tw)
20-
1) log in HydoShare(https://www.hydroshare.org)
21-
2) Start CUAHSI JupyterHub from APPS menu on HydroShare(https://www.hydroshare.org/apps/)
22-
3) Open "Welcome.ipynb" to download pySUMMA resources from HydroShare
23-
- run the code "1.How to connect with HydroShare"
24-
- change the code from "resid = os.environ['HS_RES_ID']" to "resid = 'c1bb4a12bff44bf08c5958cba7947348'".
25-
4) You can see the list of Jupyter Notebooks and click one of Jupyter Notebook.
26-
5) Run one of Jupyter Notebooks.
27-
28-
### Examples of manipulating and running pySUMMA :
29-
30-
Refereed paper : Clark, M. P., B. Nijssen, J. D. Lundquist, D. Kavetski, D. E. Rupp, R. A. Woods,
31-
J. E. Freer, E. D. Gutmann, A. W. Wood, D. J. Gochis, R. M. Rasmussen, D. G. Tarboton, V. Mahat,
32-
G. N. Flerchinger, D. G. Marks, 2015b: A unified approach for process-based hydrologic modeling:
33-
Part 2. Model implementation and case studies. Water Resources Research,
34-
[doi:10.1002/2015WR017200](https://agupubs.onlinelibrary.wiley.com/doi/abs/10.1002/2015WR017200).
35-
36-
#### HydroShare resources
37-
**(Composite Resource)** [Jupyter Notebooks to demonstrate SUMMA Model at Reynolds Mountain East on HydroShare](https://www.hydroshare.org/resource/c1bb4a12bff44bf08c5958cba7947348/)
38-
39-
**(Composite Resource)** [Procedure and Supplementary documents Collaborative hydrologic modeling on HydroShare](https://www.hydroshare.org/resource/184eea3d3412418a886db87ffdb510b6/)
40-
41-
**(Model Program)** [SUMMA 2.0.0 Sopron version (lubuntu-16.10)](https://www.hydroshare.org/resource/a5dbd5b198c9468387f59f3fefc11e22/)
42-
43-
**(Model Program)** [SUMMA 2.0.0 Sopron version (lubuntu-16.04.4)](https://www.hydroshare.org/resource/041671fbc8a544cd8a979af6c2227f92/)
44-
45-
**(Model Instance)** [Sensitivity to Stomatal Resistance Parameterization of SUMMA Model in Aspen stand at Reynolds Mountain East)](https://www.hydroshare.org/resource/e1a73bc4e7c34166895ff20ae53371f5/)
46-
47-
**(Model Instance)** [The Impact of Root Distributions Parameters of SUMMA Model in Aspen stand at Reynolds Mountain East)](https://www.hydroshare.org/resource/eed6f3faedad4c17992bb361bd492caa/)
48-
49-
**(Model Instance)** [The Impact of Lateral Flow Parameterizations on ET of SUMMA Model at Reynolds Mountain East)](https://www.hydroshare.org/resource/11d471b6096d4eaa81068256d281a919/)
50-
51-
**(Model Instance)** [The Impact of Lateral Flow Parameterizations on Runoff of SUMMA Model at Reynolds Mountain East)](https://www.hydroshare.org/resource/5d20a87ecc5b495097e073e4d5f58d0c/)
7+
pysumma provides methods for:
8+
- Running SUMMA
9+
- Modifying SUMMA input files
10+
- Automatically parallelizing distributed and sensitivity analysis type experiments
11+
- Calibration via OSTRICH
12+
- Visualizing output
5213

53-
**(Model Instance)** [The Impact of the canopy shortwave radiation parameterizations of SUMMA Model at Reynolds Mountain East)](https://www.hydroshare.org/resource/0c4fd861a9694b2f9fcdf19eb33a6b54/)
14+
# Installation
5415

55-
**(Model Instance)** [The Impact of LAI parameter on the below canopy shortwave radiation of SUMMA Model at Reynolds Mountain East)](https://www.hydroshare.org/resource/2bedc3b88f3547d5b9b0ade7248dfdd5/)
56-
57-
**(Model Instance)** [The Impact of the canopy wind parameter for the exponential wind profile of SUMMA Model at Reynolds Mountain East)](https://www.hydroshare.org/resource/4064a7b014094f50aa63730e4a3ff976/)
58-
59-
**(Collection Resource)** [Test Cases of SUMMA modeling that include model instances and Jupyter notebooks for SUMMA 2nd Paper(2015))](https://www.hydroshare.org/resource/1b7a9af74daa4a449190f922b5db366e/)
60-
61-
## How to run pySUMMA locally
62-
63-
### Installation and Usage
16+
## Dependencies
17+
A conda environment is available for management of pysumma's dependencies.
18+
You can create your own environment from this file by running:
19+
```
20+
conda env create -f environment.yml
21+
```
6422

65-
#### pySUMMA requires Python 3.6 and following packages :
23+
Then, you can activate this environment with `conda activate pysumma`.
24+
Before installing pysumma into this environment you may also wish to install it as a kernel in your Jupyter environments.
25+
This can be accomplished by running:
6626

67-
- xarray 0.10.7 : N-D labeled arrays and datasets in python
68-
- numpy 1.16.1 : the fundamental package for scientific computing with Python
69-
- matplotlib 3.0.2 : a Python 2D plotting library
70-
- seaborn 0.9.0 : statistical data visualization
71-
- jupyterthemes 0.20.0 : select and install a Jupyter notebook theme
72-
- hs-restclient 1.3.3 : HydroShare REST API python client library
73-
- ipyleaflet 0.9.2 : A jupyter widget for dynamic Leaflet maps
74-
- Linux Environment (VirtualBox 5.2.8)
75-
- [lubuntu-16.10 executable](https://www.hydroshare.org/resource/a5dbd5b198c9468387f59f3fefc11e22/)
76-
- [lubuntu-16.04.4 executable](https://www.hydroshare.org/resource/041671fbc8a544cd8a979af6c2227f92/)
27+
```
28+
python -m ipykernel install --user --name=pysumma
29+
```
7730

78-
### Download and Install pySUMMA:
31+
With this environment active you can install pysumma this environment with the instructions below.
7932

80-
**1.)** Download pySUMMA
81-
```python
82-
~/Downloads$ git clone https://github.com/uva-hydroinformatics/pysumma.git
33+
## Installing pysumma
34+
Currently we only support building pysumma from source. This can be accomplished by
35+
running:
8336
```
84-
85-
**2.)** change directory into pysumma folder same level with setup.py.
86-
```python
87-
~/Downloads/pysumma$ pip install .
37+
git clone https://github.com/UW-Hydro/pysumma.git
38+
cd pysumma
39+
python setup.py install
8840
```
8941

90-
#### The UML of pySUMMA
91-
![Image of UML](UML.png)
92-
93-
## Reference of SUMMA
42+
If you plan on helping to develop pysumma you may wish to use the following to install
43+
```
44+
git clone https://github.com/UW-Hydro/pysumma.git
45+
cd pysumma
46+
python setup.py develop
47+
```
9448

49+
# Additional SUMMA References
9550
- [Document](http://summa.readthedocs.io/en/latest/) : SUMMA documentation is available online and remains a work in progress.
9651
- [Source Code](https://github.com/NCAR/summa) : NCAR github
97-
98-
## Bugs
99-
Our issue tracker is at https://github.com/uva-hydroinformatics/pysumma/issues.
52+
53+
# Bugs
54+
Our issue tracker is at https://github.com/UW-Hydro/pysumma/issues.
10055
Please report any bugs that you find. Or, even better, fork the repository on
10156
GitHub and create a pull request. All changes are welcome, big or small, and we
10257
will help you make the pull request if you are new to git
10358
(just ask on the issue).
10459

105-
## License
106-
Distributed with a MIT license; see LICENSE.txt::
107-
108-
Copyright (C) 2017 pySUMMA Developers
109-
YoungDon Choi <[email protected]>
60+
# How to run pySUMMA on HydroShare
61+
(Link YouTube: https://www.youtube.com/watch?v=pL-LNd474Tw)
62+
1) log in HydoShare(https://www.hydroshare.org)
63+
2) Start CUAHSI JupyterHub from APPS menu on HydroShare(https://www.hydroshare.org/apps/)
64+
3) Open "Welcome.ipynb" to download pySUMMA resources from HydroShare
65+
- run the code "1.How to connect with HydroShare"
66+
- change the code from "resid = os.environ['HS_RES_ID']" to "resid = 'c1bb4a12bff44bf08c5958cba7947348'".
67+
4) You can see the list of Jupyter Notebooks and click one of Jupyter Notebook.
68+
5) Run one of Jupyter Notebooks.

docs/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line.
5+
SPHINXOPTS =
6+
SPHINXBUILD = sphinx-build
7+
SPHINXPROJ = pysumma
8+
SOURCEDIR = .
9+
BUILDDIR = _build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/api.rst

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
.. currentmodule:: pysumma
2+
.. _api:
3+
4+
#############
5+
API reference
6+
#############
7+
8+
This page provides an auto-generated summary of pysumma's API. For more details
9+
and examples, refer to the main documentation.
10+
11+
Simulation
12+
==========
13+
.. autoclass:: pysumma.Simulation
14+
:members:
15+
16+
Ensemble
17+
=======
18+
19+
.. autoclass:: pysumma.Ensemble
20+
:members:
21+
22+
Distributed
23+
=======
24+
25+
.. autoclass:: pysumma.Distributed
26+
:members:
27+

docs/conf.py

Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
#!/usr/bin/env python3
2+
# -*- coding: utf-8 -*-
3+
#
4+
# This file is execfile()d with the current directory set to its
5+
# containing dir.
6+
#
7+
# Note that not all possible configuration values are present in this
8+
# autogenerated file.
9+
#
10+
# All configuration values have a default; values that are commented out
11+
# serve to show the default.
12+
13+
# If extensions (or modules to document with autodoc) are in another directory,
14+
# add these directories to sys.path here. If the directory is relative to the
15+
# documentation root, use os.path.abspath to make it absolute, like shown here.
16+
#
17+
import os
18+
import sys
19+
20+
import sphinx_rtd_theme
21+
22+
sys.path.insert(0, os.path.abspath('.'))
23+
sys.path.insert(0, os.path.abspath('../'))
24+
25+
# -- General configuration ------------------------------------------------
26+
27+
# If your documentation needs a minimal Sphinx version, state it here.
28+
#
29+
# needs_sphinx = '1.0'
30+
31+
# Add any Sphinx extension module names here, as strings. They can be
32+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
33+
# ones.
34+
extensions = ['sphinx.ext.autodoc',
35+
'sphinx.ext.extlinks',
36+
'sphinx.ext.mathjax',
37+
'sphinx.ext.viewcode',
38+
'sphinx.ext.napoleon',
39+
'sphinx.ext.autosummary']
40+
41+
extlinks = {'issue': ('https://github.com/UW-Hydro/pysumma/issues/%s', 'GH'),
42+
'pull': ('https://github.com/UW-Hydro/pysumma/pull/%s', 'PR'),
43+
}
44+
45+
napoleon_google_docstring = False
46+
napoleon_use_param = False
47+
napoleon_use_ivar = False
48+
49+
# Add any paths that contain templates here, relative to this directory.
50+
templates_path = ['_templates']
51+
52+
# The suffix(es) of source filenames.
53+
# You can specify multiple suffix as a list of string:
54+
#
55+
# source_suffix = ['.rst', '.md']
56+
source_suffix = '.rst'
57+
58+
# The master toctree document.
59+
master_doc = 'index'
60+
61+
# General information about the project.
62+
project = 'pysumma'
63+
copyright = '2020, YoungDon Choi, Andrew Bennett'
64+
author = 'YoungDon Choi, Andrew Bennett'
65+
66+
# The version info for the project you're documenting, acts as replacement for
67+
# |version| and |release|, also used in various other places throughout the
68+
# built documents.
69+
#
70+
# The short X.Y version.
71+
version = '0.0.0'
72+
# The full version, including alpha/beta/rc tags.
73+
release = '0.0.0'
74+
75+
# The language for content autogenerated by Sphinx. Refer to documentation
76+
# for a list of supported languages.
77+
#
78+
# This is also used if you do content translation via gettext catalogs.
79+
# Usually you set "language" from the command line for these cases.
80+
language = None
81+
82+
# List of patterns, relative to source directory, that match files and
83+
# directories to ignore when looking for source files.
84+
# This patterns also effect to html_static_path and html_extra_path
85+
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
86+
87+
# The name of the Pygments (syntax highlighting) style to use.
88+
pygments_style = 'sphinx'
89+
90+
# If true, `todo` and `todoList` produce output, else they produce nothing.
91+
todo_include_todos = False
92+
93+
94+
# -- Options for HTML output ----------------------------------------------
95+
96+
# The theme to use for HTML and HTML Help pages. See the documentation for
97+
# a list of builtin themes.
98+
#
99+
html_theme = "sphinx_rtd_theme"
100+
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
101+
102+
# Theme options are theme-specific and customize the look and feel of a theme
103+
# further. For a list of options available for each theme, see the
104+
# documentation.
105+
#
106+
# html_theme_options = {}
107+
108+
# Add any paths that contain custom static files (such as style sheets) here,
109+
# relative to this directory. They are copied after the builtin static files,
110+
# so a file named "default.css" will overwrite the builtin "default.css".
111+
html_static_path = ['_static']
112+
113+
114+
# -- Options for HTMLHelp output ------------------------------------------
115+
116+
# Output file base name for HTML help builder.
117+
htmlhelp_basename = 'pysummadoc'
118+
119+
120+
# -- Options for LaTeX output ---------------------------------------------
121+
122+
latex_elements = {
123+
# The paper size ('letterpaper' or 'a4paper').
124+
#
125+
# 'papersize': 'letterpaper',
126+
127+
# The font size ('10pt', '11pt' or '12pt').
128+
#
129+
# 'pointsize': '10pt',
130+
131+
# Additional stuff for the LaTeX preamble.
132+
#
133+
# 'preamble': '',
134+
135+
# Latex figure (float) alignment
136+
#
137+
# 'figure_align': 'htbp',
138+
}
139+
140+
# Grouping the document tree into LaTeX files. List of tuples
141+
# (source start file, target name, title,
142+
# author, documentclass [howto, manual, or own class]).
143+
latex_documents = [
144+
(master_doc, 'pysumma.tex', 'pysumma Documentation',
145+
'YounDon Choi, Andrew Bennett', 'manual'),
146+
]
147+
148+
149+
# -- Options for manual page output ---------------------------------------
150+
151+
# One entry per manual page. List of tuples
152+
# (source start file, name, description, authors, manual section).
153+
man_pages = [
154+
(master_doc, 'pysumma', 'pysumma Documentation',
155+
[author], 1)
156+
]
157+
158+
159+
# -- Options for Texinfo output -------------------------------------------
160+
161+
# Grouping the document tree into Texinfo files. List of tuples
162+
# (source start file, target name, title, author,
163+
# dir menu entry, description, category)
164+
texinfo_documents = [
165+
(master_doc, 'pysumma', 'pysumma Documentation',
166+
author, 'pysumma ', 'One line description of project.',
167+
'Miscellaneous'),
168+
]

0 commit comments

Comments
 (0)