astropy + numpy-dev = numpy.char.chararray is deprecated (DeprecationWarning)

17 views
Skip to first unread message

Pey Lian Lim

unread,
Feb 3, 2026, 11:20:11 AMFeb 3
to astropy-dev
To whom it may concern,

You might be affected if you:
  • Maintain a Python package that uses both numpy and astropy
  • Have CI running a job pulling in numpy-dev (unreleased numpy "nightly" wheel or, gasp, you build numpy from source)
  • Turn unhandled warnings into errors in your tests (or just happen to diligently read the logs regardless)
You will see the following warning stemming from astropy.io.fits module:

DeprecationWarning: The chararray class is deprecated and will be removed in a future release. Use an ndarray with a string or bytes dtype instead.

We are aware of this and working towards a solution, but currently there is no ETA. So for now, please ignore the warning in your test suite.

Related issues/PRs:
We apologize for any inconvenience caused.

Pey Lian Lim

unread,
Feb 20, 2026, 8:54:12 AM (5 days ago) Feb 20
to astropy-dev
We are about to merge https://github.com/astropy/astropy/pull/19267 . This would trigger DeprecationWarning about chararray but this time from within astropy.io.fits . What you should do a day after this PR is merged (when the nightly wheel with this change hits the Internet):

* If you have ignored DeprecationWarning from chararray in devdeps testing, you should remove it.
* If you still see a DeprecationWarning, then it is probably something you need to do to your code to make it go away. The message of this new warning, despite same category, would be different from the one from numpy.

Hope this is not too confusing. Please reach out if you have concerns or questions. Thanks for your patience!

Pey Lian Lim

unread,
Feb 20, 2026, 3:36:22 PM (4 days ago) Feb 20
to astropy-dev
The PR is merged and a new dev wheel is just uploaded.
Reply all
Reply to author
Forward
0 new messages