Repository navigation
Conversation
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Integer-valued atom properties such as
resnumraise a NumPy output-casting error in selections likeresnum - 0.5 > 1orresnum / 2 > 1. The binary-operation evaluator writes the result into its integer left-hand array, which cannot hold the floating-point result.Keep the existing in-place operation when it succeeds, and retry without an output array when NumPy raises
TypeError. This permits NumPy's normal dtype promotion while preserving integer arithmetic and the existing in-place path. Add regression coverage for arithmetic operators, scalar and array operands, chained expressions, precedence, unchanged atom data, and integer precision above2**53.Refs #2142. This addresses the arithmetic casting error; the separate negative-residue selection concern in that issue is outside this change.
Validation on Windows 11, Python 3.12.12, NumPy 2.5.4, SciPy 1.18.1, pyparsing 3.1.1, and Biopython 1.88:
python -m pytest prody/tests/atomic/test_select.py -p no:cacheprovider -q -k 'ArithmeticPromotion or IntegerArithmeticPrecision': 2 passed, 16 subtests passed. Before the fix, 10 arithmetic subcases failed with NumPy output-casting errors.python -m pytest prody/tests/atomic/test_atomic.py prody/tests/atomic/test_subset.py -p no:cacheprovider -q: 10 passed.search_center_radius. Native ProDy extensions could not be built locally because the Microsoft C++ compiler is unavailable.git diff --check: passed.