-
Notifications
You must be signed in to change notification settings - Fork 116
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
Refactor neuron.coreneuron for Python 3.10.x #1528
Conversation
https://github.com/neuronsimulator/nrn-build-ci/runs/4163851845 shows this fixes test execution on |
The |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice cleaning
Ignoring Windows CI as that's need to be handled separately anyway. |
* Add getters/setters to neuron.coreneuron 'module'. * Collections.Callable is deprecated. * Code cleanup
This fixes some Python 3.10.0 incompatibilities, as partly discussed in #1525.
The main changes are:
neuron.coreneuron
to be a class instance with getter/setter methods, so that properties likecoreneuron.enable
andcoreneuron.cell_permute
always have consistent values of consistent types. This stops us from relying on implicitfloat
->int
conversions in the Python C API, as described in NEURON build + tests do not pass on Fedora latest #1525.collections.abc.Callable
instead ofcollections.Callable
, which is deprecated.test/coreneuron/test_datareturn.py
compare the twocoreneuron.cell_permute
values that are valid givencoreneuron.gpu
, instead of always trying to compare0
and1
.Closes #1525.
I tested this on BB5 + GPU (with Python 3.8) and on Fedora 35 in Docker. I still saw a couple of failures locally, but I think these are unrelated and that something is slightly broken in my macOS + Docker + Fedora 35 + MPI environment.