Skip to content
Snippets Groups Projects
Commit 1347de18 authored by mhocke's avatar mhocke
Browse files

Fix #11: local variable 'time_points' referenced before assignment

parent e62d5981
Branches
Tags
1 merge request!10Fix #11: local variable 'time_points' referenced before assignment
Pipeline #37754 passed
...@@ -113,9 +113,7 @@ def validate(iofile: File, strict_validate: bool = True) -> (bool, str): ...@@ -113,9 +113,7 @@ def validate(iofile: File, strict_validate: bool = True) -> (bool, str):
if a in sampling: if a in sampling:
assert_validate_type(sampling[a], a_type, a, f"sampling {s_name}") assert_validate_type(sampling[a], a_type, a, f"sampling {s_name}")
if "frequency_hz" in sampling.attrs: if "monotonic_time_points_us" in sampling:
pass
elif "monotonic_time_points_us" in sampling:
time_points = sampling["monotonic_time_points_us"] time_points = sampling["monotonic_time_points_us"]
# 1 dimensional array # 1 dimensional array
assert_validate( assert_validate(
...@@ -138,6 +136,7 @@ def validate(iofile: File, strict_validate: bool = True) -> (bool, str): ...@@ -138,6 +136,7 @@ def validate(iofile: File, strict_validate: bool = True) -> (bool, str):
"Dimensionality of calendar_time_points should be 1", "Dimensionality of calendar_time_points should be 1",
f"sampling {s_name}", f"sampling {s_name}",
) )
if "monotonic_time_points_us" in sampling:
assert_validate( assert_validate(
calendar_points.shape[0] == time_points.shape[0], calendar_points.shape[0] == time_points.shape[0],
"The length of calendar points (%d) does not match the length of monotonic points (%d)" "The length of calendar points (%d) does not match the length of monotonic points (%d)"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment