Skip to main content

swatmf

PyPI Version PyPI - License https://zenodo.org/badge/304147230.svg

swatmf is a set of python modules for SWAT-MODFLOW model (Bailey et al., 2016) parameter estimation and uncertainty analysis with the open-source suite PEST (Doherty 2010a and 2010b, and Doherty and other, 2010).

Uncertainty Analysis for SWAT-MODFLOW model

Get data and jupyter notebooks

You essentially have 2 options:

Easy way

Hard way (Dev mode)

  • You will need to install Git if you don’t have it installed already. Downloads are available at [the link](https://git-scm.com/download). On windows, be sure to select the option that installs command-line tools

  • For Git, you will need to set up SSH keys to work with Github. To do so:
    • Go to GitHub.com and set up an account

    • On Windows, open Git Bash (on Mac/Linux, just open a terminal) and set up ssh keys if you haven’t already. To do this, simply type ssh-keygen in git bash/terminal and accept all defaults (important note - when prompted for an optional passphrase, just hit return.)

  • Follow the instructions to set up the SSH keys with your GitHub account.

  • Clone the materials from GitHub.
    • Open a git bash shell from the start menu (or, on a Mac/Linux, open a terminal)

    • Navigate to the folder you made to put the course materials

    • Clone the materials by executing the following in the git bash or terminal window:

git clone https://github.com/spark-brc/swatmf.git

Installation

To execute jupyter notebook, we need the Miniconda environment.

1. Miniconda Python:

  • If you don’t already have conda installed, please download Miniconda for your operating system from https://conda.io/en/latest/miniconda.html (choose the latest version for your operating system, 64-bit). You should not need elevated rights to install this.

  • Run the installer and select “only my user” when prompted. This will allow you to work with your python installation directly.

2. Set Environment and install libraries:

  • After installation, go to the START menu and select “Miniconda Prompt” to open a DOS box.

  • Type the following command:

conda install -c conda-forge mamba
  • Using the cd command in the Miniconda DOS box, navigate to the location where you have environment.yml the file and type:

mamba env create -f environment_swatmf.yml

and hit ENTER.

After your virtual environment setup is complete, change the environment to swatmf:

conda activate swatmf
  • Launch jupyter notebook

jupyter notebook

A browser window with a Jupyter notebook instance should open. Yay!

Brief overview of the API

from swatmf import swatmf_pst_utils

>>> prj_dir = "project directory"
>>> swatmfwd = "SWAT-MODFLOW model"
>>> swatwd = "SWAT model"
>>> swatmf_pst_utils.init_setup(prj_dir, swatmfwd, swatwd))

Creating 'backup' folder ... passed
Creating 'echo' folder ... passed
Creating 'sufi2.in' folder ... passed
'Absolute_SWAT_Values.txt' file copied ... passed
'pestpp-glm' file copied ... passed
'pestpp-ies.exe' file copied ... passed
'pestpp-ies.exe' file copied ... passed
'forward_run.py' file copied ... passed

Metadata

Release files for swatmf 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for swatmf 1.0.0
File Size Uploaded Provenance Actions
swatmf-1.0.0.tar.gz 10.4 MB Without provenance Details for swatmf-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for swatmf 1.0.0
File Interpreter ABI Platform Actions
swatmf-1.0.0-py3-none-any.whl Python 3 none any Details for swatmf-1.0.0-py3-none-any.whl

Total release size: 23.0 MB

Release files / swatmf-1.0.0.tar.gz

Download URL swatmf-1.0.0.tar.gz
Size 10.4 MB
Tags Source
SHA-256 checksum
How to use checksums
ab3a8e9cf4fd62c1e5c4b87cf03ede93c1850fdbead5f8b3bda354a502fbee7a
BLAKE2b-256 checksum
How to use checksums
7fb4dc4e234c4393762c54db9ac3837605c89298272f36e971d882b7d7cf496e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.10

Release files / swatmf-1.0.0-py3-none-any.whl

Download URL swatmf-1.0.0-py3-none-any.whl
Size 12.7 MB
Tags Python 3
SHA-256 checksum
How to use checksums
71d633c0b76c3321b00e9f2f0aff5270e17e693331225688c9295bdd47d3f10f
BLAKE2b-256 checksum
How to use checksums
ace7f854c991f7d718375edd0cd89f93af970585c1217b94d809741039082b12
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.10

Security for swatmf 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page