Skip to content

'Segment' object has no attribute 'imagesequences' (neo 0.8.0) #779

Closed

Description

@dizcza

Dear neos,

I have a problem while filtering a block with neo 0.8.0. Previously, with neo 0.7.2, I don't have such a problem. The data is resting state if it makes any sense for you.

    fpath = os.path.join(DATA_DIR, "block_rst.pkl")
    f = neo.io.PickleIO(fpath)
    block = f.read_block()
    analog_signals = block.filter(objects="AnalogSignal")

Traceback

  File "/home/ulianych/PycharmProjects/elephant/examples/granger_example.py", line 207, in granger_example_resting_state
    analog_signals = block.filter(objects="AnalogSignal")
  File "/home/ulianych/anaconda3/envs/elephant/lib/python3.7/site-packages/neo/core/container.py", line 426, in filter
    children.extend(self.data_children_recur)
  File "/home/ulianych/anaconda3/envs/elephant/lib/python3.7/site-packages/neo/core/block.py", line 115, in data_children_recur
    return tuple(unique_objs(super(Block, self).data_children_recur))
  File "/home/ulianych/anaconda3/envs/elephant/lib/python3.7/site-packages/neo/core/container.py", line 350, in data_children_recur
    self.container_children]
  File "/home/ulianych/anaconda3/envs/elephant/lib/python3.7/site-packages/neo/core/container.py", line 349, in <listcomp>
    childs = [list(child.data_children_recur) for child in
  File "/home/ulianych/anaconda3/envs/elephant/lib/python3.7/site-packages/neo/core/container.py", line 351, in data_children_recur
    return self.data_children + tuple(sum(childs, []))
  File "/home/ulianych/anaconda3/envs/elephant/lib/python3.7/site-packages/neo/core/container.py", line 321, in data_children
    self._data_child_containers]
  File "/home/ulianych/anaconda3/envs/elephant/lib/python3.7/site-packages/neo/core/container.py", line 320, in <listcomp>
    childs = [list(getattr(self, attr)) for attr in
AttributeError: 'Segment' object has no attribute 'imagesequences'

Activity

  1. samuelgarcia commented on Dec 11, 2019

    @samuelgarcia
    Contributor

    Andrew ? any idea ?

  2. JuliaSprenger commented on Dec 11, 2019

    @JuliaSprenger
    Member

    @dizcza Did you generate the file with Neo version 0.7.2 or 0.8.x?

  3. dizcza commented on Dec 11, 2019

    @dizcza
    MemberAuthor

    The file was generated with neo 0.7.2

  4. dizcza commented on Dec 13, 2019

    @dizcza
    MemberAuthor

    The reason why I used PickleIO is because NixIO threw exceptions when I tried to save it. Don't remember which exceptions they were and I've not checked if NixIO is improved since then.

  5. added this to the 0.9.0 milestone on Jul 7, 2020
  6. self-assigned this
    on Jul 7, 2020
  7. apdavison commented on Sep 13, 2020

    @apdavison
    Member

    We could in principle handle this, but PickleIO is not expected to work across different versions, and I don't think we should encourage its use.

    The docstring for PickleIO says:

    "Note that files in this format may not be readable if using a different version
    of Neo to that used to create the file. It should therefore not be used for
    long-term storage, but rather for intermediate results in a pipeline."

    Having said that, if you have a lot of 0.7.2 files in this format @dizcza we could provide a temporary solution to migrate them to 0.8.0. Please let us know.

  8. dizcza commented on Sep 13, 2020

    @dizcza
    MemberAuthor

    I would like to see a version control check while loading a file in neo using a file format that is not cross-version compatible.
    If the current version of neo does not match with the neo version of the file I'm loading, show a warning.
    In particular for PickleIO.

  9. apdavison commented on Sep 13, 2020

    @apdavison
    Member

    That's a good idea. I've created a ticket: #856

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions