Skip to content

Commit ea91bb1

Browse files
committed
Fixed ValueGroup.__init__
We cannot anymore check whether a key is valid via axis.translate because that function is not valid in the case of sparse arrays (we cannot translate each axis individually) TODO: this should be replaced by something like "axis.is_valid(key)" for simple keys this is just a matter of "key in axis"
1 parent 4f361b0 commit ea91bb1

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

larray/core.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -643,11 +643,19 @@ def __init__(self, key, name=None, axis=None):
643643
# impossible to know whether a name was explicitly given or computed
644644
self.name = name
645645

646-
if axis is not None:
646+
# if axis is not None:
647647
# check the key is valid
648648
# TODO: for performance reasons, we should cache the result.
649649
# This will need to be invalidated correctly
650-
axis.translate(key)
650+
651+
# we cannot do it via axis.translate anymore because that
652+
# function is not valid in the case of sparse arrays (we
653+
# cannot translate each axis individually)
654+
655+
# TODO: this should be replaced by something like
656+
# axis.is_valid(key)
657+
# for simple keys this is just a matter of "key in axis"
658+
# axis.translate(key)
651659
self.axis = axis
652660

653661
def __hash__(self):

0 commit comments

Comments
 (0)