Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MAINT: shims for array copy semantics (#4482)
* MAINT: shims for array copy semantics * Fixes #4481 * this gets rid of segfaults/many test failurse against latest NumPy `main` while still passing the full suite against NumPy `1.26.4`; it is pretty hard to test since needs special branch of SciPy (for the same reason, upstream hasn't fully resolved copy semantics) * I still see 2-3 test failures against `main` locally, but likely still a large improvement; may want to let this sit a little bit while the upstream storm settles, but I suspect this is the gist of the shims we'd want * MAINT: PR 4482 revisions * abstract the array copy semantics (NumPy 1.x vs. 2.x) handling to a utility function to reduce code duplication * add a missing `dtype=None` to an `__array__` signature, for more formal correctness with NumPy 2.x * MAINT: PR 4482 revisions * Update `vector_of_best_fit()` function in the helix analysis code to avoid use of `np.linalg.linalg` namespace, which is deprecated/private in NumPy `2.x`. Instead, just access `svd` via the public `np.linalg` namespace. * This fixes the last two remaining test failures for MDAnalysis against NumPy `2.0.0rc1`. * Switch the array `copy` shim to use the more appropriate `NumpyVersion` rather than a raw string check for version `2`.
- Loading branch information
1 parent
73acc9b
commit e8637a9
Showing
4 changed files
with
20 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters