Fix doctests for recent numpy versions (1.16-2.2) #18
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This package has not seen much work in a number of years, but still seems to work stably with recent scipy and numpy versions, including numpy 2.x since a compatible autograd version was released!
There are some issues as e.g. conda-forge has this flagged as only compatible with
numpy<2.0a0(conda-forge/oktopus-feedstock#2), and running the tests locally (all doctests afaics) fails on a number of changes in no. of significant digits, representation asnp.float64(x)etc., most of them however already fail with numpy 1.25.0, and some even as far back as 1.16.5, the oldest version supported for Python 3.8.Couple of minor changes here tested to pass with numpy 1.16.5-2.2.5 on macOS/x86_64. Maybe using
roundto reduce the number of printed digits would be more robust on different platforms, alsonp.printoptions(legacy='1.25')might be an alternative to get rid of thenp.float64()(cf. also scientific-python/pytest-doctestplus#210), but theprint()statements perhaps do not look too intrusive in the docs.Also could perhaps live with the doctests not passing on 32 bit.