modflow-devtools 1.5.0__tar.gz → 1.6.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {modflow_devtools-1.5.0/modflow_devtools.egg-info → modflow_devtools-1.6.0}/PKG-INFO +1 -1
- {modflow_devtools-1.5.0 → modflow_devtools-1.6.0}/modflow_devtools/__init__.py +2 -2
- {modflow_devtools-1.5.0 → modflow_devtools-1.6.0}/modflow_devtools/misc.py +35 -7
- {modflow_devtools-1.5.0 → modflow_devtools-1.6.0}/modflow_devtools/snapshots.py +57 -6
- {modflow_devtools-1.5.0 → modflow_devtools-1.6.0/modflow_devtools.egg-info}/PKG-INFO +1 -1
- modflow_devtools-1.6.0/version.txt +1 -0
- modflow_devtools-1.5.0/version.txt +0 -1
- {modflow_devtools-1.5.0 → modflow_devtools-1.6.0}/LICENSE.md +0 -0
- {modflow_devtools-1.5.0 → modflow_devtools-1.6.0}/MANIFEST.in +0 -0
- {modflow_devtools-1.5.0 → modflow_devtools-1.6.0}/README.md +0 -0
- {modflow_devtools-1.5.0 → modflow_devtools-1.6.0}/modflow_devtools/build.py +0 -0
- {modflow_devtools-1.5.0 → modflow_devtools-1.6.0}/modflow_devtools/download.py +0 -0
- {modflow_devtools-1.5.0 → modflow_devtools-1.6.0}/modflow_devtools/fixtures.py +0 -0
- {modflow_devtools-1.5.0 → modflow_devtools-1.6.0}/modflow_devtools/imports.py +0 -0
- {modflow_devtools-1.5.0 → modflow_devtools-1.6.0}/modflow_devtools/latex.py +0 -0
- {modflow_devtools-1.5.0 → modflow_devtools-1.6.0}/modflow_devtools/markers.py +0 -0
- {modflow_devtools-1.5.0 → modflow_devtools-1.6.0}/modflow_devtools/ostags.py +0 -0
- {modflow_devtools-1.5.0 → modflow_devtools-1.6.0}/modflow_devtools/zip.py +0 -0
- {modflow_devtools-1.5.0 → modflow_devtools-1.6.0}/modflow_devtools.egg-info/SOURCES.txt +0 -0
- {modflow_devtools-1.5.0 → modflow_devtools-1.6.0}/modflow_devtools.egg-info/dependency_links.txt +0 -0
- {modflow_devtools-1.5.0 → modflow_devtools-1.6.0}/modflow_devtools.egg-info/not-zip-safe +0 -0
- {modflow_devtools-1.5.0 → modflow_devtools-1.6.0}/modflow_devtools.egg-info/requires.txt +0 -0
- {modflow_devtools-1.5.0 → modflow_devtools-1.6.0}/modflow_devtools.egg-info/top_level.txt +0 -0
- {modflow_devtools-1.5.0 → modflow_devtools-1.6.0}/pyproject.toml +0 -0
- {modflow_devtools-1.5.0 → modflow_devtools-1.6.0}/setup.cfg +0 -0
- {modflow_devtools-1.5.0 → modflow_devtools-1.6.0}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: modflow-devtools
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.6.0
|
|
4
4
|
Summary: Python tools for MODFLOW development
|
|
5
5
|
Author-email: "Joseph D. Hughes" <modflow@usgs.gov>, Michael Reno <mreno@ucar.edu>, Mike Taves <mwtoews@gmail.com>, Wes Bonelli <wbonelli@ucar.edu>
|
|
6
6
|
Maintainer-email: "Joseph D. Hughes" <modflow@usgs.gov>
|
|
@@ -284,13 +284,41 @@ def get_model_paths(
|
|
|
284
284
|
Find model directories recursively in the given location.
|
|
285
285
|
A model directory is any directory containing one or more
|
|
286
286
|
namefiles. Model directories can be filtered or excluded,
|
|
287
|
-
by prefix, pattern, namefile name, or packages used.
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
287
|
+
by prefix, pattern, namefile name, or packages used. The
|
|
288
|
+
directories are returned in order within scenario folders
|
|
289
|
+
such that groundwater flow model workspaces precede other
|
|
290
|
+
model types. This allows models which depend on the flow
|
|
291
|
+
model's outputs to consume its head or budget, and models
|
|
292
|
+
should successfully run in the sequence returned provided
|
|
293
|
+
input files (e.g. FMI) refer to output via relative paths.
|
|
294
|
+
"""
|
|
295
|
+
|
|
296
|
+
def keyfunc(v):
|
|
297
|
+
v = str(v)
|
|
298
|
+
if "gwf" in v:
|
|
299
|
+
return 0
|
|
300
|
+
else:
|
|
301
|
+
return 1
|
|
302
|
+
|
|
303
|
+
model_paths = []
|
|
304
|
+
globbed = path.rglob(f"{prefix if prefix else ''}*")
|
|
305
|
+
example_paths = [p for p in globbed if p.is_dir()]
|
|
306
|
+
for p in example_paths:
|
|
307
|
+
for mp in sorted(
|
|
308
|
+
list(
|
|
309
|
+
set(
|
|
310
|
+
[
|
|
311
|
+
p.parent
|
|
312
|
+
for p in get_namefile_paths(
|
|
313
|
+
p, prefix, namefile, excluded, selected, packages
|
|
314
|
+
)
|
|
315
|
+
]
|
|
316
|
+
)
|
|
317
|
+
),
|
|
318
|
+
key=keyfunc,
|
|
319
|
+
):
|
|
320
|
+
if mp not in model_paths:
|
|
321
|
+
model_paths.append(mp)
|
|
294
322
|
return model_paths
|
|
295
323
|
|
|
296
324
|
|
|
@@ -8,10 +8,13 @@ pytest = import_optional_dependency("pytest")
|
|
|
8
8
|
syrupy = import_optional_dependency("syrupy")
|
|
9
9
|
|
|
10
10
|
# ruff: noqa: E402
|
|
11
|
+
from syrupy import __import_extension
|
|
12
|
+
from syrupy.assertion import SnapshotAssertion
|
|
11
13
|
from syrupy.extensions.single_file import (
|
|
12
14
|
SingleFileSnapshotExtension,
|
|
13
15
|
WriteMode,
|
|
14
16
|
)
|
|
17
|
+
from syrupy.location import PyTestLocation
|
|
15
18
|
from syrupy.types import (
|
|
16
19
|
PropertyFilter,
|
|
17
20
|
PropertyMatcher,
|
|
@@ -90,19 +93,67 @@ class ReadableArrayExtension(SingleFileSnapshotExtension):
|
|
|
90
93
|
return np.array2string(data, threshold=np.inf)
|
|
91
94
|
|
|
92
95
|
|
|
96
|
+
class MatchAnything:
|
|
97
|
+
def __eq__(self, _):
|
|
98
|
+
return True
|
|
99
|
+
|
|
100
|
+
|
|
93
101
|
# fixtures
|
|
94
102
|
|
|
95
103
|
|
|
104
|
+
@pytest.fixture(scope="session")
|
|
105
|
+
def snapshot_disable(pytestconfig) -> bool:
|
|
106
|
+
return pytestconfig.getoption("--snapshot-disable")
|
|
107
|
+
|
|
108
|
+
|
|
96
109
|
@pytest.fixture
|
|
97
|
-
def
|
|
98
|
-
return
|
|
110
|
+
def snapshot(request, snapshot_disable) -> "SnapshotAssertion":
|
|
111
|
+
return (
|
|
112
|
+
MatchAnything()
|
|
113
|
+
if snapshot_disable
|
|
114
|
+
else SnapshotAssertion(
|
|
115
|
+
update_snapshots=request.config.option.update_snapshots,
|
|
116
|
+
extension_class=__import_extension(request.config.option.default_extension),
|
|
117
|
+
test_location=PyTestLocation(request.node),
|
|
118
|
+
session=request.session.config._syrupy,
|
|
119
|
+
)
|
|
120
|
+
)
|
|
99
121
|
|
|
100
122
|
|
|
101
123
|
@pytest.fixture
|
|
102
|
-
def
|
|
103
|
-
return
|
|
124
|
+
def array_snapshot(snapshot, snapshot_disable):
|
|
125
|
+
return (
|
|
126
|
+
MatchAnything()
|
|
127
|
+
if snapshot_disable
|
|
128
|
+
else snapshot.use_extension(BinaryArrayExtension)
|
|
129
|
+
)
|
|
104
130
|
|
|
105
131
|
|
|
106
132
|
@pytest.fixture
|
|
107
|
-
def
|
|
108
|
-
return
|
|
133
|
+
def text_array_snapshot(snapshot, snapshot_disable):
|
|
134
|
+
return (
|
|
135
|
+
MatchAnything()
|
|
136
|
+
if snapshot_disable
|
|
137
|
+
else snapshot.use_extension(TextArrayExtension)
|
|
138
|
+
)
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
@pytest.fixture
|
|
142
|
+
def readable_array_snapshot(snapshot, snapshot_disable):
|
|
143
|
+
return (
|
|
144
|
+
MatchAnything()
|
|
145
|
+
if snapshot_disable
|
|
146
|
+
else snapshot.use_extension(ReadableArrayExtension)
|
|
147
|
+
)
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
# pytest config hooks
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
def pytest_addoption(parser):
|
|
154
|
+
parser.addoption(
|
|
155
|
+
"--snapshot-disable",
|
|
156
|
+
action="store_true",
|
|
157
|
+
default=False,
|
|
158
|
+
help="Disable snapshot comparisons.",
|
|
159
|
+
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: modflow-devtools
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.6.0
|
|
4
4
|
Summary: Python tools for MODFLOW development
|
|
5
5
|
Author-email: "Joseph D. Hughes" <modflow@usgs.gov>, Michael Reno <mreno@ucar.edu>, Mike Taves <mwtoews@gmail.com>, Wes Bonelli <wbonelli@ucar.edu>
|
|
6
6
|
Maintainer-email: "Joseph D. Hughes" <modflow@usgs.gov>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1.6.0
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
1.5.0
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{modflow_devtools-1.5.0 → modflow_devtools-1.6.0}/modflow_devtools.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|