Skip to content

MAINT: Bump scipy-doctest to 1.8 #29085

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 5, 2025
Merged

MAINT: Bump scipy-doctest to 1.8 #29085

merged 3 commits into from
Jun 5, 2025

Conversation

ev-br
Copy link
Contributor

@ev-br ev-br commented May 29, 2025

Bump the minimum scipy_doctest version to >=1.8.0

See https://discuss.scientific-python.org/t/scipy-doctest-select-only-doctests-or-both-doctests-and-unit-tests/1950 for the discussion, and the matching SciPy PR, scipy/scipy#23078

TL;DR: this change is currently a no-op; this is the only change needed to be forward compatible with an upcoming breaking change in scipy-doctest, no further action is needed in numpy itself. Unfortunately, all users who do $ spin check-docs locally will need to pip install --update scipy-doctest --- once.

@ev-br ev-br changed the title Scipy doctest 1.8 Bump scipy-doctest to 1.8 May 29, 2025
@ev-br ev-br force-pushed the scipy_doctest_1.8 branch 3 times, most recently from dea98ff to cbf3851 Compare May 29, 2025 18:22
@seberg
Copy link
Member

seberg commented May 30, 2025

Unfortunately, something about this change isn't a no-op. It seems more tests are getting picked up (and are thus failing)?

@ev-br
Copy link
Contributor Author

ev-br commented May 30, 2025

Indeed :-).

This one and its relatives look similar to #28023

__________________ [doctest] numpy.core.numeric.dtype.fields ___________________
EXAMPLE LOCATION UNKNOWN, not showing all tests of that example
??? >>> print(dt.fields)
Expected:
    {'name': (dtype('|S16'), 0), 'grades': (dtype(('float64',(2,))), 16)}
Got:
    {'name': (dtype('<U16'), 0), 'grades': (dtype(('<f8', (2,))), 64)}

Not sure if "Got" valus are "more correct", or it needs a # may vary (endianness, unicode).

This one looks genuine, too:

_________________ [doctest] numpy.lib.introspect.opt_func_info _________________
028     --------
029     Retrieve dispatch information for functions named 'add' or 'sub' and
030     data types 'float64' or 'float32':
031 
032     >>> import numpy as np
033     >>> dict = np.lib.introspect.opt_func_info(
034     ...     func_name="add|abs", signature="float64|complex64"
035     ... )
036     >>> import json
037     >>> print(json.dumps(dict, indent=2))

The whitespace is not a problem, but values do differ. Maybe it needs a # may vary (architecture) or some such.

-          "current": "FMA3__AVX2",
  +      "current": "AVX512F",

@ev-br
Copy link
Contributor Author

ev-br commented May 30, 2025

IOW, the scipy-doctest change is a noop w.r.t 1.7.1, but numpy was pinning an older version which misses some tests.

@charris charris changed the title Bump scipy-doctest to 1.8 MAINT: Bump scipy-doctest to 1.8 Jun 3, 2025
@ev-br ev-br force-pushed the scipy_doctest_1.8 branch from d45fc8a to 425a603 Compare June 4, 2025 14:53
@ev-br
Copy link
Contributor Author

ev-br commented Jun 4, 2025

Okay, the CI is green now after 425a603. I've to admit I've no idea what the dtype.fields are or should be, just copied the output into the doctests and it did the trick. Happy to apply a different fix if there's one.

@seberg
Copy link
Member

seberg commented Jun 5, 2025

Doc changes look right -- clearly not picked up in a long time -- thanks Evgeni!

@seberg seberg merged commit a88d014 into numpy:main Jun 5, 2025
74 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants