Skip to content

v0.4.1 - new-style keys, better contracts

Choose a tag to compare

@keraJLi keraJLi released this 06 Feb 16:03
· 55 commits to main since this release

v0.4.1 - new-style keys, better contracts

Improvements

  • New-style JAX PRNG keys - BatchedSpace and VmapEnvsWrapper now expect jax.random.key() instead of the old-style jax.random.PRNGKey().
  • Jumanji obs structure preserved - Spec conversion now uses Spec._constructor to faithfully reconstruct observation pytrees (namedtuples, etc.) instead of flattening them into dicts.
  • PyTreeSpace can now be empty - Removed the restriction requiring at least one leaf, which was too strict for some use cases.
  • Navix obs space workaround - Clamped observation space n to a minimum of 10 to work around navix#109.

Testing

  • Shared contract helpers - Moved contract.py to tests/ and added a unified assert_obs_matches_space checker. All adapter tests now use the same obs validation instead of ad-hoc callbacks.
  • Wrapper contract smoke tests - Every wrapper now gets a contract smoke test (reset/step shapes, info fields, obs containment) via a single parametrized test.
  • TestInfo uses Container - Switched from FrozenPyTreeNode for adherence to Info protocol.

Full Changelog: v0.4.0...v0.4.1