2 ms·
As the comments on your linked issue point out: (a) Filtering is a last resort and is best avoided. As an example, the Gen type in Haskell's falsify package ca
by chriswarbo 2y ago
As the comments on your linked issue point out:
(a) Filtering is a last resort and is best avoided. As an example, the Gen type in Haskell's falsify package can't be filtered, since it's a bad idea. As another example, ScalaCheck's Gen type can be filtered, but they also allow "retries" (by default, up to 10,000 times), because filtering is very wasteful.
(b) If you're going to filter, scope it to be as small as possible (e.g. one comment points out that you're discarding and regenerating entire dataframes, when the filter only depends on one particular column)
(c) Have some vague awareness of how your generators will shrink, to avoid infinite loops. In your case, shrinking will make it more likely to fail your filter; and the "smallest" dataframe (all zeros) will definitely fail.
- skybrian 2y agoIt’s still very weird that the generator can’t avoid an all-zeros array. Figuring out the root cause might find something interesting.