diff --git a/src/robofish/io/validation.py b/src/robofish/io/validation.py index f8ae264c83f8314deab290db71bd2318da939f71..c5ac4a68766ea5dd8ff66cd2ebf087d42879818a 100644 --- a/src/robofish/io/validation.py +++ b/src/robofish/io/validation.py @@ -113,9 +113,7 @@ def validate(iofile: File, strict_validate: bool = True) -> (bool, str): if a in sampling: assert_validate_type(sampling[a], a_type, a, f"sampling {s_name}") - if "frequency_hz" in sampling.attrs: - pass - elif "monotonic_time_points_us" in sampling: + if "monotonic_time_points_us" in sampling: time_points = sampling["monotonic_time_points_us"] # 1 dimensional array assert_validate( @@ -138,12 +136,13 @@ def validate(iofile: File, strict_validate: bool = True) -> (bool, str): "Dimensionality of calendar_time_points should be 1", f"sampling {s_name}", ) - assert_validate( - calendar_points.shape[0] == time_points.shape[0], - "The length of calendar points (%d) does not match the length of monotonic points (%d)" - % (calendar_points.shape[0], time_points.shape[0]), - f"sampling {s_name}", - ) + if "monotonic_time_points_us" in sampling: + assert_validate( + calendar_points.shape[0] == time_points.shape[0], + "The length of calendar points (%d) does not match the length of monotonic points (%d)" + % (calendar_points.shape[0], time_points.shape[0]), + f"sampling {s_name}", + ) # validate iso8601, this validates the dtype implicitly for c in calendar_points.asstr(encoding="utf-8"):