Skip to content

Commit 05b538c

Browse files
jdhughes-devjlarsen-usgsjtwhite79mwtoewscnicol-gwlogic
authored
release: version 3.3.5 (#1367)
* doc: initialize development branch * doc: update mf6 output tutorial (#1175) * binder: update binder yml (#1178) * fix(grid, plotting): bugfixes for all grid instances and plotting code (#1174) * grid fix iverts and verts; expose laycbd for use in utilities * plotting add RuntimeError exception to matplotlib imports to fix Condor containerization issues with flopy * fix(loading mflist from file) (#1179) @aleaf @jtwhite79 has addressed this issue. See modified test (`t004_test_utilarray.py`) for an example of using external files for list data. Reopen if this does not solve your issue. Closes #1073 * refactor: clean-up python 2 'next' and redundant '__future__' imports (#1181) * fix(raster): rework raster threads to work on osx (#1180) * update(MF6Output): access list file object via <model>.output.list() (#1173) * update(MF6Output): updates to access the list file using <model>.output.list() * revert unintended changes due to version conflict in mfmodel.py * fix(pakbase): specify dtype=bool for 0-d active array used for USG (#1188) * fix(modflow/mfriv) unstructured mfusg RIV package load check fix (#1184) flopy fails on checking mfusg unstructured RIV packages * add unstructured clause / disu reference to modflow/mfriv * modify autotest/t016.py test_usg_rch_evt_models01 to include a riv file and check() call * feat(lak6): support none lake bedleak values (#1189) Also modified gridintersect.plot_linestring to accept a matplotlib colormap string. * fix(plot/plot_bc) plot_bc fails with unstructured models (#1185) * fix(plot/plot_bc) plot_bc fails with unstructured models In plot/map.py, with unstructred models, numpy throws "too many indices for array" error when indexing plotarray with a tuple of boundary condition node numbers. * Revert plotarray BC indices to stress_period_data list[kper]["node"] as-is for unstructured models. * add plot_bc tests to t506_test.py for unstructured mf6 and mfusg models * update(python): set python 3.7 as minimum supported version (#1190) Also set minimum NumPy version to >= 1.15. Add python 3.9 to GitHub action workflows and remove python 3.6. Closes #1176 Closes #1177 * refactor(numpy): remove support for numpy<1.15 (#1191) * Fix(MF6Output): fix add new obs package issue (#1193) * update MF6Output gwt list() method to use MfListBudget * Added test to t504_test.py for adding new observations * refactor(plot): remove deprecated plot methods (#1192) Remove deprecated plot_discharge and plot_specific_discharge * fix(pakbase) unstructured storage check (#1187) (#1194) in pakbase/_check_storage.py, np.asarray() still throws an error when using a jagged list for unstructured models #1187 (comment) * change to np.concatenate jagged list to a flat array * skip storage check if no convertible layers Closes #1187 * refactor(thickness): remove deprecated dis and disu thickness property (#1195) deprecated mfdis and mfdisu thickness property * fix(Grid.saturated_thick): update saturated_thick to filter confining bed layers (#1197) * added Grid.remove_confining_beds() * added test_ncb_thick() to t076_modelgrid_thick.py * refactor(SR): remove deprecated SpatialReference class (#1200) * refactor(pakbase): generate heading from base class (#1196) * refactor: replace OrderedDict with dict (#1201) * refactor(reference): remove deprecated crs and epsgRef classes (#1202) Update t007 so that it does not fail if there is no internet connection on GitHub Actions VMs. * refactor(deprecated): remove additional deprecated classes and functions (#1204) * readme: update README.md badges and script to update badge branch (#1206) * updates(zonbud, output_util, mfwel, OptionBlock): updates and bug fixes (#1209) * autotest updates for deprecations and updates * updates(zonbud, output_util, mfwel, OptionBlock): updates * remove deprecated code from zonbud.py * remove deprecated code form mfwel.py * fix MF6Output.list(), update to use Mf6ListBudget * fix Package.load() for mfnwt_options, well options not passed to well file when option block detected * Remove references to deprecated code from notebooks * refactor(zonebud): reapply OrderedDict to dict changes from PR #1201 (#1210) * fix(numpy): handle deprecation warnings from numpy 1.21 (#1211) * docs(readme): update mf6 quickstart to use plot_vector() (#1215) * style: use f-strings to format str (#1212) * fix(rename and comments): package rename code and comment propagation (#1226) * fix(rename and comments): fixed package rename code (#1133). fixed problem with comments not propagating properly when data switched between internal and external (#1183). * fix(reformat) * fix(f strings) * fix(export test case fix): call write after export so that netcdf file closes properly before object is destroyed * fix(shapefile_utils) unstructured shapefile export (#1220) (#1222) * Fix errors encountered when exporting to shapefile from unstructured models. See #1220 * add unstructured clauses to export/shapefile_utils.py for static arrays (e.g. DISU, LPF, BAS6). More work needed for boundary conditions (MFList and transientlist data types - eg RIV/RCH/EVT packages) * add test to t506.py to export mfusg aunstructured model shapefiles * close #1220 * refactor: use print() instead of sys.stdout.write() (#1223) * refactor(exceptions): reduce redundancy, simplify message generation (#1218) Remove PlotException, replace with KeyError and ImportError * refactor(exceptions): reclassify IOError as OSError or other type (#1227) * [modflowpy/flopy] update(ModflowHob): Improve HOB file performance #1158 (#1224) (#1225) Co-authored-by: Hua Zhang <[email protected]> * docs: black formatting of mfhob * fix(numpy elementwise comparison): Fixed numpy FutureWarning. No elementwise compare is needed if user passes in a numpy recarray, this is only necessary for dictionaries. (#1235) * feat(mf6): allow multi-package for stress package concentrations (SPC) (#1242) * Support new mf6 transport utility for specifying concentrations for boundary conditions * fix(writing tas): fixed writing non-constant tas (#1244) (#1245) * Close #1244 * Update(Vtk): updates to Vtk class for MF6, HFB, and MODPATH (#1249) * update(flopy3_vtk_export.ipynb): updates for new VTK class and routines * update(vtk.py): rewrite of Vtk() class and functions for Vertex and Unstructured Grids, MODPATH * New dependency added (python vtk package: pip install vtk) * Added support for HFB package * Added support for MODPATH pathline and timeseries output * Updated the support for head exports and cell budget files * minor update to deprecated methods * updates to test_vtk_vector() and test_vtk_pathline() * fix(voronoi): VoronoiGrid class upgraded to better support irregular domains (#1253) * revised VoronoiGrid class * added more tests * changes are not backward compatible as VoronoiGrid now requires flopy Triangle object as input instead of points * Close #1095 * fix(MFPackage): fix mfsim.nam relative paths (#1252) * update MFPackage for t505_test.py * ci(voronoi): test script was not running (#1255) * feat(CellBudget): add support for full3D keyword (#1254) * refactor(Package): simplify __init__ in subclasses, remove "extra" (#1238) * Think mg extent is x0,x1,y0,y1? (#1243) * Think mg extent is x0,x1,y0,y1? * Update t007_test.py for ASCII grid extent bugfix Co-authored-by: Joshua Larsen <[email protected]> * refactor(netcdf): sync data, revise logger and exceptions (#1230) * Fix(_mg_resync): Added checks to reset the modelgrid resync (#1258) * update to allow model to resync modelgrid when discretization or bas package is modified * added test_mf6_modelgrid_update to t007_test.py * fix(MFFileMgmt.string_to_file_path): updated to support UNC paths (#1256) * added test_mf6_string_to_file_path to t501_test.py * Close #1237 * feat(get_ts): added support to get_ts for HeadUFile (#1260) * Refactor(mfusg), Feat(mfusgcln, mfusggnc) (#1261) * modflowusg * refactor(modflowusg) * Refactor(mfusg), Feat(mfusgcln, mfusggnc) * refactor(t420_test.py) for mfusg restructure * rename(modflowusg-->mfusg) rename all modules, classes etc for simplicity * rename(t420_test.py-->t080_test.py) Co-authored-by: swfwmd <[email protected]> * refactor(imports): add function to import optional packages (#1262) matplotlib is now a FloPy requirement. Closes #1257 * Fix(ModflowFhb): update datasets 4, 5, 6, 7, 8 loading routine for multiline records (#1264) * fix(keystring records): fixed problem with keystring records containing multiple keywords (#1266) * fixes(1247): Make flopy buildable with pyinstaller (#1248) Use __init_subclass__ to register packages, removing dependency on dfn files when installed. Rename longnames.json and unitsformat.json to .py so they are automatically included. * refactor(setup): prefer setup.cfg for package metadata, and other changes (#1267) * Assign one author and one maintainer, which is expected by PyPI * Expand a few classifiers, add keywords and project URLs * Use python_requires, auto-find packages, and set zip_safe=False * Add pyproject.toml with black configuration, with default "-l 79" * Remove pypandoc dependency, specify 'text/markdown' content type * Change default sdist format to zip * ci: add workflow to test flopy-based MODFLOW 6 tests (#1272) * @spaulins-usgs fix(model/IMS registration and model relative path) (#1273) * fix(model/IMS registration and model relative path): register_ims_package now unregisters models from other IMS packages before registering the model to the new IMS package, enforcing the rule that a model can not be registered to more than one IMS package. Model relative paths fixed in cases where model relative path set before package creation. * fix(tests): added test simulation with four models to increase test coverage of ims file registration and exchanges * ci: convert from nosetest to pytest (#1274) * ci: convert addition autotests to use flopyTest testing framework (#1276) * ci: convert addition autotests to use flopyTest testing framework (#1278) * Updates(MF6Output): Added budgetcsv method to .output attribute (#1275) * Update dfn files to most recent modflow6 dfns * Ran createpackages.py to apply updates for budgetcsv output type * Added budgetcsv method .output * Fix ModflowUzf1.load(), use built in multiline reader method instead of readline() (crashed on comment line after options block). * ModflowAg add accel option to option block * ci: refactor FlopyTestSetup testing class (#1283) * fix(io): read comma separated list (#1285) modified: flopy/utils/flopy_io.py Close #1285 * update(CellBudgetFile, MF6Output): update to pass modelgrid to CellBudgetFile and reshape arrays using full3D option (#1282) * fix(mfusg/str) (#1296) * cater for unstructured mfusg models in modflowstr * add mfusg str load/write test to t016_test * close #1295 * black * ci: switch from conda to standard python and pip (#1293) * update(Raster): added min and max resampling for hydrologic resampling and streamflow representation (#1294) * added trap for nodata within polygons * added test_raster_sampling_methods to t065_test_gridintersect.py * fix(path): fix subdirectory path issues (#1298) * Checking for model_relative_path already existing in external file filename, which will be the case when reading in a model. Will only append model_relative_path where not already present in file name. Should improve support for models using external file storage and simulations with models in sub directories. * Added test to t501 to catch subdir issue * Close #1289 * Possibly related to #1115 and #1126 * fix(geospatial_utils.py): added pyshp and shapely imports check to geospatial_utils.py (#1305) * reorganized code order to enforce import checks * fix(autotests): added pytest.ini to declare test naming convention (#1307) * fix(plot_pathline): sort projected pathline points by travel time instead of cell order #1302 * Linting * fix(autotests): added pytest.ini to declare test naming convention * fixed t069_test_vtkexportmodel.py * updated voronoi tests in t075_test_ugrid.py * fixed ulstrd open/close read method for scale factors * revert changes made to voronoi tests * revert all changes to t075_test_ugrid.py * fix(plot_pathline): sort projected pathline points by travel time instead of cell order (#1304) * feat(Gridintersect): add shapetype kwarg (#1301) * refactor(make-release): Software citation developed from version.py * release: update mf6 v6.1.1 dfn and flopy mf6 classes (#1) * docs(misc): clean up docstrings * refactor(GridIntersect): fix error message for unsupported methods * bug(GridIntersect): fix #10 ensure one entry per grid cell in polygon intersection result add test for this case * bug(gridintersect): fixes #917 bug in structured mode where linestrings were not handled correctly if they pass in and out of grid cell * fix(GridIntersect): #1035 - fix vertices when intersecting linestring with offset grids * feat(GridIntersect): add shapetype kwarg allow intersection shape to be passed as list of vertices (modify test to test this) specify keyword arguments explicitly in intersect calls formatting Co-authored-by: jdhughes-usgs <[email protected]> Co-authored-by: Christian Langevin <[email protected]> Closes #727 * fix(array): getting array data (#1028) (#1290) * fix(array): Getting array data (<data object>.array) fixed so that empty stress periods repeat data from the last previous stress period with data. If there is no previous stress period with data, None is used for MFDataList arrays and an array of zeros is used for MFDataArray arrays. * fix(array): added test cases for getting array data (<Data Object>.array) * fix(array and getdata): array and getdata now return appropriate values for "nodata" and "repeating last stress period data" cases * fix(array and getdata): added tests for array and getdata for different types of empty stress periods * fix(array output): minor fix for how arrays output data * fix(test): fixed convergence issues with new test case * linting with updated version of black (#1315) * fix(UnstructuredGrid): load vertices for unstructured grids (#1312) * Loading an mf6 DISU model with variable voronoi grid results in extraneous iverts entries of None (Iverts appears to be a consistent (not jagged) shape). This results in a vertexdict indexing error in UnstructuredGrid._build_grid_geometry_info when using plot() methods. * Filter out None entries from iverts in UnstructuredGrid._build_grid_geometry_info * update(VertexGrid): added filter for None types on cell2d * fix(paths): Path code made more robust so that non-standard model folder structures are supported (#1311) (#1316) * fix(paths): Path code made more robust so that non-standard model folder structures are supported. There are three basic path times, the path to the simulation, model relative paths to particular models in the simulation, and package/data relative paths to package or data files in a model or simulation. Model relative paths are relative to the simulation path. Package/data relative paths are relative to the simulation path for packages/data not attached to a model and relative to model relative path for packages/data attached to a model. (#1311) * test(paths): added more comprehensive testing of paths Co-authored-by: Scott Paulinski <[email protected]> * fix(filenames): fixed how spaces in filenames are handled (#1236) (#1318) * fix(filenames): fixed how spaces in filenames are handled. filenames with spaces in them now are read correctly from the package files and are written to the package file in quotes (#1236) * fix(filenames): test cases now include filenames with spaces in them * ci: update t058 to fix issue on macos with python 3.9 (#1320) update remaining tests to use new testing functionality to avoid possible race conditions with parallel pytest * update(Gridgen): added keyword arguments for smoothing_level_vertical and smoothing_level_horizontal (#1322) Close #1317 * fix(voronoi): clean up voronoi examples and add error check (#1323) * Close #1299 * Voronoi issues in example were caused by closed polygons being passed to triangle * Revised examples to meet requirements * Add check for duplicate vertices in triangular mesh * Updated t075 to check for invalid cells * Changed several filtering loops in grid methods to use standard list comprehension * feat(multiple package instances): FloPy support for multiple instances of the same package stored in dfn files (#1239) (#1321) * ci: add separate windows workflow that uses miniconda (#1324) * feat(inspect cells): new feature that returns model data associated with specified model cells (#1140) (#1325) * feat(inspect cells): new feature that returns model data associated with specified model cells (#1140) * feat(inspect cells): added tests for new feature (#1140) * feat(inspect cells) * feat(inspect cells): dependent variable and budget inspection * feat(inspect cells): tests * feat(inspect cells): doc update * feat(inspect_cells) * feat(inspect_cells) * ci(diagnose): create failedTests artifact (#1327) * update(Grid.intersect): added optional z-coordinate to intersect() method (#1326) * update(Grid.intersect): added optional z-coordinate to intersect() method * implemented intersect method for UnstructuredGrid * update(Grid): Added interface change warnings to intersect method * style(import): consistently use relative imports (#1330) * Convert line endings to UNIX; remove BOM * Use relative imports * fix(Raster): resample_to_grid failure no data masking failure with int dtype (#1328) * update(test_raster_sampling_methods): update for mean resampling * refactor(distutils): Version classes are deprecated, use internal class (#1331) * fix(postprocessing): get_structured_faceflows fix to support 3d models (#1333) * function was fixed to support multi-layer models * test added to ensure face flow calculations work * fix(cellid): Fixes some issues with flopy properly identifying cell ids (#1335) (#1336) * fix(ModflowUtllaktab): utl-lak-tab.dfn is redundant to utl-laktab.dfn (#1339) * style(imports): use isort tool, remove unused imports (#1341) * ci: Add isort to linting step (#1343) Update flopy using latest version of black. Add autotest\pull_request_prepare.py to help contributors to run isort and black prior to a pull request. Clean-up unused examples/Testing directory. Modified t064_test_performance.py to guard against failures on macOS. * ci: restrict use of pyshp=2.2.0 until ci failure issue resolved (#1345) * update(MFBlockHeader): fix for extremely slow loading of package OBS files when many blocks exist in OBS file. (#1351) update header_exists: when None is provided for key, do not check against block header names (significantly speeds OBS loading). * update(read_binary_data_from_file): update for binary layer files with multiple layers (#1352) Previously code read the entire file without stripping headers after first layer. Enforce read_multi_layer=True if data_size != ncpl * update to support both "layered" binary files and flat binary files * update(read_binary_data_from_file): check for ncpl as numpy array * added test_binary_read to t505_test.py * update(geometry.py): added __reversed__ to geometry objects (#1347) * update(t074_test_geospatial_util.py): update tests for pyshp 2.2.0 * fix typo in AG package * update Raster for slightly faster grid resampling * update(geometry.py): added __reversed__ to geometery object as patch for pyshp 2.2.0 vs 2.1.0 differences * updated t074_test_geospatial_util.py * linted repository * isort mfag.py * update black and perform linting * update(requirements): merge upstream pyshp requirements with fork * update(requirements): update pyshp requirements to pyshp >= 2.0.0 * update(requirements.txt): resolve conflict * update(contouring routines): updates for contour_array and export_contourf routines (#1353) * added filled kwarg to contour_array for filled contours * update PlotCrossSection.contour_array() to mask out edge triangles outside of cross-section boundaries * update export_contourf, provide support for multipolygon contours and update support for holes * update export_contourf, remove shapely dependency. Replaced with flopy geometry objects * update t007_test.py, test_export_contourf() * fix(tab files): fixed searching for tab file packages (#1337) (#1344) Added lake tab file back in to t504 tests (#1337). Modified lak test to test tab files in different folders. Changed lakeex1b.lak test file path to contain mac-style forward slash path Co-authored-by: Scott Paulinski <[email protected]> closes #1337 * refactor(flake8): F821 for 'undefined name' errors (#1350) * feat(gwtgwt-mvt): add support for gwt-gwt with mover transport (#1356) * feat(mvt): add simulation-level support for mover transport (#1357) * feat(mvt): add simulation-level support for mover transport * run black * fix(exchange obs): fixed building of obs package for exchange packages (through MFSimulation) (#1363) * fix(exchange obs): fixed building of obs package through MFSimulation class * fix(exchange obs): updated comments * fix(exchange obs): test coverage for exchange obs * release: version 3.3.5 Co-authored-by: Joshua Larsen <[email protected]> Co-authored-by: J Dub <[email protected]> Co-authored-by: Mike Taves <[email protected]> Co-authored-by: Chris Nicol <[email protected]> Co-authored-by: langevin-usgs <[email protected]> Co-authored-by: spaulins-usgs <[email protected]> Co-authored-by: swfwmd <[email protected]> Co-authored-by: Hua Zhang <[email protected]> Co-authored-by: Brioch Hemmings <[email protected]> Co-authored-by: Ross Kushnereit <[email protected]> Co-authored-by: swfwmd <[email protected]> Co-authored-by: Tim Mitchell <[email protected]> Co-authored-by: Michael Ou <[email protected]> Co-authored-by: Davíd Brakenhoff <[email protected]> Co-authored-by: scottrp <[email protected]>
1 parent 1f21a86 commit 05b538c

File tree

541 files changed

+55721
-37385
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

541 files changed

+55721
-37385
lines changed

.docs/conf.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515

1616
# add flopy root directory to the python path
1717
sys.path.insert(0, os.path.abspath(".."))
18-
from flopy import __version__, __author__
18+
from flopy import __author__, __version__
1919

2020
# -- determine if running on readthedocs ------------------------------------
21-
on_rtd = os.environ.get('READTHEDOCS') == 'True'
21+
on_rtd = os.environ.get("READTHEDOCS") == "True"
2222

2323
# -- determine if this version is a release candidate
2424
with open("../README.md", "r") as f:
@@ -37,9 +37,9 @@
3737
with open(rst_name, "w") as f:
3838
for line in lines:
3939
if line.startswith("**Documentation for version"):
40-
line = "**Documentation for version {}".format(__version__)
40+
line = f"**Documentation for version {__version__}"
4141
if rc_text != "":
42-
line += " --- {}".format(rc_text)
42+
line += f" --- {rc_text}"
4343
line += "**\n"
4444
f.write(line)
4545

@@ -64,7 +64,7 @@
6464
)
6565
authors = __author__.split(sep=",")
6666
for author in authors:
67-
line += " * {}\n".format(author.strip())
67+
line += f" * {author.strip()}\n"
6868
line += " * and others\n\n"
6969
f.write(line)
7070
elif line.startswith(tag_end):
@@ -91,7 +91,7 @@
9191

9292
# -- Project information -----------------------------------------------------
9393
project = "flopy Documentation"
94-
copyright = "2021, {}".format(__author__)
94+
copyright = f"2021, {__author__}"
9595
author = __author__
9696

9797
# The version.

.docs/create_rstfiles.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
def create_section(f, title, filenames, upper_case=False):
55
if upper_case:
66
title = title.upper()
7-
title = "{} Tutorials".format(title)
8-
line = "{}\n".format(title) + len(title) * "-" + "\n\n"
7+
title = f"{title} Tutorials"
8+
line = f"{title}\n" + len(title) * "-" + "\n\n"
99
line += "Contents:\n\n.. toctree::\n :maxdepth: 2\n\n"
1010
for filename in filenames:
11-
line += " _notebooks/{}\n".format(filename)
11+
line += f" _notebooks/{filename}\n"
1212
line += "\n\n"
1313
f.write(line)
1414

@@ -19,8 +19,11 @@ def create_tutorial_rst():
1919
tutorial_dict = {}
2020
for dirpath, _, filenames in os.walk(pth):
2121
key = os.path.basename(os.path.normpath(dirpath))
22-
files = [filename.replace(".py", "") for filename in sorted(filenames)
23-
if filename.endswith(".py")]
22+
files = [
23+
filename.replace(".py", "")
24+
for filename in sorted(filenames)
25+
if filename.endswith(".py")
26+
]
2427
if len(files) > 0:
2528
tutorial_dict[key] = files
2629

.docs/create_tutorials.py

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,18 @@ def create_notebooks():
1414
# get a list of python files
1515
py_files = []
1616
for dirpath, _, filenames in os.walk(pth):
17-
py_files += [os.path.join(dirpath, filename) for filename in
18-
sorted(filenames) if filename.endswith(".py")]
17+
py_files += [
18+
os.path.join(dirpath, filename)
19+
for filename in sorted(filenames)
20+
if filename.endswith(".py")
21+
]
1922
# sort the python files
2023
py_files = sorted(py_files)
2124

2225
# copy the python files
2326
for src in py_files:
2427
dst = os.path.join(wpth, os.path.basename(src))
25-
print("{} -> {}".format(src, dst))
28+
print(f"{src} -> {dst}")
2629
shutil.copyfile(src, dst)
2730

2831
# create and run notebooks
@@ -43,10 +46,12 @@ def create_notebooks():
4346
os.makedirs(npth)
4447

4548
for filepath in py_files:
46-
src = os.path.join(wpth,
47-
os.path.basename(filepath).replace(".py", ".ipynb"))
48-
dst = os.path.join(npth,
49-
os.path.basename(filepath).replace(".py", ".ipynb"))
49+
src = os.path.join(
50+
wpth, os.path.basename(filepath).replace(".py", ".ipynb")
51+
)
52+
dst = os.path.join(
53+
npth, os.path.basename(filepath).replace(".py", ".ipynb")
54+
)
5055
shutil.copyfile(src, dst)
5156
shutil.rmtree(".working")
5257

.docs/main.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
FloPy Documentation
77
===================
88

9-
**Documentation for version 3.3.4 --- release candidate**
9+
**Documentation for version 3.3.5 --- release candidate**
1010

1111
Return to the Github `FloPy <https://github.com/modflowpy/flopy>`_ website where the code resides.
1212

.docs/pysrc/tutorial1.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import os
22
import sys
3+
34
import numpy as np
5+
46
import flopy
57

68
# Assign name and create modflow model object
@@ -52,10 +54,11 @@
5254
mf.run_model()
5355

5456
import matplotlib.pyplot as plt
57+
5558
import flopy.utils.binaryfile as bf
5659

5760
plt.subplot(1, 1, 1, aspect="equal")
58-
hds = bf.HeadFile(modelname + ".hds")
61+
hds = bf.HeadFile(f"{modelname}.hds")
5962
head = hds.get_data(totim=1.0)
6063
levels = np.arange(1, 10, 1)
6164
extent = (delr / 2.0, Lx - delc / 2.0, Ly - delc / 2.0, delc / 2.0)
@@ -66,12 +69,12 @@
6669
fig = plt.figure(figsize=(10, 10))
6770
ax = fig.add_subplot(1, 1, 1, aspect="equal")
6871

69-
hds = bf.HeadFile(modelname + ".hds")
72+
hds = bf.HeadFile(f"{modelname}.hds")
7073
times = hds.get_times()
7174
head = hds.get_data(totim=times[-1])
7275
levels = np.linspace(0, 10, 11)
7376

74-
cbb = bf.CellBudgetFile(modelname + ".cbc")
77+
cbb = bf.CellBudgetFile(f"{modelname}.cbc")
7578
kstpkper_list = cbb.get_kstpkper()
7679
frf = cbb.get_data(text="FLOW RIGHT FACE", totim=times[-1])[0]
7780
fff = cbb.get_data(text="FLOW FRONT FACE", totim=times[-1])[0]

.docs/pysrc/tutorial2.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import os
2+
23
import numpy as np
4+
35
import flopy
46

57
# Model domain and grid definition
@@ -121,12 +123,13 @@
121123

122124
# Imports
123125
import matplotlib.pyplot as plt
126+
124127
import flopy.utils.binaryfile as bf
125128

126129
# Create the headfile and budget file objects
127-
headobj = bf.HeadFile(modelname + ".hds")
130+
headobj = bf.HeadFile(f"{modelname}.hds")
128131
times = headobj.get_times()
129-
cbb = bf.CellBudgetFile(modelname + ".cbc")
132+
cbb = bf.CellBudgetFile(f"{modelname}.cbc")
130133

131134
# Setup contour parameters
132135
levels = np.linspace(0, 10, 11)
@@ -156,7 +159,7 @@
156159
# Create the plot
157160
f = plt.figure()
158161
plt.subplot(1, 1, 1, aspect="equal")
159-
plt.title("stress period " + str(iplot + 1))
162+
plt.title(f"stress period {iplot + 1}")
160163

161164
modelmap = flopy.plot.PlotMapView(model=mf, layer=0)
162165
qm = modelmap.plot_ibound()
@@ -181,13 +184,13 @@
181184
zorder=9,
182185
)
183186
plt.text(wpt[0] + 25, wpt[1] - 25, "well", size=12, zorder=12)
184-
plt.savefig("tutorial2-{}.png".format(iplot))
187+
plt.savefig(f"tutorial2-{iplot}.png")
185188

186189
# Plot the head versus time
187190
idx = (0, int(nrow / 2) - 1, int(ncol / 2) - 1)
188191
ts = headobj.get_ts(idx)
189192
plt.subplot(1, 1, 1)
190-
ttl = "Head at cell ({0},{1},{2})".format(idx[0] + 1, idx[1] + 1, idx[2] + 1)
193+
ttl = f"Head at cell ({idx[0] + 1},{idx[1] + 1},{idx[2] + 1})"
191194
plt.title(ttl)
192195
plt.xlabel("time")
193196
plt.ylabel("head")

.docs/tutorials.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,18 @@ Contents:
5353
_notebooks/tutorial02_mf
5454

5555

56+
.IPYNB_CHECKPOINTS Tutorials
57+
----------------------------
58+
59+
Contents:
60+
61+
.. toctree::
62+
:maxdepth: 2
63+
64+
_notebooks/tutorial01_mf-checkpoint
65+
_notebooks/tutorial02_mf-checkpoint
66+
67+
5668
SEAWAT Tutorials
5769
----------------
5870

.flake8

Lines changed: 0 additions & 36 deletions
This file was deleted.

.github/workflows/ci-mf6.yml

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
name: flopy mf6 CI
2+
3+
on:
4+
schedule:
5+
- cron: '0 8 * * *' # run at 8 AM UTC (12 am PST)
6+
push:
7+
branches:
8+
- master
9+
- develop
10+
- 'release*'
11+
pull_request:
12+
branches: [master, develop]
13+
14+
jobs:
15+
16+
flopymf6CI:
17+
name: mf6 flopy autotests
18+
runs-on: ubuntu-latest
19+
strategy:
20+
fail-fast: false
21+
defaults:
22+
run:
23+
shell: bash
24+
25+
steps:
26+
# check out repo
27+
- name: Checkout flopy repo
28+
uses: actions/[email protected]
29+
30+
- name: Get branch name
31+
uses: nelonoel/[email protected]
32+
33+
- name: Setup Python 3.9
34+
uses: actions/[email protected]
35+
with:
36+
python-version: 3.9
37+
38+
- name: Install Python 3.9 packages
39+
run: |
40+
python -m pip install --upgrade pip
41+
pip install -r etc/requirements.pip.txt
42+
43+
- name: Install pymake, xmipy, modflowapi, and flopy
44+
run: |
45+
python -m pip install --upgrade pip
46+
pip install https://github.com/modflowpy/flopy/zipball/develop
47+
pip install https://github.com/modflowpy/pymake/zipball/master
48+
pip install https://github.com/Deltares/xmipy/zipball/develop
49+
pip install https://github.com/MODFLOW-USGS/modflowapi/zipball/develop
50+
pip install . --use-feature=in-tree-build
51+
52+
- name: Setup symbolic links on Linux
53+
run: |
54+
sudo ln -fs /usr/bin/gfortran-10 /usr/local/bin/gfortran
55+
sudo ln -fs /usr/bin/gcc-10 /usr/local/bin/gcc
56+
sudo ln -fs /usr/bin/g++-10 /usr/local/bin/g++
57+
58+
- name: Print GNU compiler versions
59+
run: |
60+
gfortran --version
61+
gcc --version
62+
g++ --version
63+
64+
- name: Clone MODFLOW 6 repo
65+
run: |
66+
git clone https://github.com/MODFLOW-USGS/modflow6.git modflow6
67+
68+
- name: Update flopy MODFLOW 6 classes
69+
working-directory: ./modflow6/autotest
70+
run: |
71+
python update_flopy.py
72+
73+
- name: Install meson
74+
run: |
75+
pip install meson ninja
76+
77+
- name: Setup modflow
78+
working-directory: ./modflow6
79+
run: |
80+
meson setup builddir --buildtype=debugoptimized --prefix=$(pwd) --libdir=bin
81+
82+
- name: Build modflow
83+
working-directory: ./modflow6
84+
run: |
85+
meson compile -C builddir
86+
87+
- name: Install modflow
88+
working-directory: ./modflow6
89+
run: |
90+
meson install -C builddir
91+
92+
- name: Get executables
93+
working-directory: ./modflow6/autotest
94+
run: |
95+
pytest -v --durations=0 get_exes.py
96+
97+
- name: Run pytest
98+
working-directory: ./modflow6/autotest
99+
run: |
100+
pytest -v -n auto -k "test_gw" --durations=0 --cov=flopy --cov-report=xml
101+
102+
- name: Print coverage report before upload
103+
working-directory: ./modflow6/autotest
104+
run: |
105+
coverage report
106+
107+
- name: Upload coverage to Codecov
108+
uses: codecov/[email protected]
109+
with:
110+
directory: ./modflow6/autotest
111+
file: coverage.xml

0 commit comments

Comments
 (0)