Replace np.float with float across 3 files (removed in NumPy 1.24) - #5
Open
Azimml wants to merge 1 commit into
Open
Replace np.float with float across 3 files (removed in NumPy 1.24)#5Azimml wants to merge 1 commit into
Azimml wants to merge 1 commit into
Conversation
np.float -> float (removed in NumPy 1.24) These raise rather than warn, so they stop execution on a current environment. The replacements are exact equivalents - no behavioural or numerical change. Touches 3 file(s); all still compile.
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.
Thanks for putting this code out — I've been reading through it.
On a current environment (Python 3.12, NumPy 2.x) it uses a few names that NumPy and the stdlib have since removed. These raise rather than warn, so execution stops at the first one reached.
What breaks
evaluate_bvqa_features_binary_classification.py:181np.floatevaluate_bvqa_features_binary_classification.py:187np.floatevaluate_bvqa_features_binary_classification.py:193np.floatevaluate_bvqa_features_binary_classification.py:199np.floatevaluate_bvqa_features_binary_classification.py:215np.floatevaluate_bvqa_features_binary_classification.py:257np.floatevaluate_bvqa_features_ordinal_classification.py:195np.floatevaluate_bvqa_features_ordinal_classification.py:200np.floatevaluate_bvqa_features_ordinal_classification.py:205np.floatevaluate_bvqa_features_ordinal_classification.py:225np.floatevaluate_bvqa_features_ordinal_classification.py:267np.floatevaluate_bvqa_features_regression.py:194np.floatevaluate_bvqa_features_regression.py:196np.floatevaluate_bvqa_features_regression.py:238np.floatHow I checked
I executed each of these expressions directly against NumPy 2.x to confirm it genuinely raises rather than assuming from the name, and confirmed the replacement returns the same value.
Every file this touches still compiles (
py_compile).What this PR changes
np.floatfloatnp.floatwas the builtinfloatThese are exact substitutions — no behavioural or numerical change. Only the lines listed above are touched.
Happy to rework this if you'd rather pin NumPy below 2, or if you'd prefer it split differently.