Closed johann-petrak closed 2 years ago
Actually for all methods which take an ann parameter now, we need to check if the ann is part of the set where we are retrieving annotations: if yes, pass the annid to id-based methods, otherwise do not pass the id.
This is even more complex: we currently do not have a fast method to properly check if an annotation instance is part of a set (only if its id is part of the set). But in order to distinguish between passing on an annotation which is included in the set and one from another set with the same id, we need such a method. Two options:
OK, implemented the second option: AnnotationSet._anns
is a set of annotations (by object id)
Currently, include_self is False with many methods. This prevents annotations to get included in the result set if the annotation id matches, which helps to prevent an annotation from the same set to show up in the result.
However it will exclude annotations incorrectly, if an annotation from a different set is passed and the id of a matchin annotation in this set has the same id. This is unexpected.
To fix this, we need to find the best place to actually check for equality with the annotation, not just the annotation id.
Already changed: the
support_annotation_or_set
wrapper automatically passes the annotation if the method has an "ann" parameter.Now we need to pass that annotation all the way down to the method that creates the detached set from all the ids