Skip to content

Replace np.float with float across 3 files (removed in NumPy 1.24) - #5

Open
Azimml wants to merge 1 commit into
vztu:mainfrom
Azimml:fix/numpy2-removed-aliases
Open

Replace np.float with float across 3 files (removed in NumPy 1.24)#5
Azimml wants to merge 1 commit into
vztu:mainfrom
Azimml:fix/numpy2-removed-aliases

Conversation

@Azimml

@Azimml Azimml commented Aug 23, 2026

Copy link
Copy Markdown

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

Location Symbol Removed in
evaluate_bvqa_features_binary_classification.py:181 np.float NumPy 1.24
evaluate_bvqa_features_binary_classification.py:187 np.float NumPy 1.24
evaluate_bvqa_features_binary_classification.py:193 np.float NumPy 1.24
evaluate_bvqa_features_binary_classification.py:199 np.float NumPy 1.24
evaluate_bvqa_features_binary_classification.py:215 np.float NumPy 1.24
evaluate_bvqa_features_binary_classification.py:257 np.float NumPy 1.24
evaluate_bvqa_features_ordinal_classification.py:195 np.float NumPy 1.24
evaluate_bvqa_features_ordinal_classification.py:200 np.float NumPy 1.24
evaluate_bvqa_features_ordinal_classification.py:205 np.float NumPy 1.24
evaluate_bvqa_features_ordinal_classification.py:225 np.float NumPy 1.24
evaluate_bvqa_features_ordinal_classification.py:267 np.float NumPy 1.24
evaluate_bvqa_features_regression.py:194 np.float NumPy 1.24
evaluate_bvqa_features_regression.py:196 np.float NumPy 1.24
evaluate_bvqa_features_regression.py:238 np.float NumPy 1.24

How 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

Old New Why it's equivalent
np.float float np.float was the builtin float

These 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.

  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.
@Azimml Azimml changed the title Fix NumPy 2.x / Python 3.12 incompatibilities Replace np.float with float across 3 files (removed in NumPy 1.24) Aug 23, 2026
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.

1 participant