BlueBrain / libsonata

A python and C++ interface to the SONATA format
https://libsonata.readthedocs.io/en/stable/
GNU Lesser General Public License v3.0
12 stars 12 forks source link

node_set rules population selection #157

Open ferdonline opened 3 years ago

ferdonline commented 3 years ago

We don't seem to have a way to properly filter nodes according to the nodeset population selector.. The nodeset entries cannot be inspected to know which node population to open, and the Nodeset rule is basically a no-op, which either return the same set if the provided node population matches, otherwise returns an empty set. We are left with the workaround of opening all the populations and run materialize against them all

https://github.com/BlueBrain/libsonata/blob/4795217b7482206f0b5799df0d9797498e9e5ba8/src/node_sets.cpp#L145

A possibility could be to have a somewhat high level API, where we could have NodeSet objects, inspect them, and (why not) having a NodeStorage doing filtering on entries directly from them.

Some extras: I see constructors copying values passed by rvalue-ref, which is not very idiomatic. Either copy from const-ref of move the rvalue-ref.. (Unless you want to force passing only rvalues?) https://github.com/BlueBrain/libsonata/blob/4795217b7482206f0b5799df0d9797498e9e5ba8/src/node_sets.cpp#L140 Or even moving copies, instead of initializing from a const-ref https://github.com/BlueBrain/libsonata/blob/4795217b7482206f0b5799df0d9797498e9e5ba8/src/node_sets.cpp#L304

mgeplf commented 3 years ago

For the first point, that could be added - it's not something that we've run into, so feel free to open a PR.

With respect to 'Some Extras', if you see things that can be improved, I would put those in another ticket, and, even better, in PR, so we can see the changes.

mgeplf commented 2 years ago

@ferdonline: Any update on this? Are you planning on adding the functionality you need?