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

[python] Support NumPy 2 #2934

Merged
merged 2 commits into from
Oct 16, 2024
Merged

[python] Support NumPy 2 #2934

merged 2 commits into from
Oct 16, 2024

Conversation

johnkerl
Copy link
Member

@johnkerl johnkerl commented Aug 27, 2024

Issue and/or context: #2536

Changes:

Notes for Reviewer:

Main thing to watch for: NumPy 2.0 does not support Python 3.8, while we have not yet dropped support for Python 3.8 (#2141).

Per https://github.com/numpy/numpy/releases/tag/v2.0.0:

The Python versions supported by this release are 3.9-3.12.

I thought we'd need a bit in setup.py like

        # There is no Python 3.8 support for NumPy 2
        "numpy<2; python_version<'3.9'",
        "numpy; python_version>='3.9'",

but in hindsight it seems not -- a Python 3.8 asking to get NumPy will simply not be offered version 2 in the first place 😎

Copy link

codecov bot commented Aug 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.33%. Comparing base (2942ea2) to head (03eb9a8).
Report is 47 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2934      +/-   ##
==========================================
+ Coverage   83.22%   83.33%   +0.10%     
==========================================
  Files          51       51              
  Lines        5462     5462              
==========================================
+ Hits         4546     4552       +6     
+ Misses        916      910       -6     
Flag Coverage Δ
python 83.33% <ø> (+0.10%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
python_api 83.33% <ø> (+0.10%) ⬆️
libtiledbsoma ∅ <ø> (∅)

@johnkerl
Copy link
Member Author

johnkerl commented Aug 27, 2024

Oddly, the "Show package versions" bit in
https://github.com/single-cell-data/TileDB-SOMA/actions/runs/10585607673/job/29332572332?pr=2934
is showing even for Python 3.11

Run python scripts/show-versions.py
tiledbsoma.__version__    1.12.0rc0.post106.dev3370075614
tiledb.version()          0.31.1
core version              2.25.0
anndata.__version__  (ad) 0.10.8
numpy.__version__    (np) 1.26.4 <--------------- we are not getting numpy 2.1 installed :(
pandas.__version__   (pd) 2.2.2
pyarrow.__version__  (pa) 17.0.0
scanpy.__version__   (sc) 1.10.2
scipy.__version__    (sp) 1.14.1
python__version__         3.[11](https://github.com/single-cell-data/TileDB-SOMA/actions/runs/10585607673/job/29332572332?pr=2934#step:9:12).9

🤔

@johnkerl
Copy link
Member Author

I just pushed a rebase. Good news: this time (unlike before) we do get numpy 2
https://github.com/single-cell-data/TileDB-SOMA/actions/runs/11347335957/job/31558479564?pr=2934

python scripts/show-versions.py
  shell: /usr/bin/bash -e {0}
  env:
    pythonLocation: /opt/hostedtoolcache/Python/[3](https://github.com/single-cell-data/TileDB-SOMA/actions/runs/11347335957/job/31558479564?pr=2934#step:9:3).9.20/x64
    PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.9.20/x6[4](https://github.com/single-cell-data/TileDB-SOMA/actions/runs/11347335957/job/31558479564?pr=2934#step:9:4)/lib/pkgconfig
    Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.9.20/x64
    Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.9.20/x64
    Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.9.20/x64
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.9.20/x64/lib
tiledbsoma.__version__    1.1[5](https://github.com/single-cell-data/TileDB-SOMA/actions/runs/11347335957/job/31558479564?pr=2934#step:9:5).0rc0.post28.dev4289275158
tiledb.version()          0.32.3
core version              2.2[6](https://github.com/single-cell-data/TileDB-SOMA/actions/runs/11347335957/job/31558479564?pr=2934#step:9:6).2
anndata.__version__  (ad) 0.10.9
numpy.__version__    (np) 2.0.2
pandas.__version__   (pd) 2.2.3
pyarrow.__version__  (pa) 1[7](https://github.com/single-cell-data/TileDB-SOMA/actions/runs/11347335957/job/31558479564?pr=2934#step:9:7).0.0
scanpy.__version__   (sc) 1.10.3
scipy.__version__    (sp) 1.13.1
python__version__         3.9.20

@johnkerl johnkerl force-pushed the kerl/numpy-2 branch 3 times, most recently from ef117ae to ce860c5 Compare October 15, 2024 15:44
@johnkerl johnkerl changed the title [python] NumPy 2 experiment [WIP] [python] NumPy 2 experiment Oct 15, 2024
@johnkerl johnkerl requested a review from nguyenv October 15, 2024 15:48
@johnkerl
Copy link
Member Author

Trying to add @kounelisagis as a reviewer ...

@johnkerl johnkerl marked this pull request as ready for review October 15, 2024 16:26
Copy link
Collaborator

@kounelisagis kounelisagis left a comment

Choose a reason for hiding this comment

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

Thanks!

@johnkerl johnkerl changed the title [python] NumPy 2 experiment [python] Support NumPy 2 Oct 16, 2024
@johnkerl johnkerl merged commit 0425fb4 into main Oct 16, 2024
21 checks passed
@johnkerl johnkerl deleted the kerl/numpy-2 branch October 16, 2024 12:05
github-actions bot pushed a commit that referenced this pull request Oct 28, 2024
* [python] NumPy 2 experiment [WIP]

* fixups from latest CI run
johnkerl added a commit that referenced this pull request Oct 28, 2024
* [python] NumPy 2 experiment [WIP]

* fixups from latest CI run

Co-authored-by: John Kerl <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants