Skip to content

feat: numpy 2.x compatibility#240

Open
filimarc wants to merge 11 commits into
mainfrom
feat/update-numpy
Open

feat: numpy 2.x compatibility#240
filimarc wants to merge 11 commits into
mainfrom
feat/update-numpy

Conversation

@filimarc
Copy link
Copy Markdown
Contributor

@filimarc filimarc commented Jun 1, 2026

Summary

  • Replace np.array with np.asarray across bsb-core and bsb-hdf5 (numpy 2.0 changed copy=False semantics)
  • Replace removed np.float_ alias with np.float64 in arborize
  • Remove np.VisibleDeprecationWarning usage in tests (removed in numpy 2.0)
  • Loosen numpy pins from ~=1.x to >=1.x in bsb-core, bsb-arbor, arborize, nrn-patch
  • Loosen quantities pin to >=0.15.0 to allow 0.16.x (required by elephant 1.2.0)
  • Bump internal lib pins to ~=7.4 in bsb-otel, arborize, sphinxext-bsb

close #237

Test plan

  • CI passing on Python 3.10 and 3.12

Generated with Claude Code


📚 Documentation preview 📚: https://nrn-patch--240.org.readthedocs.build/en/240/


📚 Documentation preview 📚: https://arborize--240.org.readthedocs.build/en/240/


📚 Documentation preview 📚: https://bsb-otel--240.org.readthedocs.build/en/240/

filimarc and others added 10 commits May 30, 2026 18:04
- Relax numpy version pins from ~=1.x to >=1.x in bsb-core and bsb-arbor
- Replace np.array(..., copy=False) with np.asarray() across bsb-core and bsb-hdf5 (semantics changed in numpy 2.0)
- Remove np.VisibleDeprecationWarning assertion in test_voxels (removed in numpy 2.0)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- numpy~=1.21 -> numpy>=1.21 in arborize and nrn-patch
- bsb-core~=7.0 -> bsb-core~=7.4 in arborize and sphinxext-bsb

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Allows quantities 0.16.x, compatible with elephant 1.2.0.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…2.0)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
np.array(..., copy=False) without subok=True stripped the Chunk subclass;
bare arithmetic preserved it, causing Chunk.__le__ to trigger on coordinate
comparisons. np.asarray() strips the subclass correctly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions github-actions Bot added the feat label Jun 1, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 1, 2026

Codecov Report

❌ Patch coverage is 96.96970% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 82.89%. Comparing base (80ffbd5) to head (127163e).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
packages/bsb-core/bsb/storage/_chunks.py 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #240      +/-   ##
==========================================
+ Coverage   80.54%   82.89%   +2.34%     
==========================================
  Files         188      135      -53     
  Lines       18179    15414    -2765     
  Branches     2174     1834     -340     
==========================================
- Hits        14642    12777    -1865     
+ Misses       2977     2195     -782     
+ Partials      560      442     -118     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@filimarc filimarc linked an issue Jun 1, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update to 2+ numpy

1 participant