pympi
pympi copied to clipboard
add_annotation does not check if the time stamp (left/right) does already exist
I would expect if I add an annotation that first, the add_annotation(...) method would check if the timestamp does already exist in a linked tier. And if so, it would use the already existing time stamp, before adding a new one. However, that is not what I see. Is this on purpose?
I am using pympi 1.69
This is not on purpose and would be a perfect enhancement of the library
This could be implemented by patching the generate_ts_id
function.
I've reverted the MR because not all functions take this property into mind and therefore some functionality behaves off due to reusing timeslots.
Adding new annotations works only for nonadjacent annotations, that is when the onset of the annotation I add does not equal to the ending of a previous one. Suppose I have two annotations with timestamps: 1000-2000 and 2000-3000. I can't add new annotation starting at 3000 and I can't change the first annotation with re moving it and adding a new one with a new label. Is there any other way to remove or change annotation which have the same ending as the next one? I hope it is clear ;)