Adding a new example requires adding a new example script in the scripts
folder and adding a new latex problem description in the doc/sections
folder. The following steps describe the process for running all the scripts, converting them to jupyter notebooks and latex tables, and then building the pdf document.
Install modeling programs into the bin
directory. This can be done using the get-modflow utility that is available when the flopy Python package is installed. From the bin
directory, issue the following commands:
get-modflow .
get-modflow --repo modflow6-nightly-build .
There are quite a few Python packages that are required in order to create MODFLOW 6 examples. They are listed in etc/requirements.pip.txt
and etc/requirements.usgs.txt
.
It's important that FloPy is up-to-date with the latest changes to MODFLOW 6. This can be achieved by running the following Python commands:
import flopy
flopy.mf6.utils.generate_classes(branch="develop", backup=False)
Pytest can be used to run all of the examples. From the scripts
directory, issue the following command:
pytest -v -n=auto ex-*.py
or use the following command, which runs in serial instead of running in parallel:
pytest -v ex-*.py
The example scripts are converted into jupyter notebooks, and latex tables are created from the scripts using jupytext. To convert all of the scripts, run the following command in the scrips directory:
python process-scripts.py
If the figures and tables were generated correctly, then it should be possible to build the pdf document for the examples. The pdf is created by converting the doc/mf6examples.tex
document into a pdf.