Skip to content

Commit c762fa9

Browse files
committed
Cast realtime_scan from numpy.bool to bool to allow pydase serialization
1 parent e0ee400 commit c762fa9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/icon/server/data_access/repositories/experiment_data_repository.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ class ExperimentData(TypedDict):
111111
"""Scan parameters as param_id -> {index -> value/timestamp}."""
112112
json_sequences: list[list[int | str]]
113113
"""List of [index, sequence_json] pairs (list for pydase JSON compatibility)."""
114+
realtime_scan: bool
115+
"""Whether the scan is realtime scan."""
114116

115117

116118
def get_filename_by_job_id(job_id: int) -> str:
@@ -602,7 +604,7 @@ def get_experiment_data_by_job_id(
602604
f"{ExperimentDataRepository.LOCK_EXTENSION}"
603605
)
604606
with FileLock(lock_path), h5py.File(file, "r") as h5file:
605-
data["realtime_scan"] = h5file.attrs["realtime_scan"]
607+
data["realtime_scan"] = bool(h5file.attrs["realtime_scan"])
606608
# Parse JSON strings in relevant columns back into Python objects
607609

608610
scan_parameters: npt.NDArray = h5file["scan_parameters"][:] # type: ignore

0 commit comments

Comments
 (0)