Skip to content

Commit

Permalink
Remove numpy<2 pins
Browse files Browse the repository at this point in the history
  • Loading branch information
kbvw committed Aug 13, 2024
1 parent 61dfd7c commit 46f6c50
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
run: |
python3 -m venv music-venv
source music-venv/bin/activate
python3 -m pip install 'mpi4py<4' "cython" 'numpy<2' setuptools
python3 -m pip install 'mpi4py<4' "cython" 'numpy' setuptools
sudo mkdir -p $MUSIC_INSTALL_DIR
sudo chown -R $USER $MUSIC_INSTALL_DIR
curl -L -o MUSIC.zip https://github.com/INCF/MUSIC/archive/refs/tags/${MUSIC_VERSION}.zip
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/neuron-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ jobs:
run: |
python3 -m venv music-venv
source music-venv/bin/activate
python3 -m pip install 'mpi4py<4' "cython" 'numpy<2' setuptools
python3 -m pip install 'mpi4py<4' "cython" 'numpy' setuptools
sudo mkdir -p $MUSIC_INSTALL_DIR
sudo chown -R $USER $MUSIC_INSTALL_DIR
curl -L -o MUSIC.zip https://github.com/INCF/MUSIC/archive/refs/tags/${MUSIC_VERSION}.zip
Expand Down
2 changes: 1 addition & 1 deletion ci/win_test_installer.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ C:\Python39\python -c "import neuron; neuron.test(); quit()" || set "errorfound=
C:\Python310\python -c "import neuron; neuron.test(); quit()" || set "errorfound=y"
C:\Python311\python -c "import neuron; neuron.test(); quit()" || set "errorfound=y"
:: install numpy dependency
python -m pip install "numpy<2"
python -m pip install "numpy"
:: run also using whatever is system python
python --version
python -c "import neuron; neuron.test(); quit()" || set "errorfound=y"
Expand Down
2 changes: 1 addition & 1 deletion docs/docs_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ bokeh<3
# do not check import of next line
ipython
plotnine
numpy<2
numpy
plotly
nbsphinx
jinja2
Expand Down
21 changes: 0 additions & 21 deletions docs/install/install_instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -472,24 +472,3 @@ export CFLAGS="-fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -DMACOSX -
```
If you see any other issues, please open [an issue here](https://github.com/neuronsimulator/nrn/issues/new/choose).
* **I'm seeing compiler errors related to Python and RXD.***
The error can manifest as follows:
```
share/lib/python/neuron/rxd/geometry3d/surfaces.cpp:14605:41: error: no member named 'subarray' in '_PyArray_Descr'
__Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
~~~~~~~~~ ^
```
often there's something related to NumPy nearby, e.g. `npy`.
The issue is that certain versions of NEURON (9.0 and earlier) are not
compatible with `numpy>=2`. Check the numpy version, e.g.,
```
python -c "import numpy; print(numpy.__version__)"
```
If it prints `2.0` or higher, try installing an older version:
```
pip install "numpy<2"
```
(mind the quotes.) Then delete the build directory, reconfigure and compile. If the error persists, carefully check which version of Python NEURON picked up by checking the output of the CMake configure command and make sure that that exact version of Python doesn't pick up an incompatible version of Numpy.
2 changes: 1 addition & 1 deletion nrn_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ packaging
pytest<=8.1.1 # potential bug from 8.2.0 due to parallelism?
pytest-cov
mpi4py<4 # MUSIC not compatible with MPI 4
numpy<2
numpy
find_libpython
2 changes: 1 addition & 1 deletion packaging/python/test_wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ $python_exe -m pip install --upgrade pip
# install numpy, pytest and neuron
# we install setuptools because since python 3.12 it is no more installed
# by default
$python_exe -m pip install "numpy<2" pytest setuptools
$python_exe -m pip install "numpy" pytest setuptools
$python_exe -m pip install $python_wheel
$python_exe -m pip show neuron || $python_exe -m pip show neuron-nightly

Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ def setup_package():
NRN_COLLECT_DIRS = ["bin", "lib", "include", "share"]

docs_require = [] # sphinx, themes, etc
maybe_rxd_reqs = ["numpy<2", "Cython"] if Components.RX3D else []
maybe_rxd_reqs = ["numpy", "Cython"] if Components.RX3D else []
maybe_docs = docs_require if "docs" in sys.argv else []
maybe_test_runner = ["pytest-runner"] if "test" in sys.argv else []

Expand Down Expand Up @@ -510,7 +510,7 @@ def setup_package():
},
cmdclass=dict(build_ext=CMakeAugmentedBuilder, docs=Docs),
install_requires=[
"numpy>=1.9.3,<2",
"numpy>=1.9.3",
"packaging",
"find_libpython",
"setuptools<=70.3.0",
Expand Down

0 comments on commit 46f6c50

Please sign in to comment.