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

Minor updates for open_lower and open_upper cf.wi query arguments #827

Merged
Merged
Changes from all commits
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
9 changes: 5 additions & 4 deletions cf/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,11 @@ class Query:
evaluated.
====================== ==============================================

In general, each method must have the query value as it's only
parameter. The only exception is for `__query_isclose__`, which
In general, each method must have the query value as its only
parameter. The only exceptions are for `__query_isclose__`, which
also requires the absolute and relative numerical tolerances to be
provided.
provided, and for `__query_wi__`, which also requires upper and
lower interval openness Booleans to be provided.

When the condition is on an attribute, or nested attributes, of
the operand, the query interface method is looked for on the
Expand Down Expand Up @@ -972,7 +973,7 @@ def _evaluate(self, x, parent_attr):
if operator == "wi":
_wi = getattr(x, "__query_wi__", None)
if _wi is not None:
return _wi(value)
return _wi(value, self.open_lower, self.open_upper)

if self.open_lower:
lower_bound = x > value[0]
Expand Down
Loading