added white theme, some features to processing and saving
This commit is contained in:
@@ -31,6 +31,11 @@ class NpzStore(StoreApi):
|
||||
self._root_dir = root_dir
|
||||
self._root_dir.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
@staticmethod
|
||||
def _vna_json_output_dir(output_root_dir: Path, output_stem: str) -> Path:
|
||||
"""Return per-export directory for VNA history JSON files."""
|
||||
return output_root_dir / output_stem
|
||||
|
||||
def save_set(self, kind: str, radar_key: str, set_name: str, collection: SweepCollection) -> None:
|
||||
"""Persist named preprocess set as NPZ and metadata JSON."""
|
||||
set_dir = self._set_dir(kind, radar_key)
|
||||
@@ -217,7 +222,9 @@ class NpzStore(StoreApi):
|
||||
output_stem = sanitize_path_component(output_stem)
|
||||
|
||||
output_root_dir.mkdir(parents=True, exist_ok=True)
|
||||
output_path = output_root_dir / f"{output_stem}_vna_bscan_history.json"
|
||||
output_dir = self._vna_json_output_dir(output_root_dir, output_stem)
|
||||
output_dir.mkdir(parents=True, exist_ok=True)
|
||||
output_path = output_dir / f"{output_stem}_vna_bscan_history.json"
|
||||
if output_path.exists():
|
||||
raise FileExistsError(f"Output JSON file already exists: {output_path}")
|
||||
|
||||
@@ -253,6 +260,7 @@ class NpzStore(StoreApi):
|
||||
summary["channel"] = str(channel)
|
||||
summary["primary_stage"] = str(primary_stage)
|
||||
summary["output_stem"] = output_stem
|
||||
summary["output_dir"] = str(output_dir)
|
||||
summary["output_path"] = str(output_path)
|
||||
return output_path, summary
|
||||
|
||||
@@ -275,6 +283,8 @@ class NpzStore(StoreApi):
|
||||
output_stem = output_name.strip() or datetime.utcnow().strftime("snapshot_%Y%m%d_%H%M%S")
|
||||
output_stem = sanitize_path_component(output_stem)
|
||||
output_root_dir.mkdir(parents=True, exist_ok=True)
|
||||
output_dir = self._vna_json_output_dir(output_root_dir, output_stem)
|
||||
output_dir.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
selected_raw, selected_preprocessed, selected_results, selection_summary = select_aligned_histories(
|
||||
raw_history,
|
||||
@@ -296,7 +306,7 @@ class NpzStore(StoreApi):
|
||||
output_paths: list[Path] = []
|
||||
payloads: list[dict[str, Any]] = []
|
||||
for input_index, output_index in combos:
|
||||
output_path = output_root_dir / (
|
||||
output_path = output_dir / (
|
||||
f"{output_stem}_i{input_index}_o{output_index}_{channel}_vna_bscan_history.json"
|
||||
)
|
||||
if output_path.exists():
|
||||
@@ -330,6 +340,7 @@ class NpzStore(StoreApi):
|
||||
summary["channel"] = str(channel)
|
||||
summary["primary_stage"] = str(primary_stage)
|
||||
summary["output_stem"] = output_stem
|
||||
summary["output_dir"] = str(output_dir)
|
||||
summary["output_paths"] = [str(path) for path in output_paths]
|
||||
return output_paths, summary
|
||||
|
||||
|
||||
Reference in New Issue
Block a user