Skip to content

Commit

Permalink
Merge pull request #66 from IMMM-SFA/dev
Browse files Browse the repository at this point in the history
JOSS Review Meta-Response
  • Loading branch information
rg727 authored Apr 10, 2024
2 parents 5278060 + 972b05e commit 75d0ba2
Show file tree
Hide file tree
Showing 121 changed files with 74,978 additions and 55,569 deletions.
71 changes: 36 additions & 35 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,40 @@
---
name: build

on: [push, pull_request]

on: # yamllint disable-line rule:truthy
push:
branches-ignore:
- 'false'
pull_request:
branches-ignore:
- 'false'
jobs:
build:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest]

env:
OS: ${{ matrix.os }}
PYTHON: '3.9'

steps:

- uses: actions/checkout@v1

- name: Set up Python
uses: actions/setup-python@master
with:
python-version: 3.9

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python setup.py install
- name: Test and generate coverage report on Linux
run: |
pip install pytest
pip install pytest-cov
pytest --cov=./ --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
file: ./coverage.xml
fail_ci_if_error: true
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest, windows-latest]

env:
OS: ${{ matrix.os }}
PYTHON: '3.9'

steps:

- uses: actions/checkout@v1

- name: Set up Python
uses: actions/setup-python@master
with:
python-version: 3.9

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python setup.py install
- name: Test and generate coverage report on Linux
run: |
pip install pytest
pip install pytest-cov
pytest --cov=./ --cov-report=xml
7 changes: 5 additions & 2 deletions .github/workflows/draft-pdf.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
on: [push]

---
on: # yamllint disable-line rule:truthy
push:
branches-ignore:
- '**'
jobs:
paper:
runs-on: ubuntu-latest
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: pre-commit

on: # yamllint disable-line rule:truthy
push:
branches-ignore:
- 'false'
pull_request:
branches-ignore:
- 'false'

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Install pre-commit
run: pip install pre-commit
- name: Run pre-commit on all files
run: pre-commit run --all-files
84 changes: 84 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
---
default_language_version:
python: python3

exclude: 'paper/paper.md'

repos:
- repo: https://github.com/asottile/pyupgrade
rev: v3.8.0
hooks:
- id: pyupgrade
args: ['--py39-plus']
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: debug-statements
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
hooks:
- id: python-check-blanket-noqa
- id: rst-inline-touching-normal
- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
args: ['--target-version=py39']
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
hooks:
- id: flake8
args: ['--max-line-length=120', '--extend-ignore=E203,E402,F401,F403']
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
args: ['--profile=black']
- repo: https://github.com/nbQA-dev/nbQA
rev: 1.7.0
hooks:
- id: nbqa-pyupgrade
args: ['--py39-plus']
additional_dependencies: ['pyupgrade==3.8.0']
- id: nbqa-black
additional_dependencies: ['black==23.3.0']
args: ['--line-length=88', '--target-version=py39']
- id: nbqa-isort
additional_dependencies: ['isort==5.12.0']
args: ['--profile=black']
- repo: https://github.com/pycqa/pydocstyle
rev: 6.3.0
hooks:
- id: pydocstyle
- repo: https://github.com/keewis/blackdoc
rev: v0.3.8
hooks:
- id: blackdoc
additional_dependencies: ['black==23.3.0']
args: ['--target-version=py39']
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.32.0
hooks:
- id: yamllint
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.23.2
hooks:
- id: check-github-workflows
- repo: meta
hooks:
- id: check-hooks-apply
- id: check-useless-excludes

ci:
autofix_commit_msg: |
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
autofix_prs: true
autoupdate_branch: ''
autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate'
autoupdate_schedule: weekly
skip: []
submodules: false
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ authors:
orcid: "https://orcid.org/0000-0002-7963-6102"
title: "statemodify: a Python framework to facilitate accessible exploratory modeling for discovering drought vulnerabilities in Colorado’s West Slope river basins"
doi: 10.5281/zenodo.10258007
url: "https://github.com/IMMM-SFA/statemodify"
url: "https://github.com/IMMM-SFA/statemodify"
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
include statemodify/data/*.*
include statemodify/tests/data/*.*
include statemodify/tests/data/*.*
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
[![codecov](https://codecov.io/gh/IMMM-SFA/statemodify/branch/main/graph/badge.svg?token=csQBZMRSdp)](https://codecov.io/gh/IMMM-SFA/statemodify)
[![Static Badge](https://img.shields.io/badge/Powered%20by-MSDLIVE-blue?label=Powered%20by&color=blue)](https://statemodify.msdlive.org)
[![DOI](https://zenodo.org/badge/484620418.svg)](https://zenodo.org/doi/10.5281/zenodo.10258007)
[![pre-commit](https://github.com/IMMM-SFA/statemodify/actions/workflows/pre-commit.yml/badge.svg)](https://github.com/IMMM-SFA/statemodify/actions/workflows/pre-commit.yml)



Expand Down
78 changes: 39 additions & 39 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
"""Configuration file for the Sphinx documentation builder.
import sys
For the full list of built-in configuration values, see the documentation:
https://www.sphinx-doc.org/en/master/usage/configuration.html
"""
import os
import sys

sys.path.insert(0, os.path.abspath('.'))
sys.path.insert(0, os.path.abspath('../'))
sys.path.insert(0, os.path.abspath('../../'))
sys.path.insert(0, os.path.abspath("."))
sys.path.insert(0, os.path.abspath("../"))
sys.path.insert(0, os.path.abspath("../../"))

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = 'statemodify'
copyright = '2023, Battelle Memorial Institute'
author = 'Rohini S. Gupta'
project = "statemodify"
copyright = "2023, Battelle Memorial Institute"
author = "Rohini S. Gupta"

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand All @@ -29,29 +29,29 @@
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.autosectionlabel',
'sphinx.ext.autosummary',
'sphinx.ext.duration',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
'sphinx.ext.napoleon',
'sphinx.ext.viewcode',
'sphinx_autodoc_typehints',
'sphinx_click',
'sphinx_copybutton',
"sphinx.ext.autodoc",
"sphinx.ext.autosectionlabel",
"sphinx.ext.autosummary",
"sphinx.ext.duration",
"sphinx.ext.doctest",
"sphinx.ext.intersphinx",
"sphinx.ext.napoleon",
"sphinx.ext.viewcode",
"sphinx_autodoc_typehints",
"sphinx_click",
"sphinx_copybutton",
]

intersphinx_mapping = {
'python': ('https://docs.python.org/3/', None),
'sphinx': ('https://www.sphinx-doc.org/en/master/', None),
"python": ("https://docs.python.org/3/", None),
"sphinx": ("https://www.sphinx-doc.org/en/master/", None),
}
intersphinx_disabled_domains = ['std']
intersphinx_disabled_domains = ["std"]

templates_path = ['_templates']
templates_path = ["_templates"]

# The main toctree document.
main_doc = 'index'
main_doc = "index"

pygments_style = None
autosummary_generate = True
Expand All @@ -60,39 +60,39 @@
# -- Options for autodoc

# Python methods should be presented in source code order
autodoc_member_order = 'bysource'
autodoc_member_order = "bysource"

# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output


html_theme = 'sphinx_book_theme'
html_theme = "sphinx_book_theme"

html_theme_options = {
'logo_only': True,
'repository_url': 'https://github.com/IMMM-SFA/statemodify',
'use_repository_button': True,
'use_issues_button': True,
'use_edit_page_button': True,
'path_to_docs': 'docs/source',
"logo_only": True,
"repository_url": "https://github.com/IMMM-SFA/statemodify",
"use_repository_button": True,
"use_issues_button": True,
"use_edit_page_button": True,
"path_to_docs": "docs/source",
}

# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
html_title = 'statemodify documentation'
html_title = "statemodify documentation"

# -- Options for EPUB output
epub_show_urls = 'footnote'
epub_show_urls = "footnote"

# -- Options for sphinx-copybutton
copybutton_prompt_text = r'\$ '
copybutton_prompt_text = r"\$ "
copybutton_prompt_is_regexp = True

html_show_sourcelink = False

# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
html_logo = 'images/logo_statemodify.png'
html_logo = "images/logo_statemodify.png"

# 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.
Expand Down
25 changes: 16 additions & 9 deletions docs/source/getting-started/quickstarter.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ To demonstrate the functionality of **statemodify**, we have generated 5 noteboo
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 <https:/statemodify.msdlive.org>`
The notebooks are hosted in MSD-LIVE containers and can be found at: `https:/statemodify.msdlive.org <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.
Expand All @@ -27,15 +27,15 @@ You will be taken to a JupyterLab homepage with "data" and "notebook" buckets on

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.
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
:alt: Restarting the Kernel

Figure 1: Restarting the Kernel
Figure 1: Restarting the Kernel


The table below lists the
The table below lists the

.. list-table:: Notebook Topics
:widths: 25 50 50 50 50 50
Expand All @@ -49,8 +49,15 @@ The table below lists the
- 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 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.
- 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.


.. include:: ../notebooks/N1_Demand_WaterRights_File_Modification.rst
.. include:: ../notebooks/N2_Evaporation_File_Modification.rst
.. include:: ../notebooks/N3_Reservoir_File_Modification.rst
.. include:: ../notebooks/N4_Streamflow_File_Modification.rst
.. include:: ../notebooks/N5_Batch_Modification.rst
Loading

0 comments on commit 75d0ba2

Please sign in to comment.