docs: update documentation files and fix linting issues
This commit is contained in:
@@ -10,20 +10,18 @@ seconds to complete. They are intended for CI/full test runs, not for
|
||||
fast feedback during development.
|
||||
"""
|
||||
|
||||
from typing import List
|
||||
|
||||
import numpy as np
|
||||
import pytest
|
||||
from hypothesis import given, settings, strategies as st
|
||||
|
||||
from beta_spectrum.components.fermi import FermiFunction
|
||||
from beta_spectrum.components.phase_space import PhaseSpace
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Fermi function: random Z, A, W combinations
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
|
||||
@given(
|
||||
Z=st.integers(min_value=1, max_value=92),
|
||||
A=st.integers(min_value=1, max_value=300),
|
||||
@@ -56,8 +54,7 @@ def test_fermi_monotonic_for_fixed_Z(Z: int):
|
||||
|
||||
diffs = np.diff(result)
|
||||
assert np.all(diffs <= 0), (
|
||||
f"Fermi function not monotonically decreasing for Z={Z}: "
|
||||
f"diffs = {diffs}"
|
||||
f"Fermi function not monotonically decreasing for Z={Z}: " f"diffs = {diffs}"
|
||||
)
|
||||
|
||||
|
||||
@@ -65,6 +62,7 @@ def test_fermi_monotonic_for_fixed_Z(Z: int):
|
||||
# Phase space: random W0, W combinations
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
|
||||
@given(
|
||||
W0=st.floats(min_value=2.0, max_value=10.0, allow_infinity=False, allow_nan=False),
|
||||
W=st.floats(min_value=1.01, max_value=5.0, allow_infinity=False, allow_nan=False),
|
||||
@@ -91,7 +89,9 @@ def test_phase_space_threshold_at_W1(W0: float):
|
||||
ps = PhaseSpace(W0=W0)
|
||||
result = ps(np.array([1.0]))
|
||||
|
||||
assert result[0] == 0.0, f"Phase space should be 0 at W=1 for W0={W0:.2f}, got {result[0]}"
|
||||
assert (
|
||||
result[0] == 0.0
|
||||
), f"Phase space should be 0 at W=1 for W0={W0:.2f}, got {result[0]}"
|
||||
|
||||
|
||||
@given(
|
||||
@@ -103,4 +103,6 @@ def test_phase_space_endpoint_at_W0(W0: float):
|
||||
ps = PhaseSpace(W0=W0)
|
||||
result = ps(np.array([W0]))
|
||||
|
||||
assert result[0] == 0.0, f"Phase space should be 0 at W=W0={W0:.2f}, got {result[0]}"
|
||||
assert (
|
||||
result[0] == 0.0
|
||||
), f"Phase space should be 0 at W=W0={W0:.2f}, got {result[0]}"
|
||||
|
||||
Reference in New Issue
Block a user