scipy / scipy_doctest

Floating-point aware doctesting
BSD 3-Clause "New" or "Revised" License
5 stars 4 forks source link

Audit the DTChecker implementation, simplify where possible #79

Open ev-br opened 1 year ago

ev-br commented 1 year ago

The implementation of DTChecker has several "this needs to be done exactly like this" comments. On the contrary, some of these may be possible to simplify/streamline. However, this code has grown to account for actual usage in existing codebases, so this maintenance has a prerequisite of correctly testing at least numpy and scipy documentation.

ev-br commented 6 months ago

One smelly thing is https://github.com/ev-br/scpdt/blob/main/scpdt/impl.py#L317 : would be better to not create ragged arrays internally at all.

ev-br commented 6 months ago

Probably best to wait out until NumPy 2.0; then make sure it all works on both 1.x and 2.0, and only then go trim the fat.

ev-br commented 2 weeks ago

As a data point, I tried removing (in https://github.com/scipy/scipy_doctest/pull/173) the want == got check from https://github.com/scipy/scipy_doctest/blob/main/scipy_doctest/impl.py#L395 (which is where "this should be done exactly as written" comment comes from). It immediately causes some breakage in NumPy when IIRC comparing non-trivial dtypes: those are not handled by allclose and the check feel down to the literal white-space sensitive vanilla doctest comparison.