This repository was archived by the owner on Feb 26, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
This repository was archived by the owner on Feb 26, 2025. It is now read-only.
Functionalities, such as iter_connections should not raise on missing property #244
Copy link
Copy link
Open
Description
@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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels