Skip to content

make axis['multiple;groups'] work #151

Open
@gdementen

Description

@gdementen

I am not sure we should keep axis['a_string'] being interpreted, but if we do the title should work.

Salvaged from my comments in #145.

However (and this is a bit silly that I did not make it work -- but to my defense, I did not expect you to merge that PR), what you used as an example is broken at this point, because the result is not a valid index in an array:

>>> year = Axis('year', '2001..2010')
>>> year['2001:2004;2008;2009']
year[slice(2001, 2004, None), [2008, 2009]]
>>> arr = ndrange(year)
>>> arr.sum(year['2001:2004;2008,2009'])
TypeError                                 Traceback (most recent call last)
...
TypeError: unhashable type: 'slice'
>>> # this works though
... arr.sum(tuple(year['2001:2004;2008,2009']))
year | 2001:2004 | 2008,2009
     |         6 |        15

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions