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

fix: adapt to numpy 2.0 #216

Merged
merged 1 commit into from
Jun 17, 2024
Merged

fix: adapt to numpy 2.0 #216

merged 1 commit into from
Jun 17, 2024

Conversation

jokasimr
Copy link
Contributor

Fixes #215

@jokasimr jokasimr requested a review from nvaytet June 17, 2024 09:44
@@ -93,8 +93,7 @@ def test_nxobject_entry(nxroot):

def test_nx_class_can_be_bytes(h5root):
log = h5root.create_group('log')
attr = np.chararray((), itemsize=5)
attr[()] = b'NXlog'
attr = np.array(b'NXlog', dtype='|S5')
Copy link
Member

Choose a reason for hiding this comment

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

I can't find | in the docs. What does it mean?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Apparently it means "byte order not applicable". I didn't know either.

I put that dtype there because that was the dtype of the array that was there before:

np.chararray((), itemsize=5)
# chararray(b'...', dtype='|S5')

Copy link
Member

Choose a reason for hiding this comment

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

I see. Because it's bytes, not a string.

@jokasimr jokasimr merged commit 901876d into main Jun 17, 2024
3 checks passed
@jokasimr jokasimr deleted the fix-numpy20 branch June 17, 2024 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NumPy 2.0
2 participants