Skip to content

Conversation

@stes
Copy link
Member

@stes stes commented Feb 1, 2026

This PR

  • Adds a test pipeline for numpy < 2. We want to support numpy<2 for ~ 1 extra year (discussed with @MMathisLab today), given its widespread use in other packages used together with CEBRA.
  • Fixes a critical bug in the test_save_and_load which was skipped entirely previously due to a syntax issue. This revealed several issues in the loading logic
  • As a result, the backend logic of CEBRA.load was improved: Instead of using three different backend choices, we now default to the (future proof) sklearn backend: The state dict of the model is saved, and the model is always constructed from the state dict. This follows the recent change in torch (from 2.6.0) to discontinue unsafe loads via pickle.
  • Fixes an issue with model loading in python 3.14 by improving the cebra/registry.py module. When the @parameterize decorator is used, the class attributes are now properly passed to the wrapped class. A test has been added for this functionality
  • The testing logic was broken on windows; a windows-compatible decorator for handling temp files was introduced.

@cla-bot cla-bot bot added the CLA signed label Feb 1, 2026
@stes
Copy link
Member Author

stes commented Feb 1, 2026

Just checked https://endoflife.date/numpy, it seems that <2 support actually ended a few months ago:

image

So I guess we could also ignore that particular test and force numpy > 2...

@stes
Copy link
Member Author

stes commented Feb 1, 2026

Although e.g. Deeplabcut still has <2 requirement https://github.com/DeepLabCut/DeepLabCut/blob/85911cb83d315398ead65c1198e4991a73001834/setup.py#L68

@stes
Copy link
Member Author

stes commented Feb 1, 2026

colab has 2.0.2

image

@stes stes changed the title Fix model loading in numpy<2 Improve robustness of cebra model loading Feb 1, 2026
@stes stes mentioned this pull request Feb 1, 2026
@stes stes marked this pull request as ready for review February 1, 2026 15:05
@stes stes self-assigned this Feb 1, 2026
@stes stes requested a review from MMathisLab February 1, 2026 15:05
Copy link
Member

@MMathisLab MMathisLab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@MMathisLab MMathisLab merged commit ba3812f into main Feb 2, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants