Skip to content

Numpy 2.3 fix (tostring -> tobytes)#793

Merged
ijpulidos merged 2 commits into
choderalab:mainfrom
IAlibay:numpy-2.3-fix
Sep 29, 2025
Merged

Numpy 2.3 fix (tostring -> tobytes)#793
ijpulidos merged 2 commits into
choderalab:mainfrom
IAlibay:numpy-2.3-fix

Conversation

@IAlibay

@IAlibay IAlibay commented Sep 29, 2025

Copy link
Copy Markdown
Contributor

Description

I think this is all we need to do, the old numpy test case was:

    def test_tostring_matches_tobytes(self):
        arr = np.array(list(b"test\xFF"), dtype=np.uint8)
        b = arr.tobytes()
        with assert_warns(DeprecationWarning):
            s = arr.tostring()
        assert s == b

Todos

  • Implement feature / fix bug
  • Add tests
  • Update documentation as needed
  • Update changelog to summarize changes in behavior, enhancements, and bugfixes implemented in this PR

Status

  • Ready to go

Changelog message

Switch deprecated `tostring` numpy calls to `tobytes`.

@codecov

codecov Bot commented Sep 29, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.28%. Comparing base (271f0b0) to head (496506f).
⚠️ Report is 3 commits behind head on main.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ijpulidos ijpulidos self-requested a review September 29, 2025 13:32

@ijpulidos ijpulidos left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for catching this. LGTM!

@ijpulidos ijpulidos merged commit 35f754e into choderalab:main Sep 29, 2025
16 checks passed
@IAlibay IAlibay deleted the numpy-2.3-fix branch September 29, 2025 14: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.

2 participants