text string |
|---|
============================= test session starts ============================== |
platform linux -- Python 3.12.13, pytest-8.4.1, pluggy-1.6.0 -- /usr/local/bin/python3 |
rootdir: /app |
configfile: ../dev/null |
plugins: json-ctrf-0.3.5 |
collecting ... collected 8 items |
::test_frozen_inputs_unmodified PASSED [ 12%] |
::test_required_artifacts_and_structure PASSED [ 25%] |
::test_signed_sensitivity_and_calibrations PASSED [ 37%] |
::test_block_frequency_reduction_matches_counts FAILED [ 50%] |
::test_hourly_bins_are_weighted_reductions FAILED [ 62%] |
::test_global_coefficients_and_amplitudes PASSED [ 75%] |
::test_covariance_and_uncorrelated_combinations PASSED [ 87%] |
::test_fit_quality_and_run_diagnostics FAILED [100%] |
=================================== FAILURES =================================== |
________________ test_block_frequency_reduction_matches_counts _________________ |
def test_block_frequency_reduction_matches_counts(): |
got = agent_blocks() |
ref = reference()["blocks"] |
keys = [ |
"run_id", |
"block_id", |
"t_s", |
"freq_R_hz", |
"freq_L_hz", |
"freq_bar_hz", |
"sigma_bar_hz", |
"field_gauss", |
"axial_khz", |
"zeeman_correction_hz", |
"quadrupole_correction_hz", |
"corrected_hz", |
"unwrap_R", |
"unwrap_L", |
] |
assert list(got[0]) == keys |
failures = [] |
for index, (actual, expected) in enumerate(zip(got, ref, strict=True)): |
if actual["run_id"] != expected["run_id"]: |
failures.append(f"row {index}: run_id") |
continue |
for key in ("block_id", "unwrap_R", "unwrap_L"): |
if int(float(actual[key])) != int(expected[key]): |
failures.append(f"row {index}: {key}") |
for key in ("freq_R_hz", "freq_L_hz", "freq_bar_hz", "corrected_hz"): |
if abs(float(actual[key]) - expected[key]) > 0.16: |
failures.append(f"row {index}: {key}") |
sigma = float(actual["sigma_bar_hz"]) |
if not (0.45 * expected["sigma_bar_hz"] <= sigma <= 2.2 * expected["sigma_bar_hz"]): |
failures.append(f"row {index}: sigma_bar_hz") |
for key in ( |
"field_gauss", |
"axial_khz", |
"zeeman_correction_hz", |
"quadrupole_correction_hz", |
): |
tolerance = 2e-5 if key == "field_gauss" else 0.025 |
if abs(float(actual[key]) - expected[key]) > tolerance: |
failures.append(f"row {index}: {key}") |
> assert not failures, "block reduction mismatch:\n" + "\n".join(failures[:40]) |
E AssertionError: block reduction mismatch: |
E row 0: unwrap_R |
E row 0: corrected_hz |
E row 0: zeeman_correction_hz |
E row 0: quadrupole_correction_hz |
E row 1: corrected_hz |
E row 1: zeeman_correction_hz |
E row 1: quadrupole_correction_hz |
E row 2: corrected_hz |
E row 2: zeeman_correction_hz |
E row 2: quadrupole_correction_hz |
E row 3: unwrap_L |
E row 3: corrected_hz |
E row 3: zeeman_correction_hz |
E row 3: quadrupole_correction_hz |
E row 4: corrected_hz |
E row 4: zeeman_correction_hz |
E row 4: quadrupole_correction_hz |
E row 5: unwrap_L |
E row 5: corrected_hz |
E row 5: zeeman_correction_hz |
E row 5: quadrupole_correction_hz |
E row 6: unwrap_L |
E row 6: corrected_hz |
E row 6: zeeman_correction_hz |
E row 6: quadrupole_correction_hz |
E row 7: unwrap_L |
E row 7: corrected_hz |
E row 7: zeeman_correction_hz |
E row 7: quadrupole_correction_hz |
E row 8: corrected_hz |
E row 8: zeeman_correction_hz |
E row 8: quadrupole_correction_hz |
E row 9: corrected_hz |
E row 9: zeeman_correction_hz |
E row 9: quadrupole_correction_hz |
E row 10: corrected_hz |
End of preview. Expand in Data Studio
No dataset card yet
- Downloads last month
- 69