Closed jwaa closed 3 years ago
This behaviour is caused by how State
functions when queried like this:
objs = State[{"foo": ["bar1", "bar2"] }]
In this case the State
will look for all objects that have the property "foo"
with as value "bar1"
or "bar2"
. In the case of the location it will thus search for all objects that have 1 or 1 as its value. Returning all objects that have 1 as either their x- or y-coordinate.
A straightforward fix is to tackle the location property as an outlier and treat its value (in the example (1,1)
) as is, instead of as a list of potential values allowed.
Describe the bug
State[{"location":(1,1)}]
or its more readable equivalentState.get_with_property({"location":(1,1)}, combined=True)
fails to return the correct objects (in this example all objects at location 1,1).To Reproduce
Expected behavior To only return the objects actually at that location, not a list of objects that have seemingly nothing in common.
Screenshots N/A
Stacktrace N/A
Additional context Came across this bug when we tested #202