DOC: document onset, duration, description, and ch_names attributes of mne.Annotations#13680
DOC: document onset, duration, description, and ch_names attributes of mne.Annotations#13680Famous077 wants to merge 10 commits intomne-tools:mainfrom
Conversation
for more information, see https://pre-commit.ci
|
@Famous077 can you please sign in to CircleCI via the sign in with Github option? After you do this and push a commit to this branch, the build docs job should run. |
mne/annotations.py
Outdated
| @onset.setter | ||
| def onset(self, onset): | ||
| self._onset = onset |
There was a problem hiding this comment.
Historically, whether intentionally or by oversight, we left these onset/duration/description attributes free to be mutated without any guardrails.. I myself have taken advantage of this! But now that they are properties and documented on our website, should we do some minimal validation in the setter? For example, checking that a newly set onset array has the same length as the durations, etc.
There was a problem hiding this comment.
@scott-huberty . Thank you for the clarification. I'll add basic validation to the setters ,checking length
consistency and proper dtype.
There was a problem hiding this comment.
@scott-huberty Added basic validation to the onset, duration, and description setters
to check length consistency and proper dtype conversion. Please let me
know if any further changes are needed.
There was a problem hiding this comment.
Hi @scott-huberty , Would appreciate your review when you get a chance. Happy to update based on your feedback. Thank you
There was a problem hiding this comment.
@Famous077 please stand by, I plan to discuss this with folks during the office hours on Friday.
There was a problem hiding this comment.
@scott-huberty Thanks for the update. I’ll stand by and look forward to the discussion on Friday.
…github.com/Famous077/mne-python into doc/annotations-onset-duration-description
…github.com/Famous077/mne-python into doc/annotations-onset-duration-description
What does this implement/fix?
--> I have Converted
onset,duration,description, andch_namesfrom plaininstance attributes to documented properties in
mne/annotations.py,so they appear in the API reference with proper NumPy-style docstrings.
Additional information
--> Even experienced MNE users were unaware these attributes existed because
they did not appear in the generated API documentation. A changelog entry
has been added in
doc/changes/dev/12379.other.rst.