Repository navigation
[BUG] Fix random seed consistency - #43
Conversation
|
Huh, I guess one of the tests passes |
|
Did you use git clone https://github.com/sappelhoff/pyprep
cd pyprep
pip install -r requirements-dev.txt
pre-commit install
pip install -e .as described in https://github.com/sappelhoff/pyprep#installation ? |
a proper check would be much nicer if it provides a reasonable error |
|
The general idea looks good to me 🤔 I'll let @yjmantilla chime in before merging. @a-hurst thanks for your first PR to pyprep 🎉 can you please also add a changelog entry and add yourself to the list of authors? (including an RST link to a page that you want users to find if they click on your name) |
There was a problem hiding this comment.
The only thing that bugs me is that (I think) we can remove the n_pred_chns parameter in:
- self.ransac_correlations()
- self.self.run_ransac()
- self.get_ransac_pred()
I mean one passes it to the other until get_ransac_pred just trashes it.
So I guess that for staying on the good programming practices we should remove it from the code and the functions documentations.
What do you think?
Now regarding the pytest stuff, Im looking at it to see what went wrong. A configuration issue?
|
Good catch @yjmantilla, just implemented the suggestion! As for the tests, I'm wondering if it's just a fluke or whether I've somehow broken, hopefully the new push will let us know what's what. If it continues, we can add the |
sappelhoff
left a comment
There was a problem hiding this comment.
I think the test failures may be due to GitHub Actions capping the amount of RAM we are allowed to use 🤔
are the tests passing locally for you?
|
lol so I figured out the CI issue: because we're now pre-generating random channel picks for each sample, and we're testing the memory error exception by asking it to do 10^100 samples, it gets stuck generating a list of billions upon billions of picks and the process eventually gets killed due to RAM consumption. I've fixed the issue by adding another RAM check prior to the channel picks so that we don't generate random samples for impossibly-high sample counts. To avoid reduplicating code and clean things up a bit, I moved the RAM check stuff to its own separate function, also implementing the max ram proportion from the other PR while I'm at it. Hopefully everything should work now! |
Codecov Report
@@ Coverage Diff @@
## master #43 +/- ##
==========================================
- Coverage 97.08% 96.36% -0.73%
==========================================
Files 5 5
Lines 515 523 +8
==========================================
+ Hits 500 504 +4
- Misses 15 19 +4
Continue to review full report at Codecov.
|
sappelhoff
left a comment
There was a problem hiding this comment.
Haha, okay good that you caught it. Can you now rebase this PR on master and resolve the merge conflicts, please?
I also added one more comment for the changelog. Other than that, I think this PR is good to be merged as well.
|
Ah, whoops, messed the rebase process up. Let me try again. |
2ec6974 to
59da611
Compare
|
@sappelhoff Okay, everything should be good to go now! I also fixed some warnings I was getting from sphinxdoc when testing the changes I made to all the docstrings. |
sappelhoff
left a comment
There was a problem hiding this comment.
Glad the rebase worked out at the second try :)
some minor nitpicks, then we are good to go!
|
@sappelhoff Okay, hopefully that does it! |
|
Thanks a lot @a-hurst! |
PR Description
This PR is meant to fix the secondary issue discovered in issue #41: that is, the inability to get consistent robust re-referencing results with a random seed if different numbers of chunks were used across runs. I've tested it locally with data and it's consistent across different manually-set chunk sizes, so I think it's working okay, but please let me know if you can think of any problems with this approach!
Merge Checklist
To merge your PR we need to first take the following points into account:
closes #<issue-number>to automatically close an issue