Open
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a JAX-compatible backend for ckmutil by refactoring the CKM and diagonalization logic into backend-agnostic implementations and exposing a new ckmutil.jax module, along with CI and documentation updates.
Changes:
- Refactor CKM (
ckmutil.ckm) and modified SVD (ckmutil.diag.msvd) to call backend-agnostic implementations (ckmutil/_ckm_impl.py,ckmutil/_diag_impl.py). - Introduce
ckmutil.jax(plus optional dependencyckmutil[jax]) and add JAX-specific tests + CI job. - Update README with documentation link and JAX usage guidance.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Adds docs link and JAX support section with examples. |
| pyproject.toml | Adds jax optional dependency extra. |
| ckmutil/test_jax.py | New tests validating JAX parity with NumPy + grad/vmap behavior. |
| ckmutil/test_ckm.py | Adjusts imports to avoid relying on NumPy symbols from ckmutil.ckm. |
| ckmutil/jax/init.py | New JAX wrapper module exposing JAX-compatible functions via shared implementations. |
| ckmutil/diag.py | Refactors msvd to use the backend-agnostic _msvd implementation. |
| ckmutil/ckm.py | Refactors CKM functions to use backend-agnostic implementations. |
| ckmutil/_diag_impl.py | New backend-agnostic implementation of msvd. |
| ckmutil/_ckm_impl.py | New backend-agnostic implementations of CKM conversion/matrix functions. |
| .github/workflows/test.yml | Adds a dedicated test-jax CI job running JAX tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This makes ckmutil JAX-compatible.
JAX is an optional dependency and there is no API change when not using JAX (all JAXified functions live under
ckmutil.jax).Code duplication is minimal.
A short note is added to the Readme.