Skip to content

Commit ab37a2d

Browse files
authored
chore(pixi): update pixi, tidy pixi.toml, update/apply ruff (#2139)
* update pixi version in ci workflows * avoid some warnings in the pixi.toml file * update ruff version in the pixi environment and apply ruff reformatting
1 parent 9377384 commit ab37a2d

File tree

96 files changed

+5322
-11964
lines changed

Some content is hidden

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

96 files changed

+5322
-11964
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
- name: Setup pixi
5252
uses: prefix-dev/[email protected]
5353
with:
54-
pixi-version: v0.24.2
54+
pixi-version: v0.40.1
5555

5656
- name: Check Fortran source formatting
5757
run: pixi run check-format
@@ -87,7 +87,7 @@ jobs:
8787
- name: Setup pixi
8888
uses: prefix-dev/[email protected]
8989
with:
90-
pixi-version: v0.24.2
90+
pixi-version: v0.40.1
9191

9292
- name: Setup MF6
9393
run: pixi run setup -Dwerror=true builddir
@@ -132,7 +132,7 @@ jobs:
132132
- name: Setup pixi
133133
uses: prefix-dev/[email protected]
134134
with:
135-
pixi-version: v0.24.2
135+
pixi-version: v0.40.1
136136
manifest-path: "modflow6/pixi.toml"
137137

138138
- name: Custom pixi install
@@ -249,7 +249,7 @@ jobs:
249249
- name: Setup pixi
250250
uses: prefix-dev/[email protected]
251251
with:
252-
pixi-version: v0.24.2
252+
pixi-version: v0.40.1
253253
manifest-path: "modflow6/pixi.toml"
254254

255255
- name: Custom pixi install
@@ -412,7 +412,7 @@ jobs:
412412
- name: Setup pixi
413413
uses: prefix-dev/[email protected]
414414
with:
415-
pixi-version: v0.24.2
415+
pixi-version: v0.40.1
416416
manifest-path: "modflow6/pixi.toml"
417417

418418
- name: Custom pixi install
@@ -515,7 +515,7 @@ jobs:
515515
- name: Setup pixi
516516
uses: prefix-dev/[email protected]
517517
with:
518-
pixi-version: v0.24.2
518+
pixi-version: v0.40.1
519519
manifest-path: "modflow6/pixi.toml"
520520

521521
- name: Custom pixi install

.github/workflows/compilers.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ jobs:
9999
- name: Setup pixi
100100
uses: prefix-dev/[email protected]
101101
with:
102-
pixi-version: v0.24.2
102+
pixi-version: v0.40.1
103103
manifest-path: "modflow6/pixi.toml"
104104

105105
- name: Custom pixi install

.github/workflows/docs.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828

2929
- uses: prefix-dev/[email protected]
3030
with:
31-
pixi-version: v0.24.2
31+
pixi-version: v0.40.1
3232

3333
- name: Check spelling
3434
run: pixi run check-spelling
@@ -65,7 +65,7 @@ jobs:
6565
- name: Setup pixi
6666
uses: prefix-dev/[email protected]
6767
with:
68-
pixi-version: v0.24.2
68+
pixi-version: v0.40.1
6969
manifest-path: "modflow6/pixi.toml"
7070

7171
- name: Custom pixi install
@@ -237,7 +237,7 @@ jobs:
237237
- name: Setup pixi
238238
uses: prefix-dev/[email protected]
239239
with:
240-
pixi-version: v0.24.2
240+
pixi-version: v0.40.1
241241

242242
- name: Custom pixi install
243243
run: pixi run install

.github/workflows/large.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ jobs:
6969
- name: Setup pixi
7070
uses: prefix-dev/[email protected]
7171
with:
72-
pixi-version: v0.24.2
72+
pixi-version: v0.40.1
7373
manifest-path: "modflow6/pixi.toml"
7474

7575
- name: Custom pixi install

.github/workflows/pixi_auto_update.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- uses: actions/checkout@v4
1515
- uses: prefix-dev/[email protected]
1616
with:
17-
pixi-version: v0.24.2
17+
pixi-version: v0.40.1
1818
cache: false
1919

2020
- name: Update pixi lock file

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ jobs:
110110
- name: Setup pixi
111111
uses: prefix-dev/[email protected]
112112
with:
113-
pixi-version: v0.24.2
113+
pixi-version: v0.40.1
114114
manifest-path: "modflow6/pixi.toml"
115115

116116
- name: Custom pixi install

autotest/framework.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -518,15 +518,15 @@ def _compare_output(self, compare):
518518
rclose = get_rclose(self.workspace)
519519
cmp_path = self.workspace / compare
520520
if "mf6_regression" in compare:
521-
assert self._compare_heads(
522-
extensions=HDS_EXT, htol=htol
523-
), "head comparison failed"
524-
assert self._compare_budgets(
525-
extensions=CBC_EXT, rclose=rclose
526-
), "budget comparison failed"
527-
assert self._compare_concentrations(
528-
htol=htol
529-
), "concentration comparison failed"
521+
assert self._compare_heads(extensions=HDS_EXT, htol=htol), (
522+
"head comparison failed"
523+
)
524+
assert self._compare_budgets(extensions=CBC_EXT, rclose=rclose), (
525+
"budget comparison failed"
526+
)
527+
assert self._compare_concentrations(htol=htol), (
528+
"concentration comparison failed"
529+
)
530530
else:
531531
assert self._compare_heads(
532532
cpth=cmp_path,
@@ -562,9 +562,9 @@ def _run_sim_or_model(
562562
# make sure executable exists and framework knows about it
563563
tgt = Path(shutil.which(target))
564564
assert tgt.is_file(), f"Target executable not found: {target}"
565-
assert (
566-
tgt in self.targets.values()
567-
), "Targets must be explicitly registered with the test framework"
565+
assert tgt in self.targets.values(), (
566+
"Targets must be explicitly registered with the test framework"
567+
)
568568

569569
if self.verbose:
570570
print(f"Running {target} in {workspace}")

autotest/test_chf_dfw_loop.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -488,9 +488,9 @@ def check_output(idx, test):
488488
diff = obsvals["REACH14"] - answer["STAGE0000000014"]
489489
print(diff)
490490
print(diff.max(), diff.min())
491-
assert np.allclose(
492-
diff, 0.0, atol=0.06
493-
), f"Max diff with swr is {diff.min(), diff.max()}"
491+
assert np.allclose(diff, 0.0, atol=0.06), (
492+
f"Max diff with swr is {diff.min(), diff.max()}"
493+
)
494494

495495
# read the binary grid file
496496
fpth = test.workspace / f"{name}.disv1d.grb"
@@ -524,9 +524,9 @@ def check_output(idx, test):
524524
f"residual for cell {n + 1} is {qresidual[n]} "
525525
f"in position {ia[n] + 1} {passfail}"
526526
)
527-
assert np.allclose(
528-
qresidual, 0.0, atol=atol
529-
), "residual in flowja diagonal is not zero"
527+
assert np.allclose(qresidual, 0.0, atol=atol), (
528+
"residual in flowja diagonal is not zero"
529+
)
530530

531531
return
532532

autotest/test_chf_dis.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -165,22 +165,22 @@ def check_grb_disv1d(fpth):
165165
assert grb.xorigin == xorigin, "xorigin in grb file is not correct"
166166
assert grb.yorigin == yorigin, "yorigin in grb file is not correct"
167167
assert grb.angrot == angrot, "angrot in grb file is not correct"
168-
assert np.allclose(
169-
grb.bot.reshape((nodes,)), np.zeros((nodes,))
170-
), "grb botm not correct"
168+
assert np.allclose(grb.bot.reshape((nodes,)), np.zeros((nodes,))), (
169+
"grb botm not correct"
170+
)
171171
cellx = np.linspace(dx / 2, nreach * dx - dx / 2, nreach)
172172
celly = np.zeros(nreach)
173173
assert np.allclose(grb._datadict["CELLX"], cellx.flatten()), "cellx is not right"
174174
assert np.allclose(grb._datadict["CELLY"], celly.flatten()), "celly is not right"
175175
assert grb._datadict["IAVERT"].shape[0] == nodes + 1, "iavert size not right"
176-
assert (
177-
grb._datadict["IAVERT"][-1] - 1 == grb._datadict["JAVERT"].shape[0]
178-
), "javert size not right"
176+
assert grb._datadict["IAVERT"][-1] - 1 == grb._datadict["JAVERT"].shape[0], (
177+
"javert size not right"
178+
)
179179
assert grb.ia.shape[0] == grb.ncells + 1, "ia in grb file is not correct size"
180180
assert grb.ja.shape[0] == grb.nja, "ja in grb file is not correct size"
181-
assert np.allclose(
182-
grb.idomain.reshape((nodes,)), idomain.reshape((nodes,))
183-
), "grb idomain not correct"
181+
assert np.allclose(grb.idomain.reshape((nodes,)), idomain.reshape((nodes,))), (
182+
"grb idomain not correct"
183+
)
184184

185185

186186
def check_output(idx, test):
@@ -198,9 +198,9 @@ def check_output(idx, test):
198198
fpth = test.workspace / f"{modelname}.stage"
199199
sobj = flopy.utils.HeadFile(fpth, precision="double", text="STAGE")
200200
stage = sobj.get_data().reshape((nodes,))
201-
assert np.allclose(
202-
stage[idomain == 0], 3.0e30
203-
), "stage should have nodata values where idomain is zero"
201+
assert np.allclose(stage[idomain == 0], 3.0e30), (
202+
"stage should have nodata values where idomain is zero"
203+
)
204204
assert stage[idomain == 1].max() == 1.0, "maximum stage should be 1.0"
205205
assert stage[idomain == 1].min() == 0.5, "minimum stage should be 0.5"
206206

autotest/test_chf_dis_fdc.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -170,22 +170,22 @@ def check_grb_disv1d(fpth):
170170
assert grb.xorigin == xorigin, "xorigin in grb file is not correct"
171171
assert grb.yorigin == yorigin, "yorigin in grb file is not correct"
172172
assert grb.angrot == angrot, "angrot in grb file is not correct"
173-
assert np.allclose(
174-
grb.bot.reshape((nodes,)), np.zeros((nodes,))
175-
), "grb botm not correct"
173+
assert np.allclose(grb.bot.reshape((nodes,)), np.zeros((nodes,))), (
174+
"grb botm not correct"
175+
)
176176
cellx = np.array([0.0, 2 * dx]) # node centers pushed all the way to left and right
177177
celly = np.zeros(nreach)
178178
assert np.allclose(grb._datadict["CELLX"], cellx.flatten()), "cellx is not right"
179179
assert np.allclose(grb._datadict["CELLY"], celly.flatten()), "celly is not right"
180180
assert grb._datadict["IAVERT"].shape[0] == nodes + 1, "iavert size not right"
181-
assert (
182-
grb._datadict["IAVERT"][-1] - 1 == grb._datadict["JAVERT"].shape[0]
183-
), "javert size not right"
181+
assert grb._datadict["IAVERT"][-1] - 1 == grb._datadict["JAVERT"].shape[0], (
182+
"javert size not right"
183+
)
184184
assert grb.ia.shape[0] == grb.ncells + 1, "ia in grb file is not correct size"
185185
assert grb.ja.shape[0] == grb.nja, "ja in grb file is not correct size"
186-
assert np.allclose(
187-
grb.idomain.reshape((nodes,)), idomain.reshape((nodes,))
188-
), "grb idomain not correct"
186+
assert np.allclose(grb.idomain.reshape((nodes,)), idomain.reshape((nodes,))), (
187+
"grb idomain not correct"
188+
)
189189

190190

191191
def check_output(idx, test):

0 commit comments

Comments
 (0)