Skip to content

Commit a155ce9

Browse files
deltamarnixwpbonelli
authored andcommitted
Let sparse work in both Chd and Oc
1 parent 4fd77e8 commit a155ce9

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

docs/examples/quickstart.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
# check CHD
3030
assert chd.data["head"][0, 0].item() == 1.0
3131
assert chd.data["head"][0, 99].item() == 0.0
32-
assert np.allclose(chd.data["head"][:, 1:99], np.full(98, 1e30))
32+
assert np.allclose(chd.data["head"][:, 1:99].data.todense(), np.full(98, 1e30))
3333

3434
# TODO: xarray index aliasing nlay/ncol/nrow to k/i/j?
3535
# assert chd.data["head"].loc(dict(k=0, i=0, j=0)) == 1.

flopy4/mf6/converters.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def _get_nn(cellid):
5252
kper = 0
5353
match len(shape):
5454
case 1:
55-
a[(kper)] = period
55+
a[(kper,)] = period
5656
case _:
5757
for cellid, v in period.items():
5858
nn = _get_nn(cellid)
@@ -62,7 +62,7 @@ def _get_nn(cellid):
6262
else:
6363
for cellid, v in value.items():
6464
nn = _get_nn(cellid)
65-
a[(nn)] = v
65+
a[(nn,)] = v
6666

6767
coords = np.array(list(map(list, zip(*a.keys()))))
6868
return sparse.COO(

0 commit comments

Comments
 (0)