Skip to content

Commit 4232fe3

Browse files
authored
Merge pull request #112 from DOI-USGS/v0.6.1
Version 0.6.1
2 parents c8fbf85 + 2cc9f5d commit 4232fe3

File tree

9 files changed

+27
-46
lines changed

9 files changed

+27
-46
lines changed

Diff for: .github/CODEOWNERS

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@aleaf

Diff for: ci/test_environment.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ dependencies:
2727
- coverage
2828
- flake8
2929
- pytest
30-
- sphinx
30+
- sphinx=8.1.3
3131
- numpydoc
3232
- nbsphinx # for rendering notebooks in sphinx-generated docs
3333
- sphinx-copybutton

Diff for: docs/source/conf.py

-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@
132132
# a list of builtin themes.
133133
#
134134
html_theme = 'sphinx_rtd_theme'
135-
import sphinx_rtd_theme
136135

137136
# Theme options are theme-specific and customize the look and feel of a theme
138137
# further. For a list of options available for each theme, see the

Diff for: docs/source/release-history.rst

+5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
Release History
33
===============
44

5+
Version 0.6.1 (2025-03-17)
6+
----------------------------------------
7+
* fix 'TemporalReference' issue related to change in Flopy code
8+
* fix issue with Mover Package SFR connections across LGR model interfaces (mover.py::get_sfr_package_connections)); follow-up fix to fbe1bb1 to handle cases where parent model SFR reach along the LGR interface has both upstream and downstream connections to the inset model.
9+
510
Version 0.6.0 (2025-01-06)
611
----------------------------------------
712

Diff for: mfsetup/discretization.py

+5-6
Original file line numberDiff line numberDiff line change
@@ -249,12 +249,12 @@ def fill_cells_vertically(top, botm):
249249
250250
Parameters
251251
----------
252-
top : 2D numpy array; model top elevations
252+
top : 2D (nrow, ncol) array; model top elevations
253253
botm : 3D (nlay, nrow, ncol) array; model bottom elevations
254254
255255
Returns
256256
-------
257-
top, botm : filled top and botm arrays
257+
botm : filled botm array
258258
"""
259259
thickness = get_layer_thicknesses(top, botm)
260260
assert np.all(np.isnan(thickness[np.isnan(thickness)]))
@@ -333,12 +333,11 @@ def get_layer(botm_array, i, j, elev):
333333
k : np.ndarray (1-D) or scalar
334334
zero-based layer index
335335
"""
336+
# convert scalars to 1D numpy arrays
336337
def to_array(arg):
337338
if np.isscalar(arg):
338-
np.array([arg])
339-
#if not isinstance(arg, np.ndarray):
340-
# return np.array([arg])
341-
else:
339+
return np.array([arg])
340+
else: # if already an np.array, return as is
342341
return np.array(arg)
343342

344343
i = to_array(i)

Diff for: mfsetup/equality.py

-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
mf6 = flopy.mf6
99
from flopy.datbase import DataInterface, DataType
1010
from flopy.mbase import ModelInterface
11-
from flopy.utils import TemporalReference
1211

1312

1413
def get_package_list(model):
@@ -81,8 +80,6 @@ def package_eq(pk1, pk2):
8180
# TODO: this may return False if there are nans
8281
elif not np.allclose(v.array, v2.array):
8382
return False
84-
elif isinstance(v, TemporalReference):
85-
pass
8683
elif v != v2:
8784
return False
8885
return True

Diff for: mfsetup/fileio.py

+1-20
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
)
2626
from flopy.mf6.modflow import mfims, mftdis
2727
from flopy.modflow.mf import ModflowGlobal
28-
from flopy.utils import TemporalReference, mfreadnam
28+
from flopy.utils import mfreadnam
2929

3030
import mfsetup
3131
from mfsetup.grid import MFsetupGrid
@@ -647,25 +647,6 @@ def flopy_mf2005_load(m, load_only=None, forgive=False, check=False):
647647
m.setup_grid() # reset model grid now that DIS package is loaded
648648
assert m.pop_key_list.pop() == dis_key
649649
ext_unit_dict.pop(dis_key) #.filehandle.close()
650-
#start_datetime = attribs.pop("start_datetime", "01-01-1970")
651-
#itmuni = attribs.pop("itmuni", 4)
652-
#ref_source = attribs.pop("source", "defaults")
653-
# if m.structured:
654-
# # get model units from usgs.model.reference, if provided
655-
# if ref_source == 'usgs.model.reference':
656-
# pass
657-
# # otherwise get them from the DIS file
658-
# else:
659-
# itmuni = dis.itmuni
660-
# ref_attributes['lenuni'] = dis.lenuni
661-
# sr = SpatialReference(delr=m.dis.delr.array, delc=ml.dis.delc.array,
662-
# **ref_attributes)
663-
# else:
664-
# sr = None
665-
#
666-
#dis.sr = m.sr
667-
#dis.tr = TemporalReference(itmuni=itmuni, start_datetime=start_datetime)
668-
#dis.start_datetime = start_datetime
669650

670651
if load_only is None:
671652
# load all packages/files

Diff for: mfsetup/mover.py

+14-12
Original file line numberDiff line numberDiff line change
@@ -164,18 +164,20 @@ def neighbors(i, j):
164164
for parent_reach, inset_reach in parent_to_inset.items():
165165
if parent_reach in inset_to_parent.values():
166166
parent_to_inset_distance = parent_to_inset_distances[parent_reach]
167-
inset_to_parent_distance = inset_to_parent_distances[inset_reach]
168-
if inset_to_parent_distance < parent_to_inset_distance:
169-
delete_parent_to_inset_items.add(parent_reach)
170-
elif parent_to_inset_distance < inset_to_parent_distance:
171-
del inset_to_parent[inset_reach]
172-
else:
173-
raise ValueError("Circular connection between SFR Packages in the Mover Package input.\n"
174-
f"Connection distance between the end of parent reach {parent_reach} "
175-
f"in parent model and start of inset reach {inset_reach} in inset model "
176-
f"is equal to\nthe distance between the end of inset reach {inset_reach} "
177-
f"and start of parent reach {parent_reach}.\nCheck input linework."
178-
)
167+
if inset_to_parent_distances.get(inset_reach) is not None:
168+
inset_to_parent_distance = inset_to_parent_distances[inset_reach]
169+
if inset_to_parent_distance < parent_to_inset_distance:
170+
delete_parent_to_inset_items.add(parent_reach)
171+
elif parent_to_inset_distance < inset_to_parent_distance:
172+
del inset_to_parent[inset_reach]
173+
else:
174+
raise ValueError(
175+
"Circular connection between SFR Packages in the Mover Package input.\n"
176+
f"Connection distance between the end of parent reach {parent_reach} "
177+
f"in parent model and start of inset reach {inset_reach} in inset model "
178+
f"is equal to\nthe distance between the end of inset reach {inset_reach} "
179+
f"and start of parent reach {parent_reach}.\nCheck input linework."
180+
)
179181
for parent_reach in delete_parent_to_inset_items:
180182
del parent_to_inset[parent_reach]
181183
return parent_to_inset, inset_to_parent

Diff for: pyproject.toml

-3
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,6 @@ docs = [
6666
"sphinx-rtd-theme"
6767
]
6868

69-
[project.scripts]
70-
get-modflow = "flopy.utils.get_modflow:cli_main"
71-
7269
[project.urls]
7370
documentation = "https://doi-usgs.github.io/modflow-setup/latest/"
7471
repository = "https://github.com/doi-usgs/modflow-setup"

0 commit comments

Comments
 (0)