flopy

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

https://github.com/modflowpy/flopy

Science Score: 49.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 20 DOI reference(s) in README
  • Academic publication links
  • Committers with academic emails
    14 of 74 committers (18.9%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (15.9%) to scientific vocabulary

Keywords

modeling plotting python

Keywords from Contributors

earth-science groundwater modflow uncertainty-analysis interface mesh interpretability hydrology interaction geoscience
Last synced: 6 months ago · JSON representation

Repository

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

Basic Info
Statistics
  • Stars: 570
  • Watchers: 34
  • Forks: 340
  • Open Issues: 58
  • Releases: 31
Topics
modeling plotting python
Created about 11 years ago · Last pushed 6 months ago
Metadata Files
Readme Contributing License Code of conduct Citation Support

README.md

flopy3

Version 3.10.0.dev3

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.10+ with:

numpy >=1.20.3 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

```python import flopy ws = './mymodel' name = 'mymodel' sim = flopy.mf6.MFSimulation(simname=name, simws=ws, exename='mf6') tdis = flopy.mf6.ModflowTdis(sim) ims = flopy.mf6.ModflowIms(sim) gwf = flopy.mf6.ModflowGwf(sim, modelname=name, saveflows=True) dis = flopy.mf6.ModflowGwfdis(gwf, nrow=10, ncol=10) ic = flopy.mf6.ModflowGwfic(gwf) npf = flopy.mf6.ModflowGwfnpf(gwf, savespecificdischarge=True) chd = flopy.mf6.ModflowGwfchd(gwf, stressperioddata=[[(0, 0, 0), 1.], [(0, 9, 9), 0.]]) budgetfile = name + '.bud' headfile = name + '.hds' oc = flopy.mf6.ModflowGwfoc(gwf, budgetfilerecord=budgetfile, headfilerecord=headfile, saverecord=[('HEAD', 'ALL'), ('BUDGET', 'ALL')]) sim.writesimulation() sim.runsimulation()

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

spdis = bud.getdata(text='DATA-SPDIS')[0] qx, qy, qz = flopy.utils.postprocessing.getspecificdischarge(spdis, gwf) pmv = flopy.plot.PlotMapView(gwf) pmv.plotarray(head) pmv.plotgrid(colors='white') pmv.contourarray(head, levels=[.2, .4, .6, .8], linewidths=3.) pmv.plot_vector(qx, qy, normalize=True, color="white") ``` plot

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. 733739, 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., 2025, FloPy v3.10.0.dev3: U.S. Geological Survey Software Release, 13 May 2025, 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

Owner

  • Name: modflowpy
  • Login: modflowpy
  • Kind: organization

GitHub Events

Total
  • Create event: 30
  • Release event: 4
  • Issues event: 68
  • Watch event: 50
  • Delete event: 21
  • Issue comment event: 282
  • Push event: 131
  • Pull request event: 261
  • Pull request review event: 194
  • Pull request review comment event: 157
  • Fork event: 39
Last Year
  • Create event: 30
  • Release event: 4
  • Issues event: 69
  • Watch event: 50
  • Delete event: 21
  • Issue comment event: 283
  • Push event: 131
  • Pull request event: 262
  • Pull request review event: 195
  • Pull request review comment event: 159
  • Fork event: 39

Committers

Last synced: 10 months ago

All Time
  • Total Commits: 3,562
  • Total Committers: 74
  • Avg Commits per committer: 48.135
  • Development Distribution Score (DDS): 0.759
Past Year
  • Commits: 198
  • Committers: 19
  • Avg Commits per committer: 10.421
  • Development Distribution Score (DDS): 0.561
Top Committers
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 301
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 147
emorway-usgs e****y@u****v 84
Mark Bakker m****k@g****m 43
Mike Fienen m****n@u****v 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****] 19
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
mjreno m****o@I****t 10
Jeremy White j****e@g****z 8
Clark, Brian R b****k@u****v 8
Kyle Wilcox k****e@a****m 8
Etienne Bresciani 5****i 8
Michael Ou o****n@g****m 7
Matt Knowling m****g@g****m 7
Michael N Fienen m****n@M****l 5
and 44 more...

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 870
  • Total pull requests: 1,710
  • Average time to close issues: 5 months
  • Average time to close pull requests: 8 days
  • Total issue authors: 274
  • Total pull request authors: 78
  • Average comments per issue: 2.69
  • Average comments per pull request: 1.54
  • Merged pull requests: 1,499
  • Bot issues: 1
  • Bot pull requests: 89
Past Year
  • Issues: 45
  • Pull requests: 314
  • Average time to close issues: 23 days
  • Average time to close pull requests: 6 days
  • Issue authors: 32
  • Pull request authors: 19
  • Average comments per issue: 1.33
  • Average comments per pull request: 0.99
  • Merged pull requests: 244
  • Bot issues: 1
  • Bot pull requests: 48
Top Authors
Issue Authors
  • jdhughes-usgs (45)
  • flydream0428 (30)
  • aleaf (29)
  • wpbonelli (24)
  • jtwhite79 (23)
  • langevin-usgs (22)
  • dbrakenhoff (22)
  • wkitlasten (20)
  • giovannifi (17)
  • RyanConway91 (16)
  • hwreeves-USGS (12)
  • hjia1005 (12)
  • ghost (11)
  • mwtoews (11)
  • javgs-bd (11)
Pull Request Authors
  • wpbonelli (334)
  • mwtoews (197)
  • jlarsen-usgs (186)
  • jdhughes-usgs (144)
  • w-bonelli (112)
  • spaulins-usgs (111)
  • langevin-usgs (87)
  • aleaf (61)
  • github-actions[bot] (45)
  • dependabot[bot] (44)
  • jbellino-usgs (36)
  • emorway-usgs (30)
  • cnicol-gwlogic (29)
  • scottrp (27)
  • martclanor (25)
Top Labels
Issue Labels
bug (125) enhancement (56) help wanted (6) maintenance (6) in progress (5) question (5) documentation (4) interesting_ideas (3) performance (2) modflow 6 (2) deprecation (2) wontfix (1)
Pull Request Labels
dependencies (53) bug (29) maintenance (29) documentation (20) enhancement (15) github_actions (13) modflow 6 (12) performance (5) deprecation (3)

Packages

  • Total packages: 2
  • Total downloads:
    • pypi 12,395 last-month
  • Total docker downloads: 5,769
  • Total dependent packages: 19
    (may contain duplicates)
  • Total dependent repositories: 45
    (may contain duplicates)
  • Total versions: 70
  • Total maintainers: 2
pypi.org: flopy

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

  • Versions: 54
  • Dependent Packages: 18
  • Dependent Repositories: 40
  • Downloads: 12,395 Last month
  • Docker Downloads: 5,769
Rankings
Dependent packages count: 0.7%
Docker downloads count: 1.7%
Dependent repos count: 2.3%
Average: 2.4%
Stargazers count: 3.0%
Forks count: 3.0%
Downloads: 3.9%
Maintainers (2)
Last synced: 6 months ago
conda-forge.org: flopy
  • Versions: 16
  • Dependent Packages: 1
  • Dependent Repositories: 5
Rankings
Forks count: 10.3%
Dependent repos count: 14.7%
Average: 18.4%
Stargazers count: 19.5%
Dependent packages count: 29.0%
Last synced: 6 months ago