Skip to content

Commit 3843b46

Browse files
committed
update validate data function to only apply to trails
1 parent 3983c9c commit 3843b46

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

src/graphomotor/core/models.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,14 @@ def validate_timestamps(cls, v: pd.DataFrame) -> pd.DataFrame:
8888
Raises:
8989
ValueError: If the dataframe contains duplicate timestamps.
9090
"""
91-
if v["seconds"].duplicated().any():
92-
raise ValueError("duplicate timestamps in 'seconds'.")
93-
94-
if v["UTC_Timestamp"].duplicated().any():
95-
raise ValueError("duplicate timestamps in 'UTC_Timestamp'.")
91+
if cls.task_name != "trails":
92+
return v
93+
else:
94+
if v["seconds"].duplicated().any():
95+
raise ValueError("duplicate timestamps in 'seconds'.")
96+
97+
if v["UTC_Timestamp"].duplicated().any():
98+
raise ValueError("duplicate timestamps in 'UTC_Timestamp'.")
9699

97100
return v
98101

0 commit comments

Comments
 (0)