Skip to main content

Python tools for MODFLOW development

Project description

MODFLOW developer tools

GitHub tag PyPI Version PyPI Versions PyPI Status CI Documentation Status

Python tools for MODFLOW development and testing.

Requirements

This project requires Python3.8+. Its only core dependencies are numpy and pytest.

Installation

modflow-devtools is available on PyPI and can be installed with pip:

pip install modflow-devtools

This package pairs well with a few pytest plugins:

  • pytest-cases
  • pytest-dotenv
  • pytest-xdist

These and a few other optional dependencies can be installed with:

pip install "modflow-devtools[test]"

To install from source and set up a development environment please see the developer documentation.

Use cases

This package contains shared tools for developing and testing MODFLOW 6 and FloPy, including standalone utilities as well as pytest fixtures, CLI options, and test cases:

  • utilities for retrieving release information and downloading assets from the GitHub API
  • a ZipFile subclass that preserves file permissions (workaround for Python #15795)
  • a pytest CLI option for smoke testing (running a fast subset of cases)
  • a minimal pytest-cases framework for reusing test functions and data
  • a set of keepable pytest temporary directory fixtures for each scope
  • a set of fixtures to parametrize tests with models from external repos
    • MODFLOW-USGS/modflow6-examples
    • MODFLOW-USGS/modflow6-testmodels
    • MODFLOW-USGS/modflow6-largetestmodels
  • a set of pytest markers to conditionally skip test cases based on
    • operating system
    • Python packages installed
    • executables available on the path

Quickstart

To import pytest fixtures in a project consuming modflow-devtools, add the following to a conftest.py file:

pytest_plugins = [ "modflow_devtools.fixtures" ]

Note: pytest requires this to be a top-level conftest.py file. Nested conftest.py files may override or extend this package's fixtures.

Documentation

Usage documentation is available at modflow-devtools.readthedocs.io.

MODFLOW Resources

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

modflow-devtools-0.1.7.tar.gz (26.6 kB view hashes)

Uploaded Source

Built Distribution

modflow_devtools-0.1.7-py3-none-any.whl (30.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page