Skip to content

Commit

Permalink
Merge pull request #827 from sadielbartholomew/open-interval-updates
Browse files Browse the repository at this point in the history
Minor updates for `open_lower` and `open_upper` `cf.wi` query arguments
  • Loading branch information
sadielbartholomew authored Oct 31, 2024
2 parents fb741f2 + c9aedd4 commit e123a8e
Showing 1 changed file with 5 additions and 4 deletions.
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

0 comments on commit e123a8e

Please sign in to comment.