NeuralEnsemble / python-neo

Neo is a package for representing electrophysiology data in Python, together with support for reading a wide range of neurophysiology file formats
http://neo.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
316 stars 247 forks source link

copy behaviour of annotations and object identity #811

Open JuliaSprenger opened 4 years ago

JuliaSprenger commented 4 years ago

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:

@apdavison @samuelgarcia Do you have a preference regarding the different options here?

samuelgarcia commented 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

samuelgarcia commented 3 years ago

I think this is important to put in 0.9 no ? Even with something very simple. This is the last stuff. No ?

JuliaSprenger commented 3 years ago

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.