Closed daanhb closed 1 year ago
Base: 85.82% // Head: 85.71% // Decreases project coverage by -0.11%
:warning:
Coverage data is based on head (
1284066
) compared to base (5189b92
). Patch coverage: 73.33% of modified lines in pull request are covered.
:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
It's fun to create domains with generator syntax, but we've been doing it wrong. Currently, we have
This domain corresponds to the half-open interval
(0,1]
(although the code does not realize that), based on the boolean-valued indicator functionx -> x>0
.In hindsight, that was not the right call. An indicator function is best specified as a conditional clause:
This PR adds support for the latter.
In the future, perhaps we can use the generator syntax to create mapped domains, i.e.
Domain(2x for x in -1..1)
would correspond to[-2,2]
. But right now the syntax is taken, so that would be a breaking change.For now, I've just added if clauses to generators.