-
Notifications
You must be signed in to change notification settings - Fork 322
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
1 parent
0d21b92
commit 71f6cc6
Showing
12 changed files
with
242 additions
and
240 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,2 @@ | ||
include flopy/export/longnames.json | ||
include flopy/export/unitsformat.json | ||
include flopy/mf6/data/dfn/*.dfn | ||
include flopy/plot/mplstyle/*.mplstyle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import os | ||
import pathlib | ||
|
||
import flopy | ||
|
||
root_folder = pathlib.Path(__file__).parent.parent | ||
flopy_folder = pathlib.Path(flopy.__file__).parent | ||
dfn_path = flopy_folder / "mf6" / "data" / "dfn" | ||
rename_path = flopy_folder / "mf6" / "data" / "no-dfn" | ||
|
||
|
||
def test_flopy_runs_without_dfn_folder(): | ||
""" Test to ensure that flopy can load a modflow 6 simulation without dfn files being present. """ | ||
exists = dfn_path.exists() | ||
if exists: | ||
if rename_path.exists(): | ||
os.rmdir(rename_path) | ||
os.rename(dfn_path, rename_path) | ||
try: | ||
# run built executable | ||
sim_path = root_folder / 'examples' / 'data' / 'mf6' / 'test006_gwf3' | ||
|
||
flopy.mf6.MFSimulation.load(sim_ws=str(sim_path)) | ||
finally: | ||
if exists and rename_path.exists(): | ||
os.rename(rename_path, dfn_path) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
""" Human readable long names for netCDF variables. """ | ||
|
||
NC_LONG_NAMES = { | ||
"botm": "Model layer bottom elevations", | ||
"crs": "Coordinate reference system", | ||
"delc": "Model grid cell spacing along a column", | ||
"delr": "Model grid cell spacing along a row", | ||
"drn_cond": "Drain package conductance", | ||
"drn_elev": "Drain package elevation", | ||
"elevation": "Elevation", | ||
"ghb_bhead": "General head boundary package head", | ||
"ghb_cond": "General head boundary package conductance", | ||
"hani": "Horizontal hydraulic conductivity anisotropy", | ||
"hk": "Horizontal hydraulic conductivity", | ||
"ibound": "Flow model active area array", | ||
"icbund": "Transport model active array", | ||
"latitude": "Latitude", | ||
"layer": "Model layer", | ||
"longitude": "Longitude", | ||
"mnw2_B": "MultiNode well package B coefficient", | ||
"mnw2_C": "MultiNode well package C coefficient", | ||
"mnw2_P": "MultiNode well package P coefficient", | ||
"mnw2_capmult": "MultiNode well package head capacity relation multiplier", | ||
"mnw2_cprime": "MultiNode well package injected fluid concentration", | ||
"mnw2_cwc": "MultiNode well package cell to well conductance", | ||
"mnw2_hlift": "MultiNode well package reference head for well discharge point", | ||
"mnw2_hlim": "MultiNode well package limiting head for well", | ||
"mnw2_hwtol": "MultiNode well package water level solution tolerance", | ||
"mnw2_kskin": "MultiNode well package well skin hydraulic conductivity", | ||
"mnw2_liftn": "MultiNode well package known value of lift at discharge n", | ||
"mnw2_liftq0": "MultiNode well package maximum lift of pump", | ||
"mnw2_liftqmax": "MultiNode well package lift at maximum pumping rate", | ||
"mnw2_pp": "MultiNode well package fraction of partial penetration", | ||
"mnw2_ppflag": "MultiNode well package partial penetration adjustment flag", | ||
"mnw2_pumpcap": "MultiNode well package pump lift adjustment flag", | ||
"mnw2_pumpcol": "MultiNode well package pump intake column", | ||
"mnw2_pumplay": "MultiNode well package pump intake layer", | ||
"mnw2_pumploc": "MultiNode well package pump location flag", | ||
"mnw2_pumprow": "MultiNode well package pump intake row", | ||
"mnw2_qcut": "MultiNode well package pump limits flag", | ||
"mnw2_qdes": "MultiNode well package desired volumetric pumping rate", | ||
"mnw2_qfrcmn": "MultiNode well package minimum fraction of " | ||
"original pumping rate for well to remain active", | ||
"mnw2_qfrcmx": "MultiNode well package minimum fraction of " | ||
"original pumping rate for well to reactivate", | ||
"mnw2_qlimit": "MultiNode well package pumping constraint flag", | ||
"mnw2_qn": "MultiNode well package known value of discharge n", | ||
"mnw2_rskin": "MultiNode well package radius of well skin outer edge", | ||
"mnw2_rw": "MultiNode well package radius of well", | ||
"mnw2_zbotm": "MultiNode well package botm of well open interval", | ||
"mnw2_zpump": "MultiNode well package pump elevation", | ||
"mnw2_ztop": "MultiNode well package top of open interval", | ||
"model_top": "Model top", | ||
"prsity": "Porosity", | ||
"rech": "Simulated groundwater recharge rates", | ||
"riv_cond": "River package bed conductance", | ||
"riv_rbot": "River package bottom elevation", | ||
"riv_stage": "River package stage", | ||
"sconc1": "Starting concentration", | ||
"sfr_eps": "Streamflow Routing Package Brooks Corey exponent", | ||
"sfr_ireach": "Streamflow Routing Package reach number", | ||
"sfr_iseg": "Streamflow Routing Package segment number", | ||
"sfr_j": "Streamflow Routing Package reach column", | ||
"sfr_outreach": "Streamflow Routing Package downstream reach", | ||
"sfr_rchlen": "Streamflow Routing Package reach length", | ||
"sfr_reachID": "Streamflow Routing Package reach ID", | ||
"sfr_slope": "Streamflow Routing Package streambed slope", | ||
"sfr_strhc1": "Streamflow Routing Package streambed hydraulic conductivity", | ||
"sfr_strthick": "Streamflow Routing Package streambed thickness", | ||
"sfr_strtop": "Streamflow Routing Package streambed top", | ||
"sfr_thti": "Streamflow Routing Package unsaturated zone " | ||
"initial volumetric water content", | ||
"sfr_thts": "Streamflow Routing Package unsaturated zone " | ||
"saturated volumetric water content", | ||
"sfr_uhc": "Streamflow Routing Package unsaturated zone " | ||
"saturated vertical hydraulic conductivity", | ||
"ss": "Specific storage", | ||
"strt": "Starting heads", | ||
"sy": "Specific yield", | ||
"thickness": "Layer thickness", | ||
"time": "time", | ||
"vka": "Vertical hydraulic conductivity or vertical anisotropy", | ||
"vkcb": "Vertical hydraulic conductivity of quasi3d confining bed", | ||
"wel_flux": "Well package flux", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.