Skip to content

DEP: deprecate chararray#30605

Merged
mattip merged 8 commits intonumpy:mainfrom
jorenham:deprecate-chararray
Jan 26, 2026
Merged

DEP: deprecate chararray#30605
mattip merged 8 commits intonumpy:mainfrom
jorenham:deprecate-chararray

Conversation

@jorenham
Copy link
Copy Markdown
Member

@jorenham jorenham commented Jan 7, 2026

This follows #30604

@jorenham
Copy link
Copy Markdown
Member Author

jorenham commented Jan 7, 2026

Huh, where did the np.str_ and np.bytes_ sphinx warnings come from?

/home/circleci/repo/build-install/usr/lib/python3.12/site-packages/numpy/strings/__init__.py:docstring of numpy.strings.find:13: WARNING: py:obj reference target not found: np.bytes_
/home/circleci/repo/build-install/usr/lib/python3.12/site-packages/numpy/strings/__init__.py:docstring of numpy.strings.find:13: WARNING: py:obj reference target not found: np.str_
/home/circleci/repo/build-install/usr/lib/python3.12/site-packages/numpy/strings/__init__.py:docstring of numpy.strings.mod:10: WARNING: py:obj reference target not found: np.bytes_
/home/circleci/repo/build-install/usr/lib/python3.12/site-packages/numpy/strings/__init__.py:docstring of numpy.strings.mod:10: WARNING: py:obj reference target not found: np.str_
/home/circleci/repo/build-install/usr/lib/python3.12/site-packages/numpy/char/__init__.py:docstring of numpy.char.multiply:11: WARNING: py:obj reference target not found: np.bytes_
/home/circleci/repo/build-install/usr/lib/python3.12/site-packages/numpy/char/__init__.py:docstring of numpy.char.multiply:11: WARNING: py:obj reference target not found: np.str_
/home/circleci/repo/build-install/usr/lib/python3.12/site-packages/numpy/strings/__init__.py:docstring of numpy.strings.rindex:9: WARNING: py:obj reference target not found: np.bytes_
/home/circleci/repo/build-install/usr/lib/python3.12/site-packages/numpy/strings/__init__.py:docstring of numpy.strings.rindex:9: WARNING: py:obj reference target not found: np.str_
/home/circleci/repo/build-install/usr/lib/python3.12/site-packages/numpy/strings/__init__.py:docstring of numpy.strings.rindex:12: WARNING: py:obj reference target not found: np.bytes_
/home/circleci/repo/build-install/usr/lib/python3.12/site-packages/numpy/strings/__init__.py:docstring of numpy.strings.rindex:12: WARNING: py:obj reference target not found: np.str_
/home/circleci/repo/build-install/usr/lib/python3.12/site-packages/numpy/strings/__init__.py:docstring of numpy.strings.translate:12: WARNING: py:obj reference target not found: np.bytes_
/home/circleci/repo/build-install/usr/lib/python3.12/site-packages/numpy/strings/__init__.py:docstring of numpy.strings.translate:12: WARNING: py:obj reference target not found: np.str_

@jorenham

This comment was marked as resolved.

@jorenham jorenham force-pushed the deprecate-chararray branch from c0f91ec to 62d9af0 Compare January 8, 2026 12:06
@seberg
Copy link
Copy Markdown
Member

seberg commented Jan 8, 2026

In general, I would like this, a quick search for https://github.com/search?q=np.char.chararray+language%3APython&type=code does not seem to find much, backing that up.

There are a couple of (probably ancient projects) using it, but very few. Note that I think the two most prominent hits (astropy/some molecular thing) don't seem to actually use it, I think. They just use np.char.charray.<name> when np.char.<name> should do the same thing.

@ngoldbaum

This comment was marked as resolved.

@jorenham

This comment was marked as outdated.

@ngoldbaum

This comment was marked as outdated.

@jorenham jorenham force-pushed the deprecate-chararray branch from 0a3f01f to 9b9a167 Compare January 14, 2026 13:26
@jorenham
Copy link
Copy Markdown
Member Author

jorenham commented Jan 14, 2026

Yea... still no idea what's causing those sphinx warnings. Rerouting the __dir__ didn't seem to have helped:

/home/circleci/repo/build-install/usr/lib/python3.12/site-packages/numpy/strings/__init__.py:docstring of numpy.strings.find:13: WARNING: py:obj reference target not found: np.bytes_
/home/circleci/repo/build-install/usr/lib/python3.12/site-packages/numpy/strings/__init__.py:docstring of numpy.strings.find:13: WARNING: py:obj reference target not found: np.str_
/home/circleci/repo/build-install/usr/lib/python3.12/site-packages/numpy/strings/__init__.py:docstring of numpy.strings.mod:10: WARNING: py:obj reference target not found: np.bytes_
/home/circleci/repo/build-install/usr/lib/python3.12/site-packages/numpy/strings/__init__.py:docstring of numpy.strings.mod:10: WARNING: py:obj reference target not found: np.str_
/home/circleci/repo/build-install/usr/lib/python3.12/site-packages/numpy/char/__init__.py:docstring of numpy.char.multiply:11: WARNING: py:obj reference target not found: np.bytes_
/home/circleci/repo/build-install/usr/lib/python3.12/site-packages/numpy/char/__init__.py:docstring of numpy.char.multiply:11: WARNING: py:obj reference target not found: np.str_
/home/circleci/repo/build-install/usr/lib/python3.12/site-packages/numpy/strings/__init__.py:docstring of numpy.strings.rindex:9: WARNING: py:obj reference target not found: np.bytes_
/home/circleci/repo/build-install/usr/lib/python3.12/site-packages/numpy/strings/__init__.py:docstring of numpy.strings.rindex:9: WARNING: py:obj reference target not found: np.str_
/home/circleci/repo/build-install/usr/lib/python3.12/site-packages/numpy/strings/__init__.py:docstring of numpy.strings.rindex:12: WARNING: py:obj reference target not found: np.bytes_
/home/circleci/repo/build-install/usr/lib/python3.12/site-packages/numpy/strings/__init__.py:docstring of numpy.strings.rindex:12: WARNING: py:obj reference target not found: np.str_
/home/circleci/repo/build-install/usr/lib/python3.12/site-packages/numpy/strings/__init__.py:docstring of numpy.strings.translate:12: WARNING: py:obj reference target not found: np.bytes_
/home/circleci/repo/build-install/usr/lib/python3.12/site-packages/numpy/strings/__init__.py:docstring of numpy.strings.translate:12: WARNING: py:obj reference target not found: np.str_

EDIT:
As a workaround I've changed the relevant docstrings to avoid those references to np.str_ and np.bytes_.
I still don't know what about these changes causes those warnings to pop up all of a sudden though...

@ngoldbaum
Copy link
Copy Markdown
Member

I still don't know what about these changes causes those warnings to pop up all of a sudden though...

Unfortunately this is sufficiently complicated that you might need to put breakpoints in the sphinx implementation to understand what's happening. I've needed to do that a few times in the past.

@mattip
Copy link
Copy Markdown
Member

mattip commented Jan 26, 2026

Let's see how noisy this is downstream.

@mattip mattip merged commit bc919a4 into numpy:main Jan 26, 2026
77 checks passed
@mattip
Copy link
Copy Markdown
Member

mattip commented Jan 26, 2026

Thanks @jorenham

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.

4 participants