Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Functionalities, such as iter_connections should not raise on missing property #244

Open
joni-herttuainen opened this issue Nov 13, 2023 · 0 comments

Comments

@joni-herttuainen
Copy link
Contributor

joni-herttuainen commented Nov 13, 2023

@edasubert approached me with a question as to why does this happen:

>>> list(circuit.edges.iter_connections(source="Excitatory"))
Traceback (most recent call last):
  File "/gpfs/bbp.cscs.ch/ssd/apps/bsd/2023-02-23/stage_applications/install_gcc-12.2.0-skylake/py-bluepysnap-2.0.2-hmbi6r/lib/python3.10/site-packages/bluepysnap/node_sets.py", line 52, in get_ids
    return self._node_sets.materialize(self._name, population).flatten()
libsonata._libsonata.SonataError: No such attribute: 'synapse_class'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/gpfs/bbp.cscs.ch/ssd/apps/bsd/2023-02-23/stage_applications/install_gcc-12.2.0-skylake/py-bluepysnap-2.0.2-hmbi6r/lib/python3.10/site-packages/bluepysnap/edges/edges.py", line 280, in iter_connections
    it = pop.iter_connections(
  File "/gpfs/bbp.cscs.ch/ssd/apps/bsd/2023-02-23/stage_applications/install_gcc-12.2.0-skylake/py-bluepysnap-2.0.2-hmbi6r/lib/python3.10/site-packages/bluepysnap/edges/edge_population.py", line 554, in iter_connections
    source_node_ids = self._resolve_node_ids(self.source, source)
  File "/gpfs/bbp.cscs.ch/ssd/apps/bsd/2023-02-23/stage_applications/install_gcc-12.2.0-skylake/py-bluepysnap-2.0.2-hmbi6r/lib/python3.10/site-packages/bluepysnap/edges/edge_population.py", line 81, in _resolve_node_ids
    return nodes.ids(group)
  File "/gpfs/bbp.cscs.ch/ssd/apps/bsd/2023-02-23/stage_applications/install_gcc-12.2.0-skylake/py-bluepysnap-2.0.2-hmbi6r/lib/python3.10/site-packages/bluepysnap/nodes/node_population.py", line 423, in ids
    result = group.get_ids(self._population, raise_missing_property)
  File "/gpfs/bbp.cscs.ch/ssd/apps/bsd/2023-02-23/stage_applications/install_gcc-12.2.0-skylake/py-bluepysnap-2.0.2-hmbi6r/lib/python3.10/site-packages/bluepysnap/node_sets.py", line 56, in get_ids
    raise BluepySnapError(*e.args) from e
bluepysnap.exceptions.BluepySnapError: No such attribute: 'synapse_class'

The answer being that as edges.iter_connections iterates over all edge populations and their source node populations, it ends up finding projections and a virtual node population that does not have synapse_class or, really, any attributes.

I don't think it makes sense that iter_connections or any circuit.edges functionalities would raise on these occasions. Especially so, as it is very difficult to understand the issue from the stacktrace.

I propose we don't raise/do silently handle the error(s) in the background on situations such as the above.

Any thoughts?
@eleftherioszisis , @edasubert, @GianlucaFicarelli

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant