Skip to content

to_dataframe fails if the number of groups is not == 1 #137

@dmastrovito

Description

@dmastrovito

dataframes.append(self.get_group(grp_id)).to_datframe()

when len(self.groups) != 1, the following error occurs:

File "/home/dana.mastrovito/.local/lib/python3.9/site-packages/sonata/circuit/population.py", line 245, in to_dataframe
dataframes.append(self.get_group(grp_id)).to_datframe()
AttributeError: 'NoneType' object has no attribute 'to_datframe'

On line 245, it appears that the parentheses cause to_datframe() to be called on the result of dataframes.append(...), which is None, rather than on the group object. This seems to attempt to convert a list to a dataframe.

On the next line (246), the code tries to set an index on what appears to still be a list—possibly indicating that the intended behavior was to concatenate the dataframes first.

There also seems to be a typo: .to_datframe should be .to_dataframe

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