Skip to content

add tobytes to support numpy>=2.3.0 #150

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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

chrishavlin
Copy link

Close #149

Went through and added a tobytes option wherever tostring was being used to support numpy >= 2.3.0, which removed the deprecated tostring method for arrays.

Let me know if this needs any additional tests.

@ChrisBarker-NOAA
Copy link

numpy has had tobytes for a long time -- I think we can simply replace tostring with tobytes, rather than checking for existence.

certainly numpy 2 has always had it.

Also -- I think you want to do PRs against the develop branch -- master is pretty old.

@chrishavlin chrishavlin changed the base branch from master to develop June 23, 2025 14:06
@chrishavlin
Copy link
Author

thanks, changed the PR target branch!

And yeah, tobytes has been around a long time. But I don't know the pyopengl codebase well and it wasn't obvious to me what ranges in numpy and Python are targeted for support. I'll go ahead and update it.

@chrishavlin chrishavlin force-pushed the add_tobytes_for_np_arrays branch from b8099e3 to 928acff Compare June 23, 2025 19:47
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.

with numpy 2.3.0, GL.glGetActiveUniform returns a numpy array
2 participants