Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixups for Numpy 2 compatibility #377

Merged
merged 1 commit into from
Jun 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions pywwt/layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
NP_STR_TYPE = np.string_
else:
STR_TYPE = str
NP_STR_TYPE = np.unicode_
NP_STR_TYPE = np.str_

# The following are columns that we add dynamically and internally, so we need
# to make sure they have unique names that won't clash with existing columns
Expand Down Expand Up @@ -302,11 +302,14 @@ def add_image_layer(
# has previously been processed. As usual, the logic is a bit
# complicated since we aim to allow the user to give us just about
# anything as an input.
if any(isinstance(image, fitsy_type) for fitsy_type in [
astropy.io.fits.HDUList,
astropy.io.fits.ImageHDU,
astropy.io.fits.PrimaryHDU
]):
if any(
isinstance(image, fitsy_type)
for fitsy_type in [
astropy.io.fits.HDUList,
astropy.io.fits.ImageHDU,
astropy.io.fits.PrimaryHDU,
]
):
image = self._write_image_for_toasty(image, hdu_index=hdu_index)

if isinstance(image, str):
Expand Down