spikeinterface icon indicating copy to clipboard operation
spikeinterface copied to clipboard

Add force_recompute to SortingAnalyzer.compute

Open alejoe91 opened this issue 1 year ago • 5 comments

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

alejoe91 avatar Jun 19 '24 14:06 alejoe91

Seems tests are failing at the moment :)

zm711 avatar Jun 19 '24 14:06 zm711

Indeed, the test was wrong :)

alejoe91 avatar Jun 19 '24 14:06 alejoe91

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.

samuelgarcia avatar Jun 20 '24 07:06 samuelgarcia

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.

alejoe91 avatar Jun 20 '24 07:06 alejoe91

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.

samuelgarcia avatar Jul 03 '24 09:07 samuelgarcia