Skip to content

Commit f688a39

Browse files
committed
Changed 1-d slicing operation - now drops dimension always
1 parent 5f9d596 commit f688a39

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

arraypartition/partition.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,10 @@ def shape(self):
119119
if not self._extent:
120120
return self._shape
121121
for d, e in enumerate(self._extent):
122+
123+
if isinstance(e, int):
124+
continue
125+
122126
start = e.start or 0
123127
stop = e.stop or self._shape[d]
124128
step = e.step or 1

arraypartition/tests/test_array.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def test_array(self):
2222

2323
assert ap.shape == (20,20), "Shape Error"
2424

25-
assert (np.array(array_part)[5][0] - 0.463) < 0.001, "Data Error"
25+
assert (np.array(array_part)[0][5][0] - 0.463) < 0.001, "Data Error"
2626
assert (np.array(ap)[5][0] - 0.803) < 0.001, "Data Error"
2727

2828
if __name__ == '__main__':

0 commit comments

Comments
 (0)