Skip to content

Commit 00777f2

Browse files
authored
Merge pull request #197 from ToFuProject/Issue196_InterpolateExtract
[#196] `interpolate()` minor debug
2 parents f447434 + 1cbdb32 commit 00777f2

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

datastock/_class1_compute.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1233,4 +1233,4 @@ def _extract_select(
12331233
# lkey=[idq2dR],
12341234
# return_all=True,
12351235
# )
1236-
# return out
1236+
# return out

datastock/_class1_interpolate.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1627,7 +1627,12 @@ def _store(
16271627
ldata = list(set(itt.chain.from_iterable([
16281628
v0['ref'] for v0 in dout.values()
16291629
])))
1630-
coll2 = coll.extract(keys=ldata, vectors=True)
1630+
1631+
coll2 = coll.extract(
1632+
keys=ldata,
1633+
inc_vectors=True,
1634+
return_keys=False,
1635+
)
16311636

16321637
# -------------
16331638
# store_keys
@@ -1645,7 +1650,13 @@ def _store(
16451650
excluded=lout,
16461651
)
16471652

1648-
assert len(store_keys) == len(dout)
1653+
if len(store_keys) != len(dout):
1654+
msg = (
1655+
"Nb of store_keys != nb of keys in dout!\n"
1656+
f"\t- store_keys:\n{store_keys}\n "
1657+
f"\t- dout.keys():\n{sorted(dout.keys())}\n "
1658+
)
1659+
raise Exception(msg)
16491660

16501661
# ---------
16511662
# add data
@@ -1659,4 +1670,4 @@ def _store(
16591670
units=v0['units'],
16601671
)
16611672

1662-
return coll2
1673+
return coll2

0 commit comments

Comments
 (0)