glass icon indicating copy to clipboard operation
glass copied to clipboard

gh-402: add NumPy-like interface for JAX RNGs

Open Saransh-cpp opened this issue 8 months ago • 8 comments

Description

This PR adds a NumPy-like interface for JAX RNGs (taken from https://github.com/glass-dev/rng-jax) and attempts to create a dispatching mechanism for the pytest fixture.

Refs: #402

Checks

  • [X] Is your code passing linting?
  • [X] Is your code passing tests?
  • [X] Have you added additional tests (if required)?
  • [X] Have you modified/extended the documentation (if required)?
  • [ ] Have you added a one-liner changelog entry above (if required)?

Saransh-cpp avatar Apr 25 '25 13:04 Saransh-cpp

Requesting a review to start discussions/get suggestions 🙂

Saransh-cpp avatar Apr 25 '25 21:04 Saransh-cpp

@paddyroddy @ntessore this should now be ready for a review. I want to run the API design through you both before writing any tests.

The API design that I have in mind:

I think this looks nice

paddyroddy avatar Apr 30 '25 14:04 paddyroddy

The API design that I have in mind:

I like the design. Can we stick jax-specific functionality into a glass.jax namespace so that the optional dependency is clearly isolated?

ntessore avatar Apr 30 '25 16:04 ntessore

pre-commit.ci autofix

Saransh-cpp avatar Apr 30 '25 17:04 Saransh-cpp

The RTD failure looks unrelated.

Saransh-cpp avatar May 01 '25 14:05 Saransh-cpp

Could we test using xp and urng somewhere here? I suspect it would not look great in the logs because we use the modules itself as the labels of the xp fixture. Might make more sense to use the keys as the labels?

ntessore avatar May 01 '25 17:05 ntessore

Oops, the ids were actually not required. Everything looks nice now. See #595's test run for logs.

Saransh-cpp avatar May 01 '25 19:05 Saransh-cpp

This is now blocked by #619

Saransh-cpp avatar May 07 '25 11:05 Saransh-cpp