Skip to content
Merged
Show file tree
Hide file tree
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
12 changes: 12 additions & 0 deletions .docs/code.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,18 @@ Contents:
./source/flopy.mf6.modflow.mfgwf*


MODFLOW 6 Groundwater Transport Packages
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Contents:

.. toctree::
:glob:
:maxdepth: 4

./source/flopy.mf6.modflow.mfgwt*


MODFLOW 6 Utilities
^^^^^^^^^^^^^^^^^^^

Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ jobs:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:

if: github.repository_owner == 'modflowpy'
steps:
# check out repo
- name: Checkout flopy repo
uses: actions/checkout@v2
Expand Down Expand Up @@ -109,11 +110,11 @@ jobs:
activate-environment: flopy
use-only-tar-bz2: true

- name: Add jupyter and nbconvert to notebooks run
- name: Add jupyter and jupytext to notebooks run
if: matrix.run-type == 'nb'
shell: bash -l {0}
run: |
mamba install --name flopy jupyter nbconvert
mamba install --name flopy jupyter jupytext

- name: Add packages to flopy environment using mamba or conda
shell: bash -l {0}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/rtd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
strategy:
fail-fast: false

if: github.repository_owner == 'modflowpy'
steps:
- name: Checkout flopy repo
uses: actions/checkout@v2
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ pmv.plot_specific_discharge(spdis, color='white')
Additional FloPy Resources
------------------------------------------------

- [Tutorials](http://modflowpy.github.io/flopydoc/tutorials.html) demonstrating basic FloPy use.
- [Tutorials](https://flopy.readthedocs.io/en/latest/tutorials.html) demonstrating basic FloPy use.

- [MODFLOW 6 Example Problems](https://modflow6-examples.readthedocs.io/en/latest/) demonstrating FloPy use to create, run, and post-process MODFLOW 6 models.

- [Jupyter notebooks](docs/notebook_examples.md) demonstrating the use of FloPy pre- and post-processing capabilities with a variety of MODFLOW-based models.

Expand Down
47 changes: 19 additions & 28 deletions autotest/autotest_notebooks.py
Original file line number Diff line number Diff line change
@@ -1,48 +1,39 @@
# Remove the temp directory and then create a fresh one
import os
import shutil
import subprocess

nbdir = os.path.join('..', 'examples', 'Notebooks')
faqdir = os.path.join('..', 'examples', 'FAQ')
nbdir = os.path.join("..", "examples", "Notebooks")
faqdir = os.path.join("..", "examples", "FAQ")
gwdir = os.path.join("..", "examples", "groundwater_paper", "Notebooks")

# -- make working directories
ddir = os.path.join(nbdir, 'data')
ddir = os.path.join(nbdir, "data")
if os.path.isdir(ddir):
shutil.rmtree(ddir)
os.mkdir(ddir)

tempdir = os.path.join('.', 'temp')
if os.path.isdir(tempdir):
shutil.rmtree(tempdir)
os.mkdir(tempdir)

testdir = os.path.join('.', 'temp', 'Notebooks')
if os.path.isdir(testdir):
shutil.rmtree(testdir)
os.mkdir(testdir)


def get_Notebooks(dpth):
return [f for f in os.listdir(dpth) if f.endswith('.ipynb')]
return [f for f in os.listdir(dpth) if f.endswith(".ipynb")]


def run_notebook(dpth, fn):
# run autotest on each notebook
pth = os.path.join(dpth, fn)
cmd = 'jupyter ' + 'nbconvert ' + \
'--ExecutePreprocessor.timeout=600 ' + \
'--to ' + 'notebook ' + \
'--execute ' + '{} '.format(pth) + \
'--output-dir ' + '{} '.format(testdir) + \
'--output ' + '{}'.format(fn)
ival = os.system(cmd)
assert ival == 0, 'could not run {}'.format(fn)
src = os.path.join(dpth, fn)
arg = (
"jupytext",
"--from ipynb",
"--execute",
src,
)
print(" ".join(arg))
ival = os.system(" ".join(arg))
assert ival == 0, "could not run {}".format(fn)


def test_notebooks():

for dpth in [faqdir, nbdir]:
for dpth in [faqdir, nbdir, gwdir]:
# get list of notebooks to run
files = get_Notebooks(dpth)

Expand All @@ -51,9 +42,9 @@ def test_notebooks():
yield run_notebook, dpth, fn


if __name__ == '__main__':
for dpth in [faqdir]: #, nbdir]:
if __name__ == "__main__":

for dpth in [gwdir]: # faqdir, nbdir, gwpaper]:
# get list of notebooks to run
files = get_Notebooks(dpth)

Expand Down
6 changes: 4 additions & 2 deletions docs/make_release.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ Instructions for making a FloPy release

## Update the example notebooks

1. Rerun all of the notebooks in the `examples\Notebooks` directory.
2. Rerun all of the notebooks in the `examples\Notebooks\groundwater_paper` directory.
Use `run_notebooks.py` in the `release` directory to rerun all of the notebooks in:

1. `examples\Notebooks` directory.
2. `examples\Notebooks\groundwater_paper` directory.


## Commit the release branch
Expand Down
Loading