Repository navigation
Conversation
np.float -> float (removed in NumPy 1.24) np.row_stack -> np.vstack (removed in NumPy 2.0) Each of these raises rather than warning, so execution stops at the first one on a current environment. The replacements are exact equivalents - no behavioural or numerical change. Touches 2 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 hits a few names that NumPy and the stdlib have since removed. Each one raises rather than warning, so execution stops at the first one.
What breaks
cords/utils/data/datasets/SL/builder.py:469np.row_stackcords/utils/data/datasets/SL/builder.py:470np.row_stackcords/utils/data/datasets/SL/builder.py:476np.row_stackcords/utils/data/datasets/SL/builder.py:477np.row_stackcords/utils/data/datasets/SL/builder.py:480np.row_stackcords/utils/data/datasets/SL/builder.py:481np.row_stackcords/utils/data/datasets/SL/builder.py:487np.row_stackcords/utils/data/datasets/SL/builder.py:488np.row_stackcords/utils/data/datasets/SL/builder.py:491np.row_stackcords/utils/data/datasets/SL/builder.py:492np.row_stackcords/utils/data/datasets/SSL/augmentation/augmentation_pool.py:256np.floatHow I checked
I executed each of these expressions against NumPy 2.x to confirm it genuinely raises (rather than assuming from the name), and confirmed the replacement returns the same value. I didn't run the full pipeline here — package import blocked by
asyncore(removed in Python 3.12) - a separate issue, flagged in the PR body but not fixed here — so I've kept the change strictly to these substitutions.What this PR changes
np.floatfloatnp.floatwas the builtinfloatnp.row_stacknp.vstackrow_stackwas always an alias forvstackNo behavioural or numerical change — these are exact substitutions. Every touched file still compiles.
Separately, and not touched by this PR: on Python 3.12 the package currently fails to import earlier than this, with
ModuleNotFoundError: No module named 'asyncore'(asyncorewas removed in 3.12). That's a different problem and deserves its own change — happy to open a second PR for it if it'd be useful.Happy to rework this if you'd rather pin NumPy below 2 instead, or if you'd prefer it split up differently.