Allow "minimum"/"maximum" keys to be missing, as well as None
Some areas of the library check for both representations, and so doing this here too means we are less likely to break existing code. Despite this, flexibility introduces ambiguity, and so if typing gives us confidence that such an input is unlikely, we could re-review this; conditions with missing keys are not safe to use across the entire code- base.
This commit is contained in:
parent
fef9e9a071
commit
2da2653837
@ -352,7 +352,7 @@ def _extractSubSpace(
|
||||
def _conditionSetFrom(conditionSet: List[Dict[str, Any]]) -> ConditionSet:
|
||||
c: Dict[str, Range] = {}
|
||||
for condition in conditionSet:
|
||||
minimum, maximum = condition["minimum"], condition["maximum"]
|
||||
minimum, maximum = condition.get("minimum"), condition.get("maximum")
|
||||
c[condition["name"]] = Range(
|
||||
minimum if minimum is not None else -math.inf,
|
||||
maximum if maximum is not None else math.inf,
|
||||
|
Loading…
x
Reference in New Issue
Block a user