spikeinterface
spikeinterface copied to clipboard
Implement `get_parent()` function
Fixes #2596
This is super useful for example to plot different processing layers!
Quick (maybe dumb) question: what about when there are multiple parents? (e.g. UnitsAggregationSorting
)
Quick (maybe dumb) question: what about when there are multiple parents? (e.g.
UnitsAggregationSorting
)
It returns None
, but we have other ways to return the parent list (property sortings/recordings
)
Does the context were the other decision was made makes sense her?
I believe that was largely done to allow mapping between network drives for Windows because the cleanup etc doesn't work on Windows otherwise (due to WinError 32 amongst other classic Windows issues. ) . Neo did have a discussion of circular non-closeable references though that may be of interest in relation to this here
- For the segments we have the weakref mechanism. Would it make sense to have smoething like this for this? Does the context were the other decision was made makes sense her? Probably for @samuelgarcia to weight in on this one.
I don't think it does, because in this case you're exposing an object which is already referenced (self._parent_recording
). Instead, when registering a recording to a sorting, you're "attaching" a complete different recording.
- I would go fully verbose and say
get_parent_extractor
and_parent_extractor
.
I actually don't really like extractor :) I know that we have a BaseExtractor
class, but the core objects are BaseRecording
adn BaseSorting
- For the segments we have the weakref mechanism. Would it make sense to have smoething like this for this? Does the context were the other decision was made makes sense her? Probably for @samuelgarcia to weight in on this one.
I don't think it does, because in this case you're exposing an object which is already referenced (
self._parent_recording
). Instead, when registering a recording to a sorting, you're "attaching" a complete different recording.
- I would go fully verbose and say
get_parent_extractor
and_parent_extractor
.I actually don't really like extractor :) I know that we have a
BaseExtractor
class, but the core objects areBaseRecording
andBaseSorting
I have the intuition that we should make a weak reference instance of a hard link. Lets maturate a bit this before merging.
I have the intuition that we should make a weak reference instance of a hard link. Lets maturate a bit this before merging.
I think it doesn't make sense, since the parent object is also usually stored as self._something
I don't think it does, because in this case you're exposing an object which is already referenced (self._parent_recording). Instead, when registering a recording to a sorting, you're "attaching" a complete different recording.
I see. Yeah, then maybe let's do it as you have it here and then, if some problem appears, we could add weakref?
Since Windows is the biggest culprit for problems is there a test I can run locally to probe this?
Since Windows is the biggest culprit for problems is there a test I can run locally to probe this?
I don't think there is! IMO let's merge and see if it causes problems