the-siesta-group / edfio

Read and write EDF/EDF+ files.
Apache License 2.0
25 stars 5 forks source link

Read more non-standard starttime fields #30

Closed hofaflo closed 6 months ago

hofaflo commented 7 months ago

we could test what happens if the numbers are outside a reasonable range. For example, if the minutes/seconds are not between 0 and 59 or the hours not between 0 and 23. What if the day exceeds the number of days in the selected month or the month is outside the interval 1..12?

There are already tests for invalid month or day in tests/test_header_field.py, but we could add some for seconds/minutes/hours?

This questions might be more relevant when we try to fix broken EDF headers.

Do you mean we could try to reorder day/month/year or hour/minute/second to see if one (and only one) combination is valid?

marcoross commented 7 months ago

There are already tests for invalid month or day in tests/test_header_field.py, but we could add some for seconds/minutes/hours?

That's probably not necessary.

This questions might be more relevant when we try to fix broken EDF headers.

Do you mean we could try to reorder day/month/year or hour/minute/second to see if one (and only one) combination is valid?

No, that would go too far. I was just thinking that when/if we implement an auto-fix option, we should re-consider these tolerances when reading. Because what this effectively does is implement an "auto-fix on access" for date fields without actually fixing the EDF file.