Skip to content

copy behaviour of annotations and object identity #811

Open
@JuliaSprenger

Description

@JuliaSprenger

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 for array_annotations. This would lead to multiple steps in the process of slicing. First linking of annotations 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?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions