Skip to content

Commit 4fd77e8

Browse files
deltamarnixwpbonelli
authored andcommitted
Fix test_component
1 parent 71092a2 commit 4fd77e8

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

flopy4/mf6/converters.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import numpy as np
12
import sparse
23
from numpy.typing import NDArray
34
from xattree import _get_xatspec
@@ -63,7 +64,7 @@ def _get_nn(cellid):
6364
nn = _get_nn(cellid)
6465
a[(nn)] = v
6566

66-
coords = list(map(list, zip(*a.keys())))
67+
coords = np.array(list(map(list, zip(*a.keys()))))
6768
return sparse.COO(
6869
coords,
6970
list(a.values()),

test/test_component.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,13 @@ def test_init_sim_explicit_dims():
140140
assert np.array_equal(sim.models["gwf"].npf.data.k, np.ones(100))
141141
assert chd.head[0, 0] == 1.0
142142
assert chd.head[0, 99] == 0.0
143-
assert np.array_equal(chd.head[0, 1:99], np.full((98,), FILL_DNODATA))
144-
assert np.array_equal(chd.head, chd.data.head)
145-
assert np.array_equal(chd.head, sim.models["gwf"].chd[0].data.head)
143+
assert np.array_equal(
144+
chd.head[0, 1:99].data.todense(), np.full((98,), FILL_DNODATA)
145+
)
146+
assert np.array_equal(
147+
chd.head.data.todense(), chd.data.head.data.todense()
148+
)
149+
assert np.array_equal(
150+
chd.head.data.todense(),
151+
sim.models["gwf"].chd[0].data.head.data.todense(),
152+
)

0 commit comments

Comments
 (0)