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

Merge Request for API branch #34

Merged
merged 20 commits into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from 13 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
4 changes: 2 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@

# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico), 16x16 or 32x32 pixels.
html_favicon = '_static/favicon.ico'
# html_favicon = '_static/favicon.ico'

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named 'default.css' will overwrite the builtin 'default.css'.
html_static_path = ['_static']
# html_static_path = ['_static']
2 changes: 0 additions & 2 deletions docs/source/examples/modify-inputs.rst

This file was deleted.

53 changes: 53 additions & 0 deletions docs/source/getting-started/quickstarter.rst
Original file line number Diff line number Diff line change
@@ -1,2 +1,55 @@
Quickstarter
==============

To demonstrate the functionality of **statemodify**, we have generated 5 notebooks that highlight how to use the functions in the package and show some very basic analyses that can be done with the output data. Each notebook demonstrates 1-2 **statemodify** functions for a specific West Slope basin in Colorado. The notebooks usually follow a specific form:

1. Run a baseline simulation for the basin (about 4 minutes)

2. Plot the baseline shortages for specific users or reservoir storage

3. Introduce a statemodify function that samples a specific uncertainty (evaporation, demand, streamflow, water rights, etc.)

4. Create a new set of input files to run through StateMod

5. Run each StateMod simulation (usually about 2 simulations, each at 4 minutes)

6. Plot the new shortages or reservoir levels with respect to the baseline values.


The notebooks are hosted in MSD-LIVE containers and can be found at: https:/statemodify.msdlive.org


You will be taken to a JupyterLab homepage with "data" and "notebook" buckets on the side. The "data" directory contains all the StateMod datasets and some other template files. Click on the "notebooks" directory and choose a notebook to start. Press shift + enter to execute the cells in the notebook.


.. figure:: ../images/quickstarter_1.png
:alt: JupyterLab home screen

Figure 1: JupyterLab home screen

IMPORTANT: When you finish a notebook and move on to another one, please restart the kernel and clear the outputs as shown below.

.. figure:: ../images/quickstarter_2.png
:alt: Restarting the Kernel

Figure 1: Restarting the Kernel



.. list-table:: Notebook Topics
:widths: 25 50 50 50 50 50
:header-rows: 1

* - Topic
- Notebook 1: Getting Started and Using the DDM and DDR modification functions in the San Juan Subbasin
- Notebook 2: Using the EVA modification functions in the Gunnison Subbasin
- Notebook 3: Using the RES modification function in the Upper Colorado Subbasin
- Notebook 4: Using the XBM and IWR modification functions across all basins
- Notebook 5: Sampling multiple uncertainties

* - Description
- This notebook has more general intro information on StateModify and shows how changes to demand and water rights can lead to changes to user shortages in the San Juan Subbasin.
- This notebook looks at how changes in evaporation in reservoirs in the Gunnison subbasin lead to changes to reservoir levels
- This notebook looks at how changes in storage in reservoirs in the Upper Colorado subbasin lead to changes to user shortages
- This notebook debuts the stationary Hidden Markov Model to generate alternative streamflow scenarios across the basins.
- This notebook demonstrates how to create a global Latin hypercube sample to consider multiple uncertainties in a basin. Quickstarter
2 changes: 0 additions & 2 deletions docs/source/getting-started/tutorial.rst

This file was deleted.

Binary file modified docs/source/images/figure_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/images/figure_1_old.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/source/images/logo_statemodify.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/images/quickstarter_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/images/quickstarter_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
110 changes: 76 additions & 34 deletions docs/source/index.rst

Large diffs are not rendered by default.

206 changes: 183 additions & 23 deletions docs/source/reference/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,41 +29,60 @@ statemodify.modify_ddm

.. autofunction:: statemodify.modify_ddm

statemodify.modify_single_ddm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autofunction:: statemodify.modify_single_ddm

statemodify.modify_ddr
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autofunction:: statemodify.modify_ddr

statemodify.modify_single_ddr
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autofunction:: statemodify.modify_single_ddr

statemodify.apply_on_off_modification
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autofunction:: statemodify.apply_on_off_modification

statemodify.apply_seniority_modification
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autofunction:: statemodify.apply_seniority_modification

statemodify.modify_xbm_iwr
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autofunction:: statemodify.modify_xbm_iwr

Output Modification
---------------------------------

statemodify.convert_xdd
statemodify.modify_xbm_iwr
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autofunction:: statemodify.convert_xdd
.. autofunction:: statemodify.modify_single_xbm_iwr

Sampling
---------------------------------
statemodify.get_reservoir_structure_ids
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

statemodify.build_problem_dict
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. autofunction:: statemodify.get_reservoir_structure_ids

.. autofunction:: statemodify.build_problem_dict
statemodify.modify_single_res
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

statemodify.generate_samples
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. autofunction:: statemodify.modify_single_res

.. autofunction:: statemodify.generate_samples
statemodify.modify_res
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

statemodify.validate_modify_dict
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. autofunction:: statemodify.modify_res

.. autofunction:: statemodify.validate_modify_dict


HMM Functions
---------------------------------

statemodify.hmm_multisite_fit
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand All @@ -75,25 +94,125 @@ statemodify.hmm_multisite_sample

.. autofunction:: statemodify.hmm_multisite_sample

statemodify.get_samples
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autofunction:: statemodify.get_samples

statemodify.generate_dry_state_means
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autofunction:: statemodify.generate_dry_state_means

statemodify.generate_wet_state_means
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autofunction:: statemodify.generate_wet_state_means

statemodify.generate_dry_covariance_matrix
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autofunction:: statemodify.generate_dry_covariance_matrix

statemodify.generate_wet_covariance_matrix
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autofunction:: statemodify.generate_wet_covariance_matrix

statemodify.generate_transition_matrix
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autofunction:: statemodify.generate_transition_matrix

statemodify.calculate_array_monthly
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autofunction:: statemodify.calculate_array_monthly

statemodify.calculate_array_annual
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autofunction:: statemodify.calculate_array_annual

statemodify.calculate_annual_sum
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autofunction:: statemodify.calculate_annual_sum

statemodify.calculate_annual_mean_fractions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autofunction:: statemodify.calculate_annual_mean_fractions

statemodify.fit_iwr_model
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autofunction:: statemodify.fit_iwr_model


statemodify.generate_hmm_inputs
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autofunction:: statemodify.generate_hmm_inputs

statemodify.generate_flows
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autofunction:: statemodify.generate_flows


statemodify.generate_modified_file
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autofunction:: statemodify.generate_modified_file


Output Modification
---------------------------------

statemodify.convert_xdd
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autofunction:: statemodify.convert_xdd

statemodify.read_xre
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autofunction:: statemodify.read_xre

statemodify.plot_flow_duration_curves
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
statemodify.extract_xre_data
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autofunction:: statemodify.plot_flow_duration_curves
.. autofunction:: statemodify.extract_xre_data

statemodify.plot_res_quantiles

Sampling
---------------------------------

statemodify.build_problem_dict
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autofunction:: statemodify.plot_res_quantiles
.. autofunction:: statemodify.build_problem_dict

statemodify.plot_reservoir_boxes
statemodify.generate_samples
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autofunction:: statemodify.plot_reservoir_boxes
.. autofunction:: statemodify.generate_samples

statemodify.validate_modify_dict
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autofunction:: statemodify.validate_modify_dict

statemodify.generate_sample_iwr
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autofunction:: statemodify.generate_sample_iwr

statemodify.generate_sample_all_params
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autofunction:: statemodify.generate_sample_all_params

Modification
---------------------------------
Expand Down Expand Up @@ -148,6 +267,47 @@ statemodify.Modify

.. autofunction:: statemodify.Modify

Batch Modification
---------------------------------

statemodify.get_required_arguments
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autofunction:: statemodify.get_required_arguments

statemodify.get_arguments_values
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autofunction:: statemodify.get_arguments_values

statemodify.generate_parameters
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autofunction:: statemodify.generate_parameters

statemodify.modify_batch
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autofunction:: statemodify.modify_batch

Visualization
---------------------------------

statemodify.plot_flow_duration_curves
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autofunction:: statemodify.plot_flow_duration_curves

statemodify.plot_res_quantiles
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autofunction:: statemodify.plot_res_quantiles

statemodify.plot_reservoir_boxes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autofunction:: statemodify.plot_reservoir_boxes

Utilities
---------------------------------

Expand Down
Loading