Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: convert to quantity #26

Merged
merged 5 commits into from
Feb 24, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix: flaky test
Signed-off-by: nstarman <[email protected]>
  • Loading branch information
nstarman committed Feb 24, 2024
commit e0b1f3e4021d1a577cfc3dc9f1ba9eae6bb10255
10 changes: 6 additions & 4 deletions tests/test_d3.py
Original file line number Diff line number Diff line change
Expand Up @@ -547,11 +547,13 @@ def test_cartesian3d_to_spherical(self, difntl, vector):
spherical = difntl.represent_as(SphericalDifferential, vector)

assert isinstance(spherical, SphericalDifferential)
assert array_equal(
spherical.d_r,
Quantity([10.344081, 11.832159, 13.379088, 14.966629], u.km / u.s),
assert jnp.allclose(
spherical.d_r.to_value(u.km / u.s),
xp.asarray([10.344081, 11.832159, 13.379088, 14.966629]),
)
assert jnp.allclose(
spherical.d_phi.to_value(u.mas / u.Myr), xp.asarray([0, 0, 0.00471509, 0])
)
assert jnp.allclose(spherical.d_phi.value, xp.asarray([0, 0, 2e-8, 0]))
assert jnp.allclose(
spherical.d_theta.to_value(u.mas / u.Myr),
xp.asarray([0.03221978, -0.05186598, -0.01964621, -0.01886036]),
Expand Down
Loading