docs: update documentation files and fix linting issues
This commit is contained in:
@@ -21,19 +21,24 @@ class TestPhaseSpaceAPI:
|
||||
result = ps(np.array([3.0]))
|
||||
assert isinstance(result, np.ndarray)
|
||||
|
||||
|
||||
class TestPhaseSpaceProperties:
|
||||
"""Shared property tests for PhaseSpace."""
|
||||
|
||||
@pytest.mark.property
|
||||
@pytest.mark.parametrize("W", [
|
||||
[1.5],
|
||||
[1.1, 2.0, 3.0],
|
||||
np.linspace(1.01, 4.9, 20),
|
||||
])
|
||||
@pytest.mark.parametrize(
|
||||
"W",
|
||||
[
|
||||
[1.5],
|
||||
[1.1, 2.0, 3.0],
|
||||
np.linspace(1.01, 4.9, 20),
|
||||
],
|
||||
)
|
||||
def test_non_negative(self, W):
|
||||
"""Phase space must be non-negative (zero at boundaries)."""
|
||||
ps = PhaseSpace(W0=5.0)
|
||||
from tests.common.test_property_tests import _test_non_negative_values
|
||||
|
||||
_test_non_negative_values(ps, W, component_name="PhaseSpace")
|
||||
|
||||
@pytest.mark.quality
|
||||
@@ -43,15 +48,20 @@ class TestPhaseSpaceProperties:
|
||||
ps = PhaseSpace(W0=5.0)
|
||||
W = np.linspace(1.1, 4.9, n)
|
||||
from tests.common.test_property_tests import _test_output_shape_preserved
|
||||
|
||||
_test_output_shape_preserved(ps, W, component_name="PhaseSpace")
|
||||
|
||||
@pytest.mark.quality
|
||||
@pytest.mark.parametrize("W", [
|
||||
np.linspace(1.01, 4.99, 50),
|
||||
np.linspace(1.001, 4.999, 100),
|
||||
])
|
||||
@pytest.mark.parametrize(
|
||||
"W",
|
||||
[
|
||||
np.linspace(1.01, 4.99, 50),
|
||||
np.linspace(1.001, 4.999, 100),
|
||||
],
|
||||
)
|
||||
def test_stability(self, W):
|
||||
"""Phase space must be stable across the full energy range."""
|
||||
ps = PhaseSpace(W0=5.0)
|
||||
from tests.common.test_property_tests import _test_full_range_stability
|
||||
|
||||
_test_full_range_stability(ps, W, component_name="PhaseSpace")
|
||||
|
||||
Reference in New Issue
Block a user