Skip to content

BUG: fix compatibility with numpy 2 in diff reports (io.fits, utils) - #16426

Merged
mhvk merged 2 commits into
astropy:mainfrom
neutrinoceros:io.fits/compat/16423/numpy2_diff_reports
May 13, 2024
Merged

mhvk merged 2 commits into
astropy:mainfrom
neutrinoceros:io.fits/compat/16423/numpy2_diff_reports

Conversation

@neutrinoceros

Copy link
Copy Markdown
Contributor

Description

This pull request is to address part of #16423 (specifically, failing tests from io.fits)

  • By checking this box, the PR author has requested that maintainers do NOT use the "Squash and Merge" button. Maintainers should respect this when possible; however, the final decision is at the discretion of the maintainer that merges the PR.

@github-actions

github-actions Bot commented May 9, 2024

Copy link
Copy Markdown
Contributor

Thank you for your contribution to Astropy! 🌌 This checklist is meant to remind the package maintainers who will review this pull request of some common things to look for.

  • Do the proposed changes actually accomplish desired goals?
  • Do the proposed changes follow the Astropy coding guidelines?
  • Are tests added/updated as required? If so, do they follow the Astropy testing guidelines?
  • Are docs added/updated as required? If so, do they follow the Astropy documentation guidelines?
  • Is rebase and/or squash necessary? If so, please provide the author with appropriate instructions. Also see instructions for rebase and squash.
  • Did the CI pass? If no, are the failures related? If you need to run daily and weekly cron jobs as part of the PR, please apply the "Extra CI" label. Codestyle issues can be fixed by the bot.
  • Is a change log needed? If yes, did the change log check pass? If no, add the "no-changelog-entry-needed" label. If this is a manual backport, use the "skip-changelog-checks" label unless special changelog handling is necessary.
  • Is this a big PR that makes a "What's new?" entry worthwhile and if so, is (1) a "what's new" entry included in this PR and (2) the "whatsnew-needed" label applied?
  • At the time of adding the milestone, if the milestone set requires a backport to release branch(es), apply the appropriate "backport-X.Y.x" label(s) before merge.

@github-actions

github-actions Bot commented May 9, 2024

Copy link
Copy Markdown
Contributor

👋 Thank you for your draft pull request! Do you know that you can use [ci skip] or [skip ci] in your commit messages to skip running continuous integration tests until you are ready?

@neutrinoceros
neutrinoceros force-pushed the io.fits/compat/16423/numpy2_diff_reports branch 2 times, most recently from 6091d21 to 43d79e5 Compare May 9, 2024 16:50
@neutrinoceros
neutrinoceros marked this pull request as ready for review May 9, 2024 17:08
@pllim pllim added this to the v7.0.0 milestone May 9, 2024
@pllim pllim added the numpy-dev label May 9, 2024
@pllim

pllim commented May 9, 2024

Copy link
Copy Markdown
Member

Should this be backported?

@neutrinoceros

Copy link
Copy Markdown
Contributor Author

Yes

@pllim pllim modified the milestones: v7.0.0, v6.1.1 May 9, 2024

@pllim pllim 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.

utils LGTM. @saimn should double check io.fits. Thanks!

@pllim pllim modified the milestone: v6.1.1 May 9, 2024
@neutrinoceros
neutrinoceros force-pushed the io.fits/compat/16423/numpy2_diff_reports branch from 43d79e5 to ad712d7 Compare May 12, 2024 08:22
Comment thread astropy/io/fits/diff.py
Comment on lines +1115 to +1116
# Convert to int to avoid np.int64 in list repr.
index = [int(x + 1) for x in reversed(index)]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this bit is cherry-picked from #15065

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.

In that case, I pinged mhvk for review. Thanks!

@neutrinoceros
neutrinoceros force-pushed the io.fits/compat/16423/numpy2_diff_reports branch from ad712d7 to 07c8cb7 Compare May 12, 2024 09:27
@neutrinoceros

Copy link
Copy Markdown
Contributor Author

@pllim I went back to this and replaced my patches with simpler solutions cherry-picked from #15065

@mhvk mhvk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good!

@mhvk

mhvk commented May 13, 2024

Copy link
Copy Markdown
Contributor

Ah, I see it is smart enough to recognize that the first commit is already in main and is not a problem. So, let's merge this one too.

@mhvk
mhvk merged commit 566fcbd into astropy:main May 13, 2024
meeseeksmachine pushed a commit to meeseeksmachine/astropy that referenced this pull request May 13, 2024
pllim added a commit that referenced this pull request May 13, 2024
…426-on-v6.1.x

Backport PR #16426 on branch v6.1.x (BUG: fix compatibility with numpy 2 in diff reports (io.fits, utils))
@neutrinoceros
neutrinoceros deleted the io.fits/compat/16423/numpy2_diff_reports branch May 13, 2024 20:44
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