Skip to content

[NixIO] duplicate naming issue with array_annotations #748

@rgutzen

Description

@rgutzen

When reading a neo object with array annotations and writing it back with the NixIO, the array annotation causes the error:
DuplicateName: Duplicate name - names have to be unique for a given entity type & parent. (create_property)

Here a minimal code example:

import neo
import quantities as pq
import numpy as np

asig = neo.AnalogSignal(signal=np.array([[1,2,3,4,5], [6,7,8,9,10]]),
                        units='dimensionless',
                        sampling_rate=1*pq.Hz,
                        array_annotations={'labels': ['a','b','c','d','e']})

block = neo.Block()
seg = neo.Segment()
block.segments.append(seg)
block.segments[0].analogsignals.append(asig)

with neo.NixIO('temp.nix') as io:
    io.write(block)
with neo.NixIO('temp.nix') as io:
    loaded_block = io.read_block()
with neo.NixIO('temp2.nix') as io:
    io.write(loaded_block)

neo v0.8.0
nixio v1.5.0b1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions