Closed srush closed 2 years ago
Thanks! Do you happen to have an example showcasing the problem?
What properties do you have in mind to test, in particular for envelopes? Something like what they mention in the comments:
‖proj(u, v)‖ / ‖v‖ ≤ dia.envelope(v)
for all dia
, u ∈ dia
and v ∈ R²
?
This should be 2 but is failing circle(1).get_envelope()(2 * unit_x)
. All the logic is in envelope apply_transform
so my guess that is not handling magnitude properly.
Yes, I think that property is good. Think we could come up with some others as well. The interesting part would be a sampling strategy for transforms / diagrams.
There is still a bug in calculation of envelope scaling. Tried to implement this code but I think I missed a scaling factor.
https://hackage.haskell.org/package/diagrams-core-1.5.0/docs/src/Diagrams.Core.Envelope.html#Envelope
As part of fixing this will also implement some tests for traces / envelopes / trails. Possibly using Hypothesis. It is nice that these are easy to tests.