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

dask: Data query interface #368

Merged
merged 3 commits into from
Apr 5, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 0 additions & 19 deletions cf/data/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -4272,25 +4272,6 @@ def _binary_operation(self, other, method):

return self

def __query_set__(self, values):
"""Implements the “member of set” condition."""
i = iter(values)
v = next(i)

out = self == v
for v in i:
out |= self == v

return out

def __query_wi__(self, value):
"""Implements the “within a range” condition."""
return (self >= value[0]) & (self <= value[1])

def __query_wo__(self, value):
"""TODO."""
return (self < value[0]) | (self > value[1])

@classmethod
def concatenate(cls, data, axis=0, _preserve=True):
"""Join a sequence of data arrays together.
Expand Down
7 changes: 0 additions & 7 deletions cf/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -690,13 +690,6 @@ def _evaluate(self, x, parent_attr):

return (x < value[0]) | (x > value[1])

# if operator == 'contains':
# _contain = getattr(x, '__query_contains__', None)
# if _contain is not None:
# return _contain(value)
# else:
# return x == value

if operator == "set":
if isinstance(x, str):
for v in value:
Expand Down