-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
fix: added save and read functionality in SSD issue #13328 #13589
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
for more information, see https://pre-commit.ci
|
@larsoner @mscheltienne Kindly review this PR and let me know if any changes are required |
…/mne-python into fix-ssd-save-load merge branches .
|
I'm happy to look over this @larsoner |
|
@Anushreebasics Thanks for opening the PR. It would be good to set some explicit Additionally, we should really also add this save/load behaviour to Please have a think about adding |
for more information, see https://pre-commit.ci
|
@tsbinns please review the changes |
tsbinns
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes @Anushreebasics. A couple comments and suggestions here.
Also, make sure you add any new functions to the __init__.pyi file, otherwise they can't be imported. This also means that the test which has been added can't run at the moment. Please have a go at running any tests you are adding/changing locally first, that way you'll have a much clearer idea of how the changes are (mis)behaving.
You can find info about running the tests in the contribution guide (here and here). Feel free to ask if you have questions about getting this running.
Merge branch 'fix-ssd-save-load' of https://github.com/Anushreebasics/mne-python into fix-ssd-save-load
|
@tsbinns please review the changes |
|
@Anushreebasics I can't see any changes apart from merging the main branch. Please check that you have pushed the commits with changes. |
for more information, see https://pre-commit.ci
|
@tsbinns sorry it was not pushed, please review |
|
@drammock Please may I get your input on how For Should we go for a similar behaviour to If we go for the former, I'm just wondering if users mistakenly pass a dict to |
issue #13328
Summary
This PR fixes the SSD serialization logic so that objects saved with SSD.save() can be fully restored using SSD.read() without losing internal state.
Previously, some fitted attributes required to reconstruct a trained SSD instance were not persisted, which caused test_ssd_save_load to fail during deserialization.
What was changed?
Refactored the SSD.save() method to persist all fitted attributes required to restore a trained instance.
Updated the corresponding SSD.read() logic to correctly re-initialize these attributes when loading from disk.
Ensured that save/load performs a true round-trip and yields an SSD instance equivalent to the original fitted object.