Skip to content

Support numpy>=2 and remove numpy<2 pin#3040

Merged
1uc merged 12 commits into
masterfrom
numpy2
Aug 29, 2024
Merged

Support numpy>=2 and remove numpy<2 pin#3040
1uc merged 12 commits into
masterfrom
numpy2

Conversation

@kbvw

@kbvw kbvw commented Aug 13, 2024

Copy link
Copy Markdown
Contributor

No description provided.

@bbpbuildbot

This comment has been minimized.

Comment thread ci/win_test_installer.cmd Outdated
Comment thread packaging/python/test_wheels.sh Outdated
@azure-pipelines

Copy link
Copy Markdown

✔️ 8904530 -> Azure artifacts URL

@kbvw kbvw changed the title Support numpy>=2 and remove numpy<2 pin Support numpy>=2 and remove numpy<2 pin Aug 13, 2024
@azure-pipelines

Copy link
Copy Markdown

✔️ 5ba690e -> Azure artifacts URL

@kbvw kbvw force-pushed the numpy2 branch 4 times, most recently from 4d2bfd8 to fb0b38c Compare August 13, 2024 15:25
@codecov

codecov Bot commented Aug 13, 2024

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.26%. Comparing base (c918f6b) to head (9fb93ec).
Report is 4 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3040      +/-   ##
==========================================
- Coverage   67.27%   67.26%   -0.01%     
==========================================
  Files         571      571              
  Lines      104882   104887       +5     
==========================================
- Hits        70555    70550       -5     
- Misses      34327    34337      +10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bbpbuildbot

This comment has been minimized.

@bbpbuildbot

This comment has been minimized.

@bbpbuildbot

This comment has been minimized.

@kbvw kbvw force-pushed the numpy2 branch 2 times, most recently from ef44b28 to af837ba Compare August 14, 2024 17:52
@bbpbuildbot

This comment has been minimized.

@bbpbuildbot

This comment has been minimized.

@bbpbuildbot

This comment has been minimized.

@bbpbuildbot

This comment has been minimized.

@bbpbuildbot

This comment has been minimized.

@azure-pipelines

Copy link
Copy Markdown

✔️ 24e493b -> Azure artifacts URL

@azure-pipelines

Copy link
Copy Markdown

✔️ d30ad08 -> Azure artifacts URL

@azure-pipelines

Copy link
Copy Markdown

✔️ 16d874e -> Azure artifacts URL

@azure-pipelines

Copy link
Copy Markdown

✔️ 95b461c -> Azure artifacts URL

@azure-pipelines

Copy link
Copy Markdown

✔️ b624267 -> Azure artifacts URL

@kbvw

kbvw commented Aug 23, 2024

Copy link
Copy Markdown
Contributor Author

The "might take" is measurable. How long do they take? How long is that compared to building NEURON?

From the latest CI run, over the range of Linux and Mac Python wheels:

13m43s to 20m17s for the build script
3m49s to 4m44s for the test script
1m44s to 1m57s for the part that now repeats for two NumPy versions

So overal about a 9-11% increase.

Quickly testing with latest and oldest NumPy seems useful (especially instead of only oldest), but not sure if everything needs to be tested twice: MPI, nrnivmodl, etc. Maybe I'll re-arrange the script and just do neuron.test() and neuron.test_rxd() twice?

@bbpbuildbot

This comment has been minimized.

@bbpbuildbot

This comment has been minimized.

@azure-pipelines

Copy link
Copy Markdown

✔️ a665da1 -> Azure artifacts URL

@bbpbuildbot

This comment has been minimized.

@kbvw

kbvw commented Aug 27, 2024

Copy link
Copy Markdown
Contributor Author

When running only neuron.test() and neuron.test_rxd() again with the oldest NumPy, this only takes about 4-6 seconds extra.

Comment thread docs/install/install_instructions.md
Comment thread ci/win_test_installer.cmd Outdated
Comment thread packaging/python/test_requirements.txt Outdated
@sonarqubecloud

Copy link
Copy Markdown

@azure-pipelines

Copy link
Copy Markdown

✔️ 9fb93ec -> Azure artifacts URL

@1uc 1uc left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work.

@1uc 1uc merged commit 2996006 into master Aug 29, 2024
@1uc 1uc deleted the numpy2 branch August 29, 2024 08:38
nrnhines added a commit that referenced this pull request Jan 23, 2025
nrnhines added a commit that referenced this pull request Jan 23, 2025
JCGoran pushed a commit that referenced this pull request Jan 24, 2025
nrnhines added a commit that referenced this pull request Mar 24, 2025
At starting point, jelic/8.2-py313 #3319 had only two CI failures.

Almost the entirety of this PR is to get 8.2 to pass CI.
In addition it supports Python3.13.
Bug fixes adopted from the master are
#3239 Launching nrniv -python with Python 3.13.0 does not allow use of gui.
#3259 On h.quit() terminal settings are same as when neuron.hoc was imported.
#3243 save stdin terminal settings on import hoc and restore on h.quit()
#3276 Python 3.13.1 broke [s for s in sl] where sl is a SectionList. Manual partial cherry-pick.

Other PR attempts at fixing CI failures that can be closed when this PR is merged, are #3329 #3325 #3319 #3317

Many of the CI fixes are backports from #3028 #3040 #3303 #3105 #3278

bldnrnmacpkgcmake.sh was updated. It isolates a change (avoid breaking CI) with -DNRN_MAC_PKG=ON
---------

Co-authored-by: Goran Jelic-Cizmek <goran.jelic-cizmek@epfl.ch>
sanjayankur31 pushed a commit to sanjayankur31/nrn that referenced this pull request Apr 2, 2025
* Build wheels with latest numpy and test them with oldest supported numpy

* Update oldest supported Python and Numpy versions

* Pin `numpy<2` for documentation only

The documentation requires an old version of bokeh which isn't compatible with `numpy>=2`.

* Cast to `c_long` in RxD on Python side before passing to C++

With Numpy2 there was an inconsistency in the integer types, i.e. the C++ assumed a smaller
type than the Python side, on Windows only. Causing SEGFAULT. This fixes the issue by using
consistent integer types.
sanjayankur31 pushed a commit to sanjayankur31/nrn that referenced this pull request Apr 2, 2025
* Build wheels with latest numpy and test them with oldest supported numpy

* Update oldest supported Python and Numpy versions

* Pin `numpy<2` for documentation only

The documentation requires an old version of bokeh which isn't compatible with `numpy>=2`.

* Cast to `c_long` in RxD on Python side before passing to C++

With Numpy2 there was an inconsistency in the integer types, i.e. the C++ assumed a smaller
type than the Python side, on Windows only. Causing SEGFAULT. This fixes the issue by using
consistent integer types.
sanjayankur31 pushed a commit to sanjayankur31/nrn that referenced this pull request Apr 7, 2025
* Build wheels with latest numpy and test them with oldest supported numpy

* Update oldest supported Python and Numpy versions

* Pin `numpy<2` for documentation only

The documentation requires an old version of bokeh which isn't compatible with `numpy>=2`.

* Cast to `c_long` in RxD on Python side before passing to C++

With Numpy2 there was an inconsistency in the integer types, i.e. the C++ assumed a smaller
type than the Python side, on Windows only. Causing SEGFAULT. This fixes the issue by using
consistent integer types.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants