Repository navigation
gh-438: Add grad tests for all applicable functions - #1251
Conversation
2c91928 to
deff382
Compare
d8891a8 to
fb2f0aa
Compare
d497974 to
6b0c0f0
Compare
6b0c0f0 to
be78ea4
Compare
Okay, I'll have a look. Wonder if we can force it with, e.g. |
paddyroddy
left a comment
There was a problem hiding this comment.
My comments are stale. I've done various changes to keep the formatting consistent with the rest of the codebase. This is a great piece of work!
I also fixed the readthedocs bug and a JAX bug coming from 0.12.0.
| "ANN202", # missing-return-type-private-function | ||
| "D100", # undocumented-public-module | ||
| "D103", # TODO: undocumented-public-function | ||
| "FBT001", # boolean-type-hint-positional-argument |
| jnp: ModuleType, | ||
| ) -> None: | ||
| """Tests glass.VolumeWeight is auto differentiable.""" | ||
| z = jnp.linspace(0.1, 1, 6, dtype=jnp.float64) |
There was a problem hiding this comment.
Shouldn't need to specify the dtype here as we're using the jnp fixture.
|
|
||
| pytest.importorskip("jax", reason="tests require jax") | ||
|
|
||
| import jax.numpy as jnp |
There was a problem hiding this comment.
I had been expecting this as a series of PRs. Impressive work as one. But things like this would have been caught earlier.
There was a problem hiding this comment.
Yes, in hind-sight multiple PRs would have been better.
connoraird
left a comment
There was a problem hiding this comment.
A few minor comments but I'm happy with it, if you are.
| jnp: ModuleType, | ||
| size_input: int | tuple[int, ...] | None, | ||
| shape_output: tuple[int, ...], | ||
| size_input: int | tuple[int, ...] | None, |
There was a problem hiding this comment.
There are a lot of changes unrelated to this PR in here. Perhaps that's okay since we're nearing the end but just wanted to mention it.
There was a problem hiding this comment.
Totally fair to call out. I just spotted we had stopped following established patterns.
| jobs: | ||
| post_checkout: | ||
| - git fetch --unshallow --tags origin || true |
| def test_apply_visibility(jnp: ModuleType) -> None: | ||
| """Tests glass.points._apply_visibility is auto differentiable.""" | ||
| k = (1, 1) | ||
| n = 24751.77674965 * jnp.ones(12) |
|
This looks good now, going to merge! |
Description
Closes: #438
Changelog entry
Changed: Pinned JAX to
<0.12.0due to a change inmultinomialbehaviour.Checks