Repository navigation
Conversation
| extensions : dict | ||
| Mapping of computed extension name -> params. |
There was a problem hiding this comment.
I found this name and param docstring very confusing.
What would a more descriptive name of extensions be? It's something like computed_extensions_and_extensions_to_compute Maybe if the doc was more informative it'd be fine.
other_extensions
computed_extensions
??
| @@ -2923,15 +2922,29 @@ def _get_children_dependencies(extension_name): | |||
| For instance, recomputing the "waveforms" needs to delete the "templates", since the latter depends on the former. | |||
| For this particular example, if we change the "ms_before" parameter of the "waveforms", also the "templates" will | |||
| require recomputation as this parameter is inherited. | |||
|
|
|||
| Dependencies are resolved with the params of each extension, so optional dependencies (e.g. "quality_metrics" | |||
| on "spike_amplitudes") are included. Every alternative of a "a|b" dependency counts as a parent, since which | |||
| one was used is not recorded. | |||
There was a problem hiding this comment.
I think the docstring is a bit of out date now. Here's my attempt at a new one:
Extension classes have a depend_on attribute to declare which class they depend on. For instance "templates" depends on "waveforms"; "waveforms" depends on "random_spikes". This function is going the opposite way: it finds all children, grandchildren etc that depend on a particular extension.
Depending on their parameters, certain extensions depend on different combinations of extensions. E.g. if you're computing snrs, then noise_levels has quality_metrics as a child. But if you're just computing firing_rate, then it does not. Hence the dependency graph depends on what other extensions are being computed, or are saved in the analyzer. We account for these through the other_extensions argument.
|
If I do this: Then all quality metrics are deleted when |
…get-extension-children-runtime
…get-extension-children-runtime
This is done in the last commit. Basically, the |
| @@ -2908,15 +2920,34 @@ def _get_children_dependencies(extension_name): | |||
| For instance, recomputing the "waveforms" needs to delete the "templates", since the latter depends on the former. | |||
| For this particular example, if we change the "ms_before" parameter of the "waveforms", also the "templates" will | |||
| require recomputation as this parameter is inherited. | |||
|
|
|||
| Extension classes have a `depend_on` attribute to declare which class they depend on. For instance "templates" | |||
| depends on "waveforms"; "waveforms" depends on "random_spikes". This function is going the opposite way: it finds | |||
| all children, grandchildren etc that depend on a particular extension. | |||
|
|
|||
| Depending on their parameters, certain extensions depend on different combinations of extensions. E.g. if you're | |||
| computing snrs, then noise_levels has quality_metrics as a child. But if you're just computing firing_rate, | |||
| then it does not. Hence the dependency graph depends on what other extensions are being computed, or are saved | |||
| in the analyzer. We account for these through the `all_extension_params` argument. | |||
There was a problem hiding this comment.
This docstring repeats itself
| self.data.get("runtime_s", {}).pop(m, None) | ||
| if self.format != "memory" and not self.sorting_analyzer.is_read_only(): | ||
| self.save() | ||
| warnings.warn( |
There was a problem hiding this comment.
This warning is great! We should maybe add a warning when we delete any parent extension (e.g. if you do a .compute('noise_levels') we should report which extensions we're deleting.
| zarr.consolidate_metadata(zarr_root.store) | ||
|
|
||
| def delete(self): | ||
| def delete(self, deleted_parents=None) -> bool: |
There was a problem hiding this comment.
I think this is more specific than the name suggests. If you're really just deleting an extension, I think you should use delete_extension or _delete_extension_folder? Maybe we should update delete_extension to accept deleted_parents, or have a hyper specific name?
| def delete(self, deleted_parents=None) -> bool: | |
| def delete_dependent_part_of_extension(self, deleted_parents=None) -> bool: |
There was a problem hiding this comment.
Looking at this more. We now have:
SortingAnalyzer.delete_extensionSortingAnalyzer._delete_extension_storageAnalyzerExtension.deleteAnalyzerExtension._delete_extension_folder
delete_extension calls delete and _delete_extension_storage.
delete calls _delete_extension_folder
Sure it's all logical and to do with folder vs memory, but feels like a bit of a mess. I think renaming delete would clarify a little bit.
Fixes #4912