Skip to content

Commit 3d41f4d

Browse files
committed
added test for la[valuegroup_at_wrong_place]
1 parent d83fbf6 commit 3d41f4d

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

larray/tests/test_la.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,14 @@ def test_setitem_larray(self):
623623
raw[[1, 5, 9]] = raw[[1, 5, 9]] + 25.0
624624
self._assert_equal_raw(la, raw)
625625

626-
# b) value has an extra length-1 axis
626+
# b) value has exactly the same shape but VG is at a "wrong" position
627+
la = self.larray.copy()
628+
# same raw as previous test
629+
630+
la[geo[:], ages1_5_9] = la[ages1_5_9] + 25.0
631+
self._assert_equal_raw(la, raw)
632+
633+
# c) value has an extra length-1 axis
627634
la = self.larray.copy()
628635
raw = self.array.copy()
629636

@@ -636,14 +643,14 @@ def test_setitem_larray(self):
636643
raw[[1, 5, 9]] = raw[[1, 5, 9]] + 26.0
637644
self._assert_equal_raw(la, raw)
638645

639-
# c) value has the same axes than target but one has length 1
646+
# d) value has the same axes than target but one has length 1
640647
la = self.larray.copy()
641648
raw = self.array.copy()
642649
raw[[1, 5, 9]] = np.sum(raw[[1, 5, 9]], axis=1, keepdims=True)
643650
la[ages1_5_9] = la[ages1_5_9].sum(geo=(geo.all(),))
644651
self._assert_equal_raw(la, raw)
645652

646-
# d) value has a missing dimension
653+
# e) value has a missing dimension
647654
la = self.larray.copy()
648655
la[ages1_5_9] = la[ages1_5_9].sum(geo)
649656
# we use "raw" from previous test

0 commit comments

Comments
 (0)