Repository navigation
Add test for SRM save/load - #1
Merged
Merged
Conversation
mihaic
suggested changes
Oct 13, 2020
| print("Test: different number of samples per subject") | ||
|
|
||
| # Check save/load functionality for fitted SRM | ||
| srm_fn = tmp_path |
There was a problem hiding this comment.
You also need to add tmp_path as an argument to the function:
def test_can_instantiate(tmp_path):
Also, tmp_path is a directory, so you need a path to a file within, for example:
srm_fn = tmp_path / "srm.npz"
Finally, I usually read fn as function. How about srm_path?
Author
There was a problem hiding this comment.
Okay, sounds good—I think I got all that fixed up
Owner
|
merged |
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.
I made a few minor adjustments to the wording and variable names in the save/load functions. I also added a simple test to
test_srm.pythat saves a fitted SRM object totmp_pathand reloads it and verifies the attributes against the original. Can someone check that I'm usingtmp_pathproperly? As far as I understand, thissaveimplementation is limited tobrainiak.funcalign.srm.SRM—but it would be nice to extend this to the other SRM implementations. Might require a more flexible way to aggregate the variable attributes of different SRM implementations.