Add _precomputable_kwarg_names to BaseExtractor#3781
Conversation
|
Thanks @chrishalcrow I think that |
|
@samuelgarcia ok to you? |
| self._kwargs = {} | ||
|
|
||
| # kwargs which can be precomputed before being used by the extractor | ||
| self._precomputable_kwargs = [] |
There was a problem hiding this comment.
agree able is better if its possible but not necessarily done :)
|
@samuelgarcia |
|
My two cents:
I can't really say a lot because I have not seen it in use. Perhaps a use case other than #3781 is the estimated noise and std of recordings. We already have some mechanism to treat that as special quantities and maybe they should be unified with this.Also, how will this work with the json serialization is not clear to me. Maybe you discussed this on the meeting that I missed. All of that said, these is a private attribute so I am not too concerned if we need to change it later. |
|
|
When we discussed, we agreed not to use this to store any kwargs themselves, just the information about which kwargs could be precomputed. So I think a list is the correct structure; very happy to call I'm indifferent to putting it in |
Yes, but what @h-mayorquin is saying is that the name |
_precomputable_kwargs to BaseExtractor_precomputable_kwarg_names to BaseExtractor
h-mayorquin
left a comment
There was a problem hiding this comment.
OK, we will see how it is used.
It could also be kwargs_keys to keep with the dict semantics but names is just fine if not more expressive.
|
super |
As discussed in #3685 (comment) and in maintainer meetings, it would be handy to have a
_precomputable_kwargsin theBaseExtractor, especially for Preprocessors.These are kwargs which can be precomputed for use in a preprocessor. For instance, if you know the whitening matrices, you can pass these directly instead of computing them. If you know the bad channel ids, you can pass these to
RemoveBadChannels(once it exists #3685) and if you know your motion object, you could pass this to aCorrectMotionclass (once this exists too!).This can also be used when saving preprocessed recordings. If we save the provenance and the precomputed data, we can load a preprocessed recording much faster. This will be implemented in a later PR.
This PR has no functionality so there are no new tests.
Questions:
_precomputed_kwargsbut I think this is confusing since these kwargs aren't always precomputed, it's just that they can be precomputed. So I've gone for_precomputable_kwargs. Opinions?BaseExtractor? Could be inBasePreprocessor? Any use cases for it in scenarios other than preprocessing?