Skip to content

Update Python version requirements and installation instructions - #1398

Open
Sachuriga wants to merge 3 commits into
cortex-lab:masterfrom
Sachuriga:master
Open

Update Python version requirements and installation instructions#1398
Sachuriga wants to merge 3 commits into
cortex-lab:masterfrom
Sachuriga:master

Conversation

@Sachuriga

Copy link
Copy Markdown

Update Python version requirements and installation instructions in README and pyproject.toml

@rossant

rossant commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Thanks for working through the legacy Kwik dependencies! I think it would be simplest if phy[kwik] provided one fully working Kwik setup, including reclustering, rather than having different NumPy requirements for different parts of the GUI.

Since reclustering requires numpy<1.24, could we put numpy>=1.23,<1.24 in the kwik extra and document that the legacy Kwik GUI requires Python 3.10 or 3.11?

The main phy dependencies could then remain on numpy>=1.23 without an upper bound, and requires-python could remain >=3.10. This would keep the legacy constraints isolated to users who explicitly install phy[kwik], while allowing regular phy users to use NumPy 2 and newer Python versions.

Also, could we move the new ExampleReclusterPlugin and its associated configuration and documentation changes into a separate PR? It looks like a useful addition, but it’s independent from the Python and Kwik packaging changes. Keeping the two changes separate would make them easier to review and test.

Thanks again!

@rossant

rossant commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Thanks for the update and for working through these tricky legacy dependencies!

Could we keep phy[kwik] for the legacy Kwik GUI, with numpy>=1.23,<1.24, and document that it requires Python 3.10 or 3.11?

Could we also move the new reclustering plugin and related changes into a separate PR? It would help keep this PR focused.

One small detail: the changes reference phy[recluster], but only phy[kwik] is defined.

Thanks again!

@Sachuriga

Sachuriga commented Jul 23, 2026 via email

Copy link
Copy Markdown
Author

@Sachuriga

Copy link
Copy Markdown
Author

Hi, yes will work on that.

phy's own code uses no numpy API removed in 2.0, so the main dependency set
moves to numpy>=1.23 with no upper bound and requires-python stays >=3.10.
Regular users get numpy 2.x and Python 3.13.

Everything the legacy Kwik GUI needs is confined to the kwik extra, which
provides one self-contained, fully working setup -- opening .kwik files,
curating them, and the recluster action (shift+ctrl+K, re-running KlustaKwik2):

  numpy>=1.23,<1.24  the last numpy the legacy klusta/klustakwik2 stack was
                     written against; keeps the whole Kwik surface on tested
                     ground. Caps the Kwik GUI at Python 3.10-3.11 (numpy 1.23
                     ships no cp312 wheels).
  setuptools<81      klusta/__init__.py imports pkg_resources, dropped in 81
  six                klusta declares no dependencies of its own

The numpy pin is deliberately conservative rather than strictly required:
reclustering runs on newer numpy (verified via klusta.launch.cluster(), the
function the GUI action calls, on numpy 1.26.4), and even numpy 2 works once
ndarray.tostring() -> .tobytes() in klusta/kwik/h5.py and
klustakwik2/precomputations.py is fixed upstream. Pinning to <1.24 trades those
newer versions for a single tested baseline; the cap can be relaxed later.

Verified: phy[kwik] resolves on Python 3.11 (numpy 1.23.5, scipy 1.15.3) and the
full KwikCreator -> KwikModel -> launch.cluster() round-trip passes.
@rossant

rossant commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Thanks! I updated the PR branch on top of current master and adapted the changes to our uv-first workflow. Could you review the edits and let us know what you think?

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.

2 participants