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

Misleading Python function error with negative NodeID #95

Open
tomdele opened this issue Jun 17, 2020 · 2 comments
Open

Misleading Python function error with negative NodeID #95

tomdele opened this issue Jun 17, 2020 · 2 comments
Labels
nice to have Not mandatory but a nice to have feature

Comments

@tomdele
Copy link
Contributor

tomdele commented Jun 17, 2020

Functions that take as an argument a NodeID will fail if you provide a negative number as a node id (which makes perfect sense).
For the C++ part, we are safe and it is easy to find where the problem comes from but with the python bindings this is a bit more tricky.

Ex :

edge_population.efferent_edges(-1)

TypeError: efferent_edges(): incompatible function arguments. The following argument types are supported:
    1. (self: libsonata._libsonata.EdgePopulation, source: int) -> libsonata._libsonata.Selection
    2. (self: libsonata._libsonata.EdgePopulation, source: List[int]) -> libsonata._libsonata.Selection

Invoked with: <libsonata._libsonata.EdgePopulation object at 0x2aab669176f0>, -1

The outputted error is quite unclear since the int/uint distinction does not exists in python.
Having an error message in the bindings saying that we cannot use NodeID < 0 would be a nice to have feature.

@tomdele tomdele added the nice to have Not mandatory but a nice to have feature label Jun 17, 2020
@alkino
Copy link
Member

alkino commented Jun 24, 2020

Could Selection throw if there is negative NodeID? Can it be something filling the request?

@tomdele
Copy link
Contributor Author

tomdele commented Jun 24, 2020

Sure that would be perfect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
nice to have Not mandatory but a nice to have feature
Projects
None yet
Development

No branches or pull requests

2 participants