A curated list of open technology projects to sustain a stable climate, energy supply, biodiversity and natural resources.

flopy

A Python package to create, run, and post-process MODFLOW-based models.
https://github.com/modflowpy/flopy

Category: Natural Resources
Sub Category: Water Supply and Quality

Keywords

modeling plotting python

Keywords from Contributors

groundwater modflow hydrology earth-science geoscience reports observations water groundwater-modelling transforms

Last synced: about 21 hours ago
JSON representation

Repository metadata

A Python package to create, run, and post-process MODFLOW-based models.

README.md

Version 3.7.0.dev0 (preliminary)

flopy continuous integration
Read the Docs

codecov
Codacy Badge
Documentation Status

Anaconda Version
Anaconda Updated
Anaconda Platforms

PyPI Version
PyPI Status
PyPI Versions

Introduction

FloPy includes support for MODFLOW 6, MODFLOW-2005, MODFLOW-NWT, MODFLOW-USG, and MODFLOW-2000. Other supported MODFLOW-based models include MODPATH (version 6 and 7), MT3DMS, MT3D-USGS, and SEAWAT.

For general modeling issues, please consult a modeling forum, such as the MODFLOW Users Group. Other MODFLOW resources are listed in the MODFLOW Resources section.

Documentation

Installation

FloPy requires Python 3.8+ with:

numpy >=1.15.0,<2.0.0
matplotlib >=1.4.0
pandas >=2.0.0

Dependencies for optional features are summarized here.

To install type:

conda install -c conda-forge flopy

or

pip install flopy

The release candidate version can also be installed from the git repository using the instructions provided below.

After FloPy is installed, MODFLOW and related programs can be installed using the command:

get-modflow :

See the docs for more information.

Getting Started

MODFLOW 6 Quick Start

import flopy
ws = './mymodel'
name = 'mymodel'
sim = flopy.mf6.MFSimulation(sim_name=name, sim_ws=ws, exe_name='mf6')
tdis = flopy.mf6.ModflowTdis(sim)
ims = flopy.mf6.ModflowIms(sim)
gwf = flopy.mf6.ModflowGwf(sim, modelname=name, save_flows=True)
dis = flopy.mf6.ModflowGwfdis(gwf, nrow=10, ncol=10)
ic = flopy.mf6.ModflowGwfic(gwf)
npf = flopy.mf6.ModflowGwfnpf(gwf, save_specific_discharge=True)
chd = flopy.mf6.ModflowGwfchd(gwf, stress_period_data=[[(0, 0, 0), 1.],
                                                       [(0, 9, 9), 0.]])
budget_file = name + '.bud'
head_file = name + '.hds'
oc = flopy.mf6.ModflowGwfoc(gwf,
                            budget_filerecord=budget_file,
                            head_filerecord=head_file,
                            saverecord=[('HEAD', 'ALL'), ('BUDGET', 'ALL')])
sim.write_simulation()
sim.run_simulation()

head = gwf.output.head().get_data()
bud = gwf.output.budget()

spdis = bud.get_data(text='DATA-SPDIS')[0]
qx, qy, qz = flopy.utils.postprocessing.get_specific_discharge(spdis, gwf)
pmv = flopy.plot.PlotMapView(gwf)
pmv.plot_array(head)
pmv.plot_grid(colors='white')
pmv.contour_array(head, levels=[.2, .4, .6, .8], linewidths=3.)
pmv.plot_vector(qx, qy, normalize=True, color="white")

Additional FloPy Resources

  • FloPy tutorials and scripts demonstrating the use of FloPy to run and post-process MODFLOW-based models.

  • FloPy example notebooks demonstrating the use of FloPy pre- and post-processing capabilities with a variety of MODFLOW-based models.

  • MODFLOW 6 example problems demonstrating FloPy use to create, run, and post-process MODFLOW 6 models.

  • A list of supported packages in FloPy is available in docs/supported_packages.md on the github repo.

  • A table of the supported and proposed model checks implemented in FloPy is available in docs/model_checks.md on the github repo.

  • A summary of changes in each FloPy version is available in docs/version_changes.md on the github repo.

Questions

FloPy usage has been growing rapidly, and as the number of users has increased, so has the number of questions about how to use FloPy. We ask our users to carefully consider the nature of their problem and seek help in the appropriate manner.

Do not open issues for general support questions. We want to keep GitHub issues for bug reports and feature requests. General support questions are better answered in the Discussions on the FloPy GitHub repository. Stack Overflow and the MODFLOW google group are other options but currently neither of these are as active as Discussions on the FloPy GitHub repository. If using Stack Overflow, questions should be tagged with tag flopy.

To save your and our time, we will systematically close all issues that are requests for general support and redirect people to Stack Overflow or the MODFLOW google group.

Contributing

Bug reports, code contributions, or improvements to the documentation are welcome from the community. See the developer docs to begin. Please also read up on our guidelines for contributing and check out our issues in the hotlist: community-help.

Installing the latest FloPy release candidate

To install the latest release candidate type:

pip install https://github.com/modflowpy/flopy/zipball/develop

How to Cite

Citations for FloPy:

Hughes, J.D., Langevin, C.D., Paulinski, S.R., Larsen, J.D. and Brakenhoff, D. (2023), FloPy Workflows for Creating Structured and Unstructured MODFLOW Models. Groundwater. https://doi.org/10.1111/gwat.13327

Bakker, Mark, Post, Vincent, Langevin, C. D., Hughes, J. D., White, J. T., Starn, J. J. and Fienen, M. N., 2016, Scripting MODFLOW Model Development Using Python and FloPy: Groundwater, v. 54, p. 733–739, doi:10.1111/gwat.12413.

Software/Code citation for FloPy:

Bakker, Mark, Post, Vincent, Hughes, J. D., Langevin, C. D., White, J. T., Leaf, A. T., Paulinski, S. R., Bellino, J. C., Morway, E. D., Toews, M. W., Larsen, J. D., Fienen, M. N., Starn, J. J., Brakenhoff, D. A., and Bonelli, W. P., 2024, FloPy v3.7.0.dev0 (preliminary): U.S. Geological Survey Software Release, 08 February 2024, https://doi.org/10.5066/F7BK19FH

Additional FloPy Related Publications

Leaf A.T, and Fienen M. N., 2022, Flopy—The Python Interface for MODFLOW: Groundwater, v. 60, no. 6, p. 710-712. doi:10.1111/gwat.13259.

Leaf, A.T. and M.N. Fienen, 2022, Modflow-setup—Robust automation of groundwater model construction: Frontiers in Earth Science, v. 10, 903965, doi:10.3389/feart.2022.903965.

Leaf, A.T., Fienen, M.N. and Reeves, H.W., 2021, SFRmaker and Linesink-Maker—Rapid Construction of Streamflow Routing Networks from Hydrography Data: Groundwater, v. 59, no. 5, p. 761-771. doi:10.1111/gwat.13095.

MODFLOW Resources

Disclaimer

This software is preliminary or provisional and is subject to revision. It is
being provided to meet the need for timely best science. This software is
provided "as is" and "as-available", and makes no representations or warranties
of any kind concerning the software, whether express, implied, statutory, or
other. This includes, without limitation, warranties of title,
merchantability, fitness for a particular purpose, non-infringement, absence
of latent or other defects, accuracy, or the presence or absence of errors,
whether or not known or discoverable.

Citation (CITATION.cff)

cff-version: 1.2.0
message: If you use this software, please cite both the article from preferred-citation,
  references, and the software itself.
type: software
title: FloPy
version: 3.7.0.dev0
date-released: '2024-02-08'
doi: 10.5066/F7BK19FH
abstract: A Python package to create, run, and post-process MODFLOW-based models.
repository-artifact: https://pypi.org/project/flopy
repository-code: https://github.com/modflowpy/flopy
license: CC0-1.0
authors:
- family-names: Bakker
  given-names: Mark
  orcid: https://orcid.org/0000-0002-5629-2861
- family-names: Post
  given-names: Vincent
  orcid: https://orcid.org/0000-0002-9463-3081
- family-names: Hughes
  given-names: Joseph D.
  orcid: https://orcid.org/0000-0003-1311-2354
- family-names: Langevin
  given-names: Christian D.
  orcid: https://orcid.org/0000-0001-5610-9759
- family-names: White
  given-names: Jeremy T.
  orcid: https://orcid.org/0000-0002-4950-1469
- family-names: Leaf
  given-names: Andrew T.
  orcid: https://orcid.org/0000-0001-8784-4924
- family-names: Paulinski
  given-names: Scott R.
  orcid: https://orcid.org/0000-0001-6548-8164
- family-names: Bellino
  given-names: Jason C.
  orcid: https://orcid.org/0000-0001-9046-9344
- family-names: Morway
  given-names: Eric D.
  orcid: https://orcid.org/0000-0002-8553-6140
- given-names: Michael W.
  family-names: Toews
  orcid: https://orcid.org/0000-0003-3657-7963
- family-names: Larsen
  given-names: Joshua D.
  orcid: https://orcid.org/0000-0002-1218-800X
- family-names: Fienen
  given-names: Michael N.
  orcid: https://orcid.org/0000-0002-7756-4651
- family-names: Starn
  given-names: Jon Jeffrey
  orcid: https://orcid.org/0000-0001-5909-0010
- family-names: Brakenhoff
  given-names: Davíd A.
  orcid: https://orcid.org/0000-0002-2993-2202
- family-names: Bonelli
  given-names: Wesley P.
  orcid: https://orcid.org/0000-0002-2665-5078
preferred-citation:
  type: article
  authors:
  - family-names: Hughes
    given-names: Joseph D.
    orcid: https://orcid.org/0000-0003-1311-2354
  - family-names: Langevin
    given-names: Christian D.
    orcid: https://orcid.org/0000-0001-5610-9759
  - family-names: Paulinski
    given-names: Scott R.
    orcid: https://orcid.org/0000-0001-6548-8164
  - family-names: Larsen
    given-names: Joshua D.
    orcid: https://orcid.org/0000-0002-1218-800X
  - family-names: Brakenhoff
    given-names: David
    orcid: https://orcid.org/0000-0002-2993-2202
  title: FloPy Workflows for Creating Structured and Unstructured MODFLOW Models
  doi: 10.1111/gwat.13327
  journal: Groundwater
  year: 2023
  month: 5
references:
- authors:
  - family-names: Bakker
    given-names: Mark
    orcid: https://orcid.org/0000-0002-5629-2861
  - family-names: Post
    given-names: Vincent
    orcid: https://orcid.org/0000-0002-9463-3081
  - family-names: Langevin
    given-names: Christian D.
    orcid: https://orcid.org/0000-0001-5610-9759
  - family-names: Hughes
    given-names: Joseph D.
    orcid: https://orcid.org/0000-0003-1311-2354
  - family-names: White
    given-names: Jeremy T.
    orcid: https://orcid.org/0000-0002-4950-1469
  - family-names: Starn
    given-names: Jon Jeffrey
    orcid: https://orcid.org/0000-0001-5909-0010
  - family-names: Fienen
    given-names: Michael N.
    orcid: https://orcid.org/0000-0002-7756-4651
  type: article
  title: Scripting MODFLOW Model Development Using Python and FloPy
  doi: 10.1111/gwat.12413
  journal: Groundwater
  volume: 54
  issue: 5
  start: 733
  end: 739
  year: 2016
  month: 9

Owner metadata


GitHub Events

Total
Last Year

Committers metadata

Last synced: 4 days ago

Total Commits: 3,547
Total Committers: 73
Avg Commits per committer: 48.589
Development Distribution Score (DDS): 0.758

Commits in past year: 198
Committers in past year: 20
Avg Commits per committer in past year: 9.9
Development Distribution Score (DDS) in past year: 0.535

Name Email Commits
Joseph D Hughes j****s@u****v 858
Christian D Langevin l****n@u****v 473
jwhite j****0@g****m 376
aleaf a****f@u****v 339
wpbonelli w****i@u****u 297
spaulins-usgs s****i@u****v 245
Jason Bellino j****o@u****v 166
Mike Taves m****s@g****m 166
Joshua Larsen j****n@u****v 146
emorway-usgs e****y@u****v 84
Mike Fienen m****n@u****v 43
Mark Bakker m****k@g****m 43
Chris Nicol 3****c 24
scottrp 4****p 23
Brioch Hemmings b****h@g****m 22
Jeff Starn j****n@u****v 20
dependabot[bot] 4****] 18
Davíd Brakenhoff d****f@a****l 18
github-actions[bot] 4****] 16
martclanor m****r@w****m 14
Ralf Junghanns r****s@g****m 13
unknown j****s@I****t 11
Jeremy White j****e@g****z 8
Etienne Bresciani 5****i 8
Kyle Wilcox k****e@a****m 8
Clark, Brian R b****k@u****v 8
Michael Ou o****n@g****m 7
Matt Knowling m****g@g****m 7
rodrperezi r****z@i****l 5
Michael N Fienen m****n@M****l 5
and 43 more...

Committer domains:


Issue and Pull Request metadata

Last synced: 2 days ago

Total issues: 872
Total pull requests: 1,419
Average time to close issues: 5 months
Average time to close pull requests: 8 days
Total issue authors: 272
Total pull request authors: 75
Average comments per issue: 2.81
Average comments per pull request: 1.7
Merged pull request: 1,281
Bot issues: 0
Bot pull requests: 57

Past year issues: 64
Past year pull requests: 235
Past year average time to close issues: 20 days
Past year average time to close pull requests: 6 days
Past year issue authors: 38
Past year pull request authors: 21
Past year average comments per issue: 2.67
Past year average comments per pull request: 0.98
Past year merged pull request: 210
Past year bot issues: 0
Past year bot pull requests: 31

More stats: https://issues.ecosyste.ms/repositories/lookup?url=https://github.com/modflowpy/flopy

Top Issue Authors

  • jdhughes-usgs (45)
  • flydream0428 (30)
  • aleaf (29)
  • wpbonelli (24)
  • jtwhite79 (23)
  • dbrakenhoff (22)
  • langevin-usgs (22)
  • wkitlasten (21)
  • giovannifi (18)
  • RyanConway91 (17)
  • hwreeves-USGS (13)
  • hjia1005 (12)
  • rabbl (11)
  • javgs-bd (11)
  • ghost (11)

Top Pull Request Authors

  • wpbonelli (195)
  • mwtoews (172)
  • jlarsen-usgs (158)
  • jdhughes-usgs (145)
  • w-bonelli (117)
  • spaulins-usgs (106)
  • langevin-usgs (79)
  • aleaf (60)
  • jbellino-usgs (36)
  • github-actions[bot] (33)
  • emorway-usgs (31)
  • dependabot[bot] (24)
  • cnicol-gwlogic (24)
  • scottrp (24)
  • mnfienen (22)

Top Issue Labels

  • bug (128)
  • enhancement (56)
  • help wanted (7)
  • maintenance (7)
  • in progress (6)
  • question (6)
  • interesting_ideas (4)
  • documentation (4)
  • modflow 6 (3)
  • wontfix (3)
  • performance (2)
  • deprecation (2)

Top Pull Request Labels

  • dependencies (30)
  • bug (19)
  • enhancement (13)
  • maintenance (13)
  • documentation (12)
  • performance (4)
  • modflow 6 (4)
  • deprecation (2)
  • github_actions (1)

Package metadata

pypi.org: flopy

FloPy is a Python package to create, run, and post-process MODFLOW-based models

  • Homepage:
  • Documentation: https://flopy.readthedocs.io
  • Licenses: CC0
  • Latest release: 3.9.2 (published 3 months ago)
  • Last Synced: 2025-04-25T14:08:02.144Z (2 days ago)
  • Versions: 53
  • Dependent Packages: 18
  • Dependent Repositories: 40
  • Downloads: 10,868 Last month
  • Docker Downloads: 5,769
  • Rankings:
    • Dependent packages count: 0.695%
    • Docker downloads count: 1.682%
    • Dependent repos count: 2.325%
    • Average: 2.427%
    • Stargazers count: 2.958%
    • Forks count: 3.02%
    • Downloads: 3.884%
  • Maintainers (2)
conda-forge.org: flopy

  • Homepage: https://github.com/modflowpy/flopy
  • Licenses: CC0-1.0
  • Latest release: 3.3.5 (published about 3 years ago)
  • Last Synced: 2025-04-25T14:08:05.500Z (2 days ago)
  • Versions: 16
  • Dependent Packages: 1
  • Dependent Repositories: 5
  • Rankings:
    • Forks count: 10.257%
    • Dependent repos count: 14.689%
    • Average: 18.354%
    • Stargazers count: 19.516%
    • Dependent packages count: 28.954%

Score: 20.41477868531141