Open JuliaSprenger opened 4 years ago
Hi Julia. I think really prefer deepcopy of annotation. I forget why we did not copy annotations yet.
Having uid for neo object is not a solution I like.
And about the when to make the copy, I don't known choose the simpler!!
Cheers,
Samuel
I think this is important to put in 0.9 no ? Even with something very simple. This is the last stuff. No ?
I don't think this will go into the next release as there is not enough time to implement and review it properly. @samuelgarcia @apdavison I suggest to postpone this to 0.11.0. even though it is labeled as blocker.
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 https://github.com/NeuralEnsemble/python-neo/issues/809#issuecomment-619902320), 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:
__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.__array_finalize__
methods as these are called also during the process of slicing@apdavison @samuelgarcia Do you have a preference regarding the different options here?