Centralize add_segment and segments to BaseExtractor#4462
Centralize add_segment and segments to BaseExtractor#4462alejoe91 merged 22 commits intoSpikeInterface:mainfrom
add_segment and segments to BaseExtractor#4462Conversation
| # we remove the annotation if it exists | ||
| _ = self._annotations.pop("name", None) | ||
|
|
||
| @property |
There was a problem hiding this comment.
Maybe for typing we could in BaseRecording for example:
@property
def segments(self) -> list[BaseRecordingSegment]:
return self._segments # type: ignore[return-value]As that will enable the analysis of base recording sgements methods that we call on introspection with vscode and ohter tools. Same for bas sorting.
There was a problem hiding this comment.
Also, can we make this private? what is the reason for making this public?
There was a problem hiding this comment.
Adding it! I think it's handy to have it public. The segments are a big part of the API, so exposing them (as a property) doesn't hurt IMO
| mode: "extremum" | "at_index" | "peak_to_peak" = "extremum", | ||
| peak_sign: Literal["neg", "pos", "both"] = "neg", | ||
| mode: Literal["extremum", "at_index", "peak_to_peak"] = "extremum", | ||
| operator: Literal["average", "median"] = "average", |
There was a problem hiding this comment.
because of typing errors...
|
I think I was more happy with the private approach And as @h-mayorquin So ok for merging. @chrishalcrow : did you check this ? |
chrishalcrow
left a comment
There was a problem hiding this comment.
Ok by me. Thanks for all the typing tidying :)
and fix a bunch of typing errors
Pulled out of #4216