Skip to content
Merged
Changes from all commits
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
11 changes: 11 additions & 0 deletions tests/distributions/test_abstract_hyperspherical_distribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from pyrecest.backend import array, linalg, log, pi, sqrt
from pyrecest.distributions import (
AbstractHypersphericalDistribution,
HypersphericalUniformDistribution,
VonMisesFisherDistribution,
)

Expand Down Expand Up @@ -68,6 +69,16 @@ def test_mean_direction_numerical(self):
vmf = VonMisesFisherDistribution(mu, kappa)
self.assertLess(linalg.norm(vmf.mean_direction_numerical() - mu), 1e-6)

@unittest.skipIf(
pyrecest.backend.__backend_name__ == "jax",
reason="Not supported on this backend",
)
def test_mean_direction_numerical_undefined_for_uniform_circle(self):
"""Tests that undefined mean directions are reported explicitly."""
uniform_circle = HypersphericalUniformDistribution(1)
with self.assertRaisesRegex(ValueError, "Mean direction is undefined"):
uniform_circle.mean_direction_numerical()

def test_plotting_error_free_1d(self):
"""Tests the plotting function for circular distributions."""

Expand Down