Skip to content
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

DOC: Add to changes #576

Merged
merged 3 commits into from
Jul 30, 2022
Merged

DOC: Add to changes #576

merged 3 commits into from
Jul 30, 2022

Conversation

larsoner
Copy link
Member

Pushing with a circle full since we hadn't done it for a while in #563 (whoops!)

@larsoner
Copy link
Member Author

@agramfort @hoechenberger feel free to push commits if you see the problem. None of these three are trivial to me :(

@hoechenberger

This comment was marked as outdated.

@hoechenberger

This comment was marked as outdated.

@hoechenberger

This comment was marked as outdated.

@hoechenberger
Copy link
Member

With the change I just pushed and with the changes from this yet-to-be-merged PR for MNE-BIDS, it works for me locally for ds000117:
mne-tools/mne-bids#1030

@hoechenberger hoechenberger enabled auto-merge (squash) July 30, 2022 12:14
@@ -301,7 +301,6 @@ def get_config(
drop_channels=config.drop_channels,
find_breaks=config.find_breaks,
min_break_duration=config.min_break_duration,
noise_cov=config.noise_cov,
Copy link
Member Author

Choose a reason for hiding this comment

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

I think the idea is that this local cfg should have everything that is needed to run and get_input_files, and this breaks that convention.

In terms of following this standard, if we do this (use of config directly) in other cases, we risk breaking the caching because joblib won't see any changes in cfg (I think). In this particular case it will still see the changes I think because the input files will change, for the most part. One case that isn't covered is if it's a callable -- now if the code of that callable changes, the caching won't work. (Actually I suspect it will show up as "always new" because by default the __repr__ of a function includes its id/address, which will change on almost every run even if the code doesn't change. But maybe joblib is smarter about handling this already...?)

For now we could mark this with # TODO FIX just to get things green, though, since this seems like a complex problem with no easy solution, and the callable noise_cov case is rare relative to the others. If we do this, we might want to make it always recompute in the case of a callable noise_cov for safety purposes (i.e., we are not smart enough yet to know if someone changes the code within this function).

Copy link
Member

Choose a reason for hiding this comment

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

I'm currently on my phone so I cannot look, but I believe we're doing the same thing in a few other places where we accept callables, for example I think for that T1 path config option

But there might be others as well

Finding a clean solution for all of these would be great.

@hoechenberger hoechenberger merged commit e56772e into mne-tools:main Jul 30, 2022
@larsoner
Copy link
Member Author

@hoechenberger it looks like you missed my comment above (your merge was only 4 min after my comment so understandable!) -- can you take a look?

@larsoner larsoner deleted the changes branch July 30, 2022 13:07
@larsoner
Copy link
Member Author

Okay, thanks for the info and getting this green so quickly @hoechenberger . That would have have taken me quite some time to figure out...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants