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.
- Host: GitHub
- URL: https://github.com/modflowpy/flopy
- Owner: modflowpy
- License: other
- Created: 2014-12-14T16:50:55.000Z (over 10 years ago)
- Default Branch: develop
- Last Pushed: 2025-04-15T12:10:58.000Z (12 days ago)
- Last Synced: 2025-04-18T22:51:43.287Z (9 days ago)
- Topics: modeling, plotting, python
- Language: Python
- Homepage: https://flopy.readthedocs.io
- Size: 633 MB
- Stars: 544
- Watchers: 34
- Forks: 325
- Open Issues: 58
- Releases: 30
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
- Citation: CITATION.cff
- Support: docs/supported_packages.md
README.md
Version 3.7.0.dev0 (preliminary)
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:
Software/Code citation for FloPy:
Additional FloPy Related Publications
MODFLOW Resources
- MODFLOW and Related Programs
- Online guide for MODFLOW-2000
- Online guide for MODFLOW-2005
- Online guide for MODFLOW-NWT
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
- Name: modflowpy
- Login: modflowpy
- Email:
- Kind: organization
- Description:
- Website:
- Location:
- Twitter:
- Company:
- Icon url: https://avatars.githubusercontent.com/u/10146746?v=4
- Repositories: 4
- Last ynced at: 2023-02-27T09:10:31.487Z
- Profile URL: https://github.com/modflowpy
GitHub Events
Total
- Create event: 17
- Release event: 2
- Issues event: 52
- Watch event: 32
- Delete event: 10
- Issue comment event: 201
- Push event: 92
- Pull request event: 180
- Pull request review event: 175
- Pull request review comment event: 147
- Fork event: 22
Last Year
- Create event: 17
- Release event: 2
- Issues event: 52
- Watch event: 32
- Delete event: 10
- Issue comment event: 201
- Push event: 92
- Pull request event: 180
- Pull request review event: 175
- Pull request review comment event: 147
- Fork event: 22
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 | 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:
- usgs.gov: 10
- artesia-water.nl: 2
- ucar.edu: 1
- witteveenbos.com: 1
- igsaaahmltw272v.gs.doi.net: 1
- gns.cri.nz: 1
- axiomalaska.com: 1
- ing.uchile.cl: 1
- igskiacwvmgs007.gs.doi.net: 1
- igsaaa071l01144.gs.doi.net: 1
- soe70924.isd.ad.flinders.edu.au: 1
- brabantwater.nl: 1
- deltares.nl: 1
- gwscience.co.uk: 1
- seequent.com: 1
- ucdavis.edu: 1
- mac7262.gns.cri.nz: 1
- gs.doi.net: 1
- rhdhv.com: 1
- edinsi.nl: 1
- bluegeo.ca: 1
- email.arizona.edu: 1
- nelen-schuurmans.nl: 1
- python-academy.de: 1
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
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
- Total packages: 2
-
Total downloads:
- pypi: 10,868 last-month
- Total docker downloads: 5,769
- Total dependent packages: 19 (may contain duplicates)
- Total dependent repositories: 45 (may contain duplicates)
- Total versions: 69
- Total maintainers: 2
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