Go to file
spaulins-usgs 4104cf5e6a
fix(performance): Implemented performance improvements including improvements suggested by @briochh (#1092) (#1097)
* fix(performance): Implemented performance improvements including improvements suggested by @briochh (#1092)

* fix(performance): Implemented additional performance improvements
2021-04-12 12:54:46 -07:00
.docs doc(tutorial): add modflow6 tutorial (#1027) 2020-12-07 13:55:13 -06:00
.github/workflows ci: add standard setup.py installation to check for rogue dependencies (#1085) 2021-03-22 12:10:37 -04:00
autotest fix(package write): Allow user to define and write empty stress period blocks to package files (#1091) (#1093) 2021-04-08 14:28:58 -07:00
binder ci(exes): update executables version to 3.0 (#761) 2019-12-14 06:25:32 -05:00
docs initial 3.3.4 release candidate on develop (#1064) 2021-02-19 17:03:15 -05:00
etc fix(imports): fix shapely and geojson imports (#1083) 2021-03-20 08:58:50 -04:00
examples Update(plotting and associated modules): major plotting library updates (#1078) 2021-03-19 15:00:17 -04:00
flopy fix(performance): Implemented performance improvements including improvements suggested by @briochh (#1092) (#1097) 2021-04-12 12:54:46 -07:00
release initial 3.3.4 release candidate on develop (#1064) 2021-02-19 17:03:15 -05:00
.flake8 fix(createpackages): avoid creating invalid escape characters (#1055) 2021-02-17 19:12:26 -05:00
.gitattributes Introduce end-of-line normalization (#913) 2020-06-11 11:12:28 -04:00
.gitignore ci(rtd): generate tutorial files and save as action asset (#979) 2020-08-29 00:37:51 -04:00
.pylintrc ci(linting): Initial GitHub actions for linting (#954) 2020-08-05 15:45:50 -04:00
.readthedocs.yml ci(travis): remove travis from CI chain (#1013) 2020-10-27 16:24:02 -04:00
CODE_OF_CONDUCT.md Updates for code.usgs.gov 2018-05-22 11:30:42 -04:00
CONTRIBUTING.md refactor(gridgen): fixes and additions related to vertical pass through cells (#953) 2020-08-10 07:45:38 -05:00
DISCLAIMER.md refactor(autotests): update build_exe.py to use pymake updates (#484) 2019-03-16 10:30:13 -04:00
LICENSE Initial commit 2014-12-14 11:50:55 -05:00
LICENSE.md Updates for code.usgs.gov 2018-05-22 11:30:42 -04:00
MANIFEST.in Update(plotting and associated modules): major plotting library updates (#1078) 2021-03-19 15:00:17 -04:00
README.md initial 3.3.4 release candidate on develop (#1064) 2021-02-19 17:03:15 -05:00
_config.yml Set theme jekyll-theme-minimal 2018-05-22 13:20:51 -04:00
code.json initial 3.3.4 release candidate on develop (#1064) 2021-02-19 17:03:15 -05:00
codecov.yml ci(linting): Initial GitHub actions for linting (#954) 2020-08-05 15:45:50 -04:00
requirements.txt ci(travis): remove travis from CI chain (#1013) 2020-10-27 16:24:02 -04:00
setup.py refactor(flopy): run black formatting with latest (20.8b1) (#975) 2020-08-27 10:17:23 -04:00

README.md

flopy3

Version 3.3.4 — release candidate

Build Status codecov Codacy Badge Documentation Status

Anaconda-Server Badge Anaconda-Server Badge PyPI Version

Binder

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.

Installation

FloPy requires Python 3.5 (or higher) and NumPy 1.9 (or higher). Dependencies for optional FloPy methods are summarized here.

To install FloPy 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.

Documentation

FloPy code documentation is available at https://flopy.readthedocs.io

Getting Started

MODFLOW 6 Quick Start

import os
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 = flopy.utils.HeadFile(os.path.join(ws, head_file)).get_data()
bud = flopy.utils.CellBudgetFile(os.path.join(ws, budget_file),
                                 precision='double')
spdis = bud.get_data(text='DATA-SPDIS')[0]
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_specific_discharge(spdis, color='white')
plot

Additional FloPy Resources

  • Tutorials demonstrating basic FloPy use.

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

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

  • Scripts demonstrating the use of FloPy for running and post-processing MODFLOW-based 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 as we want to keep GitHub issues for bug reports and feature requests. You've got much better chances of getting your question answered on Stack Overflow where the questions should be tagged with tag flopy or the MODFLOW google group.

Stack Overflow is a much better place to ask questions since:

  • there are thousands of people willing to help on Stack Overflow and the MODFLOW google group
  • questions and answers stay available for public viewing so your question / answer might help someone else
  • Stack Overflow's voting system assures that the best answers are prominently visible.

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. Prior to contributing, please read up on our guidelines for contributing and then check out one of 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

Citation for FloPy:

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, Langevin, C. D., Hughes, J. D., White, J. T., Leaf, A. T., Paulinski, S. R., Larsen, J. D., Toews, M. W., Morway, E. D., Bellino, J. C., Starn, J. J., and Fienen, M. N., 2021, FloPy v3.3.4 — release candidate: U.S. Geological Survey Software Release, 18 February 2021, http://dx.doi.org/10.5066/F7BK19FH

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. The software has not received final approval by the U.S. Geological Survey (USGS). No warranty, expressed or implied, is made by the USGS or the U.S. Government as to the functionality of the software and related material nor shall the fact of release constitute any such warranty. The software is provided on the condition that neither the USGS nor the U.S. Government shall be held liable for any damages resulting from the authorized or unauthorized use of the software.