spikeinterface
spikeinterface copied to clipboard
Add force_recompute to SortingAnalyzer.compute
This is for avoiding recomputing extensions when they are:
- already computed
- have the same parameters This also avoids deleting dependent extensions by mistake!
A force_recompute option is added to override this behavior
Partially addresses #3031
Seems tests are failing at the moment :)
Indeed, the test was wrong :)
I am not super happy with this! For me this is dangerous. At the moment when you compute something it force the recompute always and this is a good behavior I think.
Are we sure that when do this in a chain where steps has dependencies that every child nodes is recompute if a parent has change parameters ? This should be tested. I am not seeing in the code a parent-child checking for this. In short if you recompute random_spike with new params and waveforms with same params both should be computed.
And also I am strongly/totaly disagree with the default being False.
To be honest I do not see when we need this.
Why is this dangerous? If the params are the same in my opinion we shouldn't recompute.
The dependency deletion is kept. Each compute function will force the deletion of its children if recompute is triggered. Chris added a test for it.
I think we need to discuss the semantic globally here.
I am not against this behavior at al but this should be done a a separated method could be named load_or_compute() for me compute() should not be a hidden load a cache.