Conversation
for more information, see https://pre-commit.ci
|
TO CHANGE: Allow overlapping segments |
Modify the behavior of check_segment() to allow the possibility of overlapping segments.
for more information, see https://pre-commit.ci
Modify the behavior of check_segment() to allow the possibility of overlapping segments.
|
I've changed the code to allow overlapping segments, and modify the documentation to reflect that new behavior. One thing is that it is currently not possible to remove segments. So if a Physio object has been edited and segments were "annotated" (meaning saving the onset and offset of segments), and the
One problem with the second proposed change is that if we have two overlapping segments with one complete within the other. Example, segment1 (onset, offset) = (0, 100); segment2 (onset, offset) = (25, 50). In that case, I think that if one select a window within (25, 50) to be deleted, only segment2 should be deleted. If the selected window is for example (30, 60) then both segments should be deleted. @smoia WDYT? |
Closes #
[WIP]
I modified the peakdet codebase a moment ago to be able to annotate segments (save the onset and offset of segments) during the manual editing (
operations.edit_physio) for my personal use case. I'm doing that PR in case that could be a feature useful for others!Proposed Changes
annotate_segments()function and modify existing functions ineditor.pyto be able to annotate segments in the interactive viewersegmentsproperty to be able to store the onset and offset of selected segments in thesegmentsattribute of aPhysioinstance, and in the metadata. Output example:>>> data.segments array([( 508., 1086.), (1661., 1987.)], dtype=[('onset', '<f8'), ('offset', '<f8')])A few comments/questions:
.pre-commit-config.yamlfile and specify the python version to be able to run the pre-commit hooks. Ideally I guess the .pre-commit-config.yaml would not include it, so if anybody wants to discuss the error I got before that change, it would be great!physio_edit_segment.giffor the documentation (the file size is smaller than the other gif already included i.e.physio_edit.gif).make htmlin thedocs/subdirectory). There was a problem with L118 in conf.py. I ended up just commenting that line for the sake of testing the rendering of the modified doc. I would have to investigate a bit more on that, but it's also been a while since the last rtd build (5 years ago) and I'm wondering if the problem is not only local.Change Type
bugfix(+0.0.1)minor(+0.1.0)major(+1.0.0)refactoring(no version update)test(no version update)infrastructure(no version update)documentation(no version update)otherChecklist before review