Skip to content

Parse duration-string TestTime/StepTime columns to seconds#4

Open
simontaurus wants to merge 1 commit into
mainfrom
fix/parse-duration-time-columns
Open

Parse duration-string TestTime/StepTime columns to seconds#4
simontaurus wants to merge 1 commit into
mainfrom
fix/parse-duration-time-columns

Conversation

@simontaurus

Copy link
Copy Markdown

Problem

Maccor Export 1 and MIMS Client 2 export TestTime/StepTime as duration
strings (Nd HH:MM:SS[,ff], decimal comma possible) instead of seconds, so those
columns come back non-numeric. The other text formats already provide seconds.

Fix

  • Add maccor_utility.helper_functions.parse_duration_to_seconds (numeric inputs
    pass through; unrecognised values become NaN).
  • In MaccorDataTxtFile.read, apply it to the TestTime/StepTime columns when
    they are non-numeric.

Tests

  • Unit test for the helper.
  • Integration test over trimmed real Export 1 and MIMS Client 2 samples (a few
    complete cycles each, under tests/data/): TestTime is numeric, NaN-free,
    and monotonically non-decreasing.

Maccor Export 1 and MIMS Client 2 text exports report TestTime/StepTime as
duration strings (Nd HH:MM:SS[,ff]) instead of seconds, leaving those columns
non-numeric. Add parse_duration_to_seconds and apply it to TestTime/StepTime
when they are non-numeric, so every text format yields numeric seconds.

Add a unit test for the helper and an integration test over trimmed Export 1
and MIMS Client 2 sample files (a few complete cycles each).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants