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

mixing boolean filters with other filters is broken #246

Closed
gdementen opened this issue May 4, 2017 · 0 comments
Closed

mixing boolean filters with other filters is broken #246

gdementen opened this issue May 4, 2017 · 0 comments
Labels

Comments

@gdementen
Copy link
Contributor

>>> arr = ndrange('a=a0..a2;b=0..9')
>>> arr
a\b |  0 |  1 |  2 |  3 |  4 |  5 |  6 |  7 |  8 |  9
 a0 |  0 |  1 |  2 |  3 |  4 |  5 |  6 |  7 |  8 |  9
 a1 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19
 a2 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29
>>> arr[arr.b < 5]
a\b |  0 |  1 |  2 |  3 |  4
 a0 |  0 |  1 |  2 |  3 |  4
 a1 | 10 | 11 | 12 | 13 | 14
 a2 | 20 | 21 | 22 | 23 | 24
>>> arr['a1', arr.b < 5]
ValueError                                Traceback (most recent call last)
...
ValueError: b |    0 |    1 |    2 |    3 |    4 |     5 |     6 |     7 |     8 |     9
  | True | True | True | True | True | False | False | False | False | False is ambiguous (valid in a, b)
>>> arr['a1', x.b < 5]
AssertionError                            Traceback (most recent call last)
...
AssertionError: <larray.core.BinaryOp object at 0x000001519BB97160> (<class 'larray.core.BinaryOp'>) is not scalar
>>> # but this works
>>> arr['a1'][arr.b < 5]
b |  0 |  1 |  2 |  3 |  4
  | 10 | 11 | 12 | 13 | 14
>>> arr['a1'][x.b < 5]
b |  0 |  1 |  2 |  3 |  4
  | 10 | 11 | 12 | 13 | 14
@gdementen gdementen added the bug label May 4, 2017
@gdementen gdementen changed the title fix mixing boolean filters with other filters mixing boolean filters with other filters is broken May 8, 2017
alixdamman added a commit to alixdamman/larray that referenced this issue Aug 24, 2017
alixdamman added a commit to alixdamman/larray that referenced this issue Aug 24, 2017
alixdamman added a commit to alixdamman/larray that referenced this issue Aug 28, 2017
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