text string |
|---|
"t_s", |
"corrected_hz", |
"sigma_hz", |
"n_blocks", |
] |
failures = [] |
for index, (actual, expected) in enumerate(zip(got, ref, strict=True)): |
if ( |
actual["run_id"] != expected["run_id"] |
or int(float(actual["hour_index"])) != expected["hour_index"] |
or int(float(actual["n_blocks"])) != expected["n_blocks"] |
): |
failures.append(f"row {index}: identity/count") |
continue |
if abs(float(actual["corrected_hz"]) - expected["corrected_hz"]) > 0.11: |
failures.append(f"row {index}: corrected_hz") |
if abs(float(actual["t_s"]) - expected["t_s"]) > 900: |
failures.append(f"row {index}: t_s") |
if not ( |
0.45 * expected["sigma_hz"] |
<= float(actual["sigma_hz"]) |
<= 2.2 * expected["sigma_hz"] |
): |
failures.append(f"row {index}: sigma_hz") |
> assert not failures, "hourly-bin mismatch:\n" + "\n".join(failures[:40]) |
E AssertionError: hourly-bin mismatch: |
E row 0: corrected_hz |
E row 1: corrected_hz |
E row 2: corrected_hz |
E row 3: corrected_hz |
E row 4: corrected_hz |
E row 5: corrected_hz |
E row 6: corrected_hz |
E row 7: corrected_hz |
E row 8: corrected_hz |
E row 9: corrected_hz |
E row 10: corrected_hz |
E row 11: corrected_hz |
E row 12: corrected_hz |
E row 13: corrected_hz |
E row 14: corrected_hz |
E row 15: corrected_hz |
E row 16: corrected_hz |
E row 17: corrected_hz |
E row 18: corrected_hz |
E row 19: corrected_hz |
E row 20: corrected_hz |
E row 21: corrected_hz |
E row 22: corrected_hz |
E row 23: corrected_hz |
E row 24: corrected_hz |
E row 25: corrected_hz |
E row 26: corrected_hz |
E row 27: corrected_hz |
E row 28: corrected_hz |
E row 29: corrected_hz |
E row 30: corrected_hz |
E row 31: corrected_hz |
E row 32: corrected_hz |
E row 33: corrected_hz |
E row 34: corrected_hz |
E row 35: corrected_hz |
E row 36: corrected_hz |
E row 37: corrected_hz |
E row 38: corrected_hz |
E row 39: corrected_hz |
E assert not ['row 0: corrected_hz', 'row 1: corrected_hz', 'row 2: corrected_hz', 'row 3: corrected_hz', 'row 4: corrected_hz', 'row 5: corrected_hz', ...] |
/verifier/test_outputs.py:480: AssertionError |
_____________________ test_fit_quality_and_run_diagnostics _____________________ |
def test_fit_quality_and_run_diagnostics(): |
data, ref = agent_json(), reference() |
chi2 = float(data["reduced_chi2"]) |
assert 0.55 <= chi2 <= 1.9 |
assert math.isclose(chi2, ref["global"]["reduced_chi2"], rel_tol=0.25) |
failures = [] |
for run_id, expected in ref["diagnostics"].items(): |
actual = data["runs"].get(run_id) |
assert isinstance(actual, dict), f"missing diagnostics for {run_id}" |
if int(actual["blocks"]) != expected["blocks"]: |
failures.append(f"{run_id}: blocks") |
if int(actual["hourly_bins"]) != expected["hourly_bins"]: |
failures.append(f"{run_id}: hourly_bins") |
for state in ("R", "L"): |
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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.