text string |
|---|
if int(actual["phase_unwrap_abs_total"][state]) != expected["phase_unwrap_abs_total"][state]: |
failures.append(f"{run_id}: unwrap {state}") |
for key, rel, absolute in ( |
("gradient_ptp_hz", 0.05, 0.5), |
("zeeman_correction_ptp_hz", 0.10, 0.0002), |
("quadrupole_correction_ptp_hz", 0.10, 0.003), |
("residual_rms_hz", 0.35, 0.015), |
): |
value = float(actual[key]) |
target = float(expected[key]) |
if abs(value - target) > rel * abs(target) + absolute: |
failures.append(f"{run_id}: {key} got={value:.4g} ref={target:.4g}") |
> assert not failures, "run diagnostics mismatch:\n" + "\n".join(failures) |
E AssertionError: run diagnostics mismatch: |
E run_01: unwrap R |
E run_01: unwrap L |
E run_02: unwrap L |
E run_03: unwrap R |
E run_03: unwrap L |
E run_04: unwrap R |
E run_04: unwrap L |
E run_05: unwrap L |
E run_06: unwrap R |
E run_06: unwrap L |
E run_07: unwrap R |
E run_08: unwrap R |
E run_08: unwrap L |
E run_09: unwrap R |
E run_09: unwrap L |
E run_10: unwrap R |
E run_10: unwrap L |
E run_11: unwrap R |
E run_11: unwrap L |
E run_12: unwrap R |
E run_12: unwrap L |
E run_13: unwrap R |
E run_13: unwrap L |
E run_14: unwrap L |
E run_15: unwrap L |
E run_16: unwrap R |
E run_16: unwrap L |
E assert not ['run_01: unwrap R', 'run_01: unwrap L', 'run_02: unwrap L', 'run_03: unwrap R', 'run_03: unwrap L', 'run_04: unwrap R', ...] |
/verifier/test_outputs.py:604: AssertionError |
==================================== PASSES ==================================== |
=========================== short test summary info ============================ |
PASSED ::test_frozen_inputs_unmodified |
PASSED ::test_required_artifacts_and_structure |
PASSED ::test_signed_sensitivity_and_calibrations |
PASSED ::test_global_coefficients_and_amplitudes |
PASSED ::test_covariance_and_uncorrelated_combinations |
FAILED ::test_block_frequency_reduction_matches_counts - AssertionError: bloc... |
FAILED ::test_hourly_bins_are_weighted_reductions - AssertionError: hourly-bi... |
FAILED ::test_fit_quality_and_run_diagnostics - AssertionError: run diagnosti... |
========================= 3 failed, 5 passed in 0.47s ========================== |
============================= 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 FAILED [ 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_signed_sensitivity_and_calibrations ___________________ |
def test_signed_sensitivity_and_calibrations(): |
data, ref = agent_json(), reference() |
got_sensitivity = np.array( |
[ |
data["sensitivity"]["coeff_const_hz"], |
data["sensitivity"]["coeff_mj2_hz"], |
data["sensitivity"]["k_pair_hz"], |
], |
dtype=float, |
) |
assert np.all(np.isfinite(got_sensitivity)) |
assert np.allclose(got_sensitivity, ref["sensitivity"], rtol=0.03, atol=0) |
assert math.isclose( |
got_sensitivity[2], 12 * got_sensitivity[1], rel_tol=0.02 |
) |
got_cal = np.array( |
[ |
data["calibrations"]["zeeman_beta_hz_per_G2"], |
data["calibrations"]["quadrupole_slope_hz_per_khz"], |
], |
dtype=float, |
) |
> assert np.allclose(got_cal, [ZEEMAN_TRUTH, QUADRUPOLE_TRUTH], rtol=0.08) |
E assert False |
E + where False = <function allclose at 0x74fbdc7c9e70>(array([0.59596611, 0.0271582 ]), [0.509, 0.027], rtol=0.08) |
E + where <function allclose at 0x74fbdc7c9e70> = np.allclose |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.