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

unexpected behavior of neighbour_list #95

Open
richardjana opened this issue Mar 7, 2022 · 5 comments
Open

unexpected behavior of neighbour_list #95

richardjana opened this issue Mar 7, 2022 · 5 comments
Labels

Comments

@richardjana
Copy link

I just encountered behavior from neighbour_list, which I had not expected and which seems strange / undesirable to me when I call the function and give a single number for the cutoff

  • When I use a float, e.g. 5.0, everything works just fine.
  • When I give an integer, e.g. 5, I get an error ValueError: object of too small depth for desired array from _matscipy.neighbour_list.

I realize that the documentation states that you can give "A single float" specifically, but I don't see an obvious reason why "5" should not be interpreted as "5.0".

@pastewka
Copy link
Collaborator

pastewka commented Mar 7, 2022

Interesting, that looks like a bug. Thanks for reporting.

@jameskermode
Copy link
Member

jameskermode commented Mar 7, 2022

I've also noticed this before: my guess is that the variable is passed straight to C without a type conversion so should be pretty easy to fix.

@pastewka pastewka added the bug label Mar 7, 2022
@pastewka
Copy link
Collaborator

pastewka commented Mar 7, 2022

Agree, there is some funkiness going on with type conversion in the C code.

@prs513rosewood
Copy link
Contributor

I also encountered this error, and made a change to make the error message more explicit in #91. I agree a switch to pybind11 would make things simpler and more robust.

@pastewka
Copy link
Collaborator

Will be fixed with #96

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

No branches or pull requests

4 participants