improved logging

This commit is contained in:
Ayzen
2026-06-06 00:52:52 +03:00
parent af6005d68f
commit aea49f6128
65 changed files with 1206 additions and 240 deletions
+7
View File
@@ -11,6 +11,7 @@ from python_app.models.run_config_model import RadarSweepModel
def _parse_args() -> argparse.Namespace:
"""Parse command-line options for the local K209 VISA smoke test."""
parser = argparse.ArgumentParser(description="Acquire one K209 sweep through VISA HiSLIP")
parser.add_argument(
"--resource",
@@ -36,6 +37,7 @@ def _parse_args() -> argparse.Namespace:
def _validate_result(result, expected_points: int) -> None:
"""Raise RuntimeError unless the sweep has the expected point count, monotonic axis, and finite S11/S21."""
if result.x.shape != (expected_points,):
raise RuntimeError(f"Unexpected frequency shape: {result.x.shape}")
s11 = result.trace("s11")
@@ -53,6 +55,11 @@ def _validate_result(result, expected_points: int) -> None:
def main() -> int:
"""Acquire one sweep from a locally connected K209 and validate it end to end.
Opens the VISA session, configures the sweep, validates the result, checks the SCPI
error queue, and prints a summary; raises on any validation or SCPI failure.
"""
args = _parse_args()
sweep = RadarSweepModel(
start_hz=args.start_hz,