Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot subscript a string LGroup key #437

Closed
gdementen opened this issue Sep 19, 2017 · 2 comments
Closed

cannot subscript a string LGroup key #437

gdementen opened this issue Sep 19, 2017 · 2 comments
Assignees
Labels
Milestone

Comments

@gdementen
Copy link
Contributor

Ironically, it works for PGroup:

>>> a = Axis('a=a0,a1')
>>> a.i[0][1:]
'0'
>>> a['a0'][1:]
TypeError: cannot take a subset of a0 because it has a '<class 'str'>' key
>>> # one can workaround this by using str() on the group, but that should not be necessary
>>> str(a['a0'])[1:]
'0'
@gdementen gdementen added the bug label Sep 19, 2017
@gdementen gdementen added this to the 0.26 milestone Sep 19, 2017
@gdementen gdementen self-assigned this Sep 20, 2017
@gdementen gdementen modified the milestones: 0.26, 0.26.1 Oct 13, 2017
@gdementen gdementen modified the milestones: 0.26.1, 0.27 Oct 25, 2017
@gdementen
Copy link
Contributor Author

I think this is simply the test at:
https://github.com/liam2/larray/blob/master/larray/core/group.py#L974

which is bogus. I guess it only needs to be changed to:

elif np.isscalar(orig_key):

@gdementen gdementen removed their assignment Nov 10, 2017
@alixdamman alixdamman modified the milestones: 0.27, 0.28 Nov 16, 2017
@alixdamman alixdamman self-assigned this Dec 1, 2017
alixdamman added a commit to alixdamman/larray that referenced this issue Dec 18, 2017
@alixdamman
Copy link
Collaborator

closed by PR #561. Wrong commit message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants