Skip to content

DEP: Deprecate np.isfortran - #32722

Merged
mattip merged 17 commits into
numpy:mainfrom
Riaz1729:deprecate_isfortran
Oct 31, 2026
Merged

mattip merged 17 commits into
numpy:mainfrom
Riaz1729:deprecate_isfortran

Conversation

@Riaz1729

@Riaz1729 Riaz1729 commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

PR summary

Deprecates numpy.isfortran as the first half of addressing #6597

  • What problem does this PR solve? Link any relevant issues and PRs.
    Per Deprecate isfortran and a.flags.fnc #6597, this marks numpy.isfortran, which checks if an array is Fortran contiguous and not C contiguous. The DeprecationWarning directs users to directly use a.flags.fnc (which is called by numpy.isfortran).

At some point in the future we may be able to also deprecate a.flags.fnc if it is used minimally.

First time contributor introduction

I'm a new contributor and part of the NumFOCUS Volunteer Sprints Fall 2026 cohort. I wanted to take a simple issue first so that I could make sure that I understand and am comfortable following the contribution guidelines before moving to more involved issues.

AI Disclosure

I used Antigravity (Gemini 3..8 Flash) to help me understand the structure of the codebase so I could find the relevant modules quickly. I also used it to review my PR and it identified several places (including in the doc module) where to add additional notes/comments about the deprecation.

@Riaz1729 Riaz1729 changed the title DEP Deprecate np.isfortran DEP: Deprecate np.isfortran Sep 21, 2026
@Riaz1729
Riaz1729 force-pushed the deprecate_isfortran branch 5 times, most recently from ba597bf to 7656382 Compare September 21, 2026 03:34
@Riaz1729
Riaz1729 marked this pull request as ready for review September 21, 2026 03:35
Comment thread numpy/_core/tests/test_deprecations.py Resolved
Comment thread numpy/_core/tests/test_deprecations.py Resolved
Comment thread numpy/_core/numeric.py Resolved
Comment thread numpy/_core/numeric.pyi Resolved
Comment thread numpy/_core/numeric.py Resolved
@ganesh-k13 ganesh-k13 added the sustain-2026 Issues reserved for NumFOCUS Sustaining Open Source Series 2026 label Sep 21, 2026
@ganesh-k13 ganesh-k13 moved this from Open to Needs Review in NF Sustaining Open Source Series 2026 Sep 21, 2026
@InessaPawson InessaPawson moved this from Needs Review to In Progress in NF Sustaining Open Source Series 2026 Sep 23, 2026
@Riaz1729
Riaz1729 requested a review from ganesh-k13 September 25, 2026 19:49
@Riaz1729

Copy link
Copy Markdown
Contributor Author

@InessaPawson

Comment thread numpy/_core/numeric.py Resolved
Comment thread numpy/_core/numeric.py Resolved
Comment thread numpy/_core/numeric.py Resolved
Comment thread numpy/_core/numeric.py Resolved
Comment thread numpy/_core/numeric.py Resolved

@InessaPawson InessaPawson left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @Riaz1729!
Once you address the remaining inline comments, it should be ready to merge.

For future PRs, rebasing onto main instead of merging keeps the timeline cleaner, but it's not an issue here since we will squash merge.

Comment thread numpy/_core/tests/test_deprecations.py Resolved
Comment thread numpy/_core/numeric.py Resolved
Comment thread numpy/_core/numeric.py Resolved
Comment thread numpy/_core/numeric.py Resolved
Comment thread numpy/_core/numeric.py Resolved
Comment thread numpy/_core/tests/test_deprecations.py Resolved
@InessaPawson
InessaPawson requested a review from mattip October 14, 2026 04:48
@mattip

mattip commented Oct 14, 2026

Copy link
Copy Markdown
Member

There are review comments waiting for responses

@InessaPawson

Copy link
Copy Markdown
Member

@Riaz1729 Thank you for applying the suggestions! There is now a merge conflict with main that needs to be resolved before we can merge. Don’t hesitate to reach out if you need help with it.

Comment thread numpy/_core/numeric.py Resolved
@aritracodesbad123

Copy link
Copy Markdown

Thanks for working on this !

It looks like the latest head (2ec8268, "resolve merge conflicts") has an indentation problem in numpy/_core/numeric.py around lines 621–622: those lines are indented 3 spaces, so the module fails to parse and import numpy errors out. CI checks also don't seem to have run on this head. Could you take a look? Thanks!

@seberg seberg added triage review Issue/PR to be discussed at the next triage meeting and removed triage review Issue/PR to be discussed at the next triage meeting labels Oct 21, 2026
Comment thread numpy/conftest.py Resolved
@ganesh-k13 ganesh-k13 moved this from In Progress to Needs Review in NF Sustaining Open Source Series 2026 Oct 28, 2026
@InessaPawson

Copy link
Copy Markdown
Member

@mattip Since a few things have changed since your last review, could you please take another look?

@InessaPawson
InessaPawson requested a review from mattip October 31, 2026 07:00
@mattip
mattip merged commit f2821ff into numpy:main Oct 31, 2026
93 checks passed
@github-project-automation github-project-automation Bot moved this from Needs Review to Complete in NF Sustaining Open Source Series 2026 Oct 31, 2026
@mattip

mattip commented Oct 31, 2026

Copy link
Copy Markdown
Member

Thanks @Riaz1729

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

07 - Deprecation sustain-2026 Issues reserved for NumFOCUS Sustaining Open Source Series 2026

Projects

Development

Successfully merging this pull request may close these issues.

6 participants