Skip to content

RFC: Replace np.char.decode with np.strings.decode - #19227

Merged
mhvk merged 1 commit into
astropy:mainfrom
pllim:np-strings
Jan 27, 2026
Merged

mhvk merged 1 commit into
astropy:mainfrom
pllim:np-strings

Conversation

@pllim

@pllim pllim commented Jan 27, 2026

Copy link
Copy Markdown
Member

Description

This pull request is to address #19218 (comment) . Should backport to make future backports easier.

  • 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.

@pllim pllim added this to the v7.2.1 milestone Jan 27, 2026
@pllim pllim added Affects-dev PRs and issues that do not impact an existing Astropy release no-changelog-entry-needed numpy-dev backport-v7.2.x on-merge: backport to v7.2.x labels Jan 27, 2026
@github-actions

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.

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

Thanks @pllim !

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

Yes, thanks! Merging...

@mhvk
mhvk merged commit 9805d6b into astropy:main Jan 27, 2026
44 checks passed
meeseeksmachine pushed a commit to meeseeksmachine/astropy that referenced this pull request Jan 27, 2026
haozeng-naoc pushed a commit to haozeng-naoc/astropy that referenced this pull request Jan 28, 2026
Following up on PR astropy#19227 which replaced np.char.decode with np.strings.decode,
this commit completes the migration from the deprecated np.char module to
np.strings for NumPy 2.0+ compatibility.

Changes:
- Replace np.char.encode with np.strings.encode in:
  - astropy/io/fits/util.py
  - astropy/io/fits/hdu/table.py
  - astropy/table/table.py
  - astropy/table/column.py

- Replace np.char.str_len with np.strings.str_len in:
  - astropy/table/column.py

- Replace np.char.ljust, np.char.replace, np.char.strip with np.strings
  equivalents in:
  - astropy/io/fits/fitsrec.py

- Remove usage of deprecated np.char.array by using direct view() with
  string dtype in:
  - astropy/io/fits/fitsrec.py

- Update related comments to reference np.strings instead of np.char

https://claude.ai/code/session_01FDZNwQPvM73vY8S4V445MK
@neutrinoceros neutrinoceros removed the backport-v7.2.x on-merge: backport to v7.2.x label Jan 28, 2026
@neutrinoceros neutrinoceros modified the milestones: v7.2.1, v8.0.0 Jan 28, 2026
@pllim
pllim deleted the np-strings branch January 28, 2026 15:40
@pllim

pllim commented Jan 28, 2026

Copy link
Copy Markdown
Member Author

Thanks for cleaning up the labels and milestone! Thanks, all!

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

Labels

Affects-dev PRs and issues that do not impact an existing Astropy release io.fits no-changelog-entry-needed numpy-dev Refactoring table

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants