Skip to content

mixing boolean filters with other filters is broken #246

Closed
@gdementen

Description

@gdementen
>>> 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions