Skip to content

Bug in error message (computing partial matches) for array[Array with ndim > 1] #1134

Open
@gdementen

Description

@gdementen
>>> arr = ndtest("a=a0;b=b0..b1;c=1..2")
>>> key = ndtest((1, 2))
>>> arr[key]
TypeError                                 Traceback (most recent call last)
[...]
File [...]\larray\core\axis.py:2696, in AxisCollection._translate_nice_key(self, axis_key)
   2694 if isinstance(nicer_key, Group):
   2695     nicer_key = nicer_key.eval()
-> 2696 key_label_set = set(nicer_key)
   2697 partial_matches = {}
   2698 for axis in self:
TypeError: unhashable type: 'Array'

For a 1D array key, it works as it should:

>>> arr = ndtest("a=a0..a1;b=1..2")
>>> key = ndtest(2)
>>> arr[key]
ValueError: a  a0  a1
    0   1 is not a valid subset for any axis:
 a [2]: 'a0' 'a1'
 b [2]: 1 2
Some of those labels are valid though:
 * axis 'b' contains 1 out of 2 labels (missing labels: 0)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions