Open
Description
Annotations of objects are by default not deepcopied when manipulating an object, e.g. upon slicing of a signal. However, array annotations are explicitly deepcopied (see #809 (comment)), whereas this is not the case for regular annotations.
This can lead to unexpected behaviour, e.g. when identifying objects via annotations (see #809).
I am not sure at which point it would be best to fix this behaviour. There are multiple options here:
- extend the
__get_item__
methods in a similar fashion as implemented forarray_annotations
. This would lead to multiple steps in the process of slicing. First linking ofannotations
by__array_finalize
and then explicit deepcopying later on. - extend the
__array_finalize__
methods as these are called also during the process of slicing - introduce unique object identifiers within neo. This would require an extended discussion first about the concept of identifiers to use and their expected behaviour in Neo.
@apdavison @samuelgarcia Do you have a preference regarding the different options here?