-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature: raw_timestamps support for writer and defragment #320
Merged
Merged
Changes from 3 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
16e836a
feat: raw_timestamps support for writer and defragment
jimkring 33c0e3a
feat: raw_timestamps support for writer and defragment
jimkring d990f91
Merge remote-tracking branch 'origin/write-raw-timestamps' into write…
jimkring 00b3be3
enum_value as a class attribute, bytes as a property
jimkring 63cfe5f
always reads raw_timestamps on defragment, add test for data round trip
jimkring 8e0e9c5
add test for timestamps round trip
jimkring 077a009
refactor defragementation test
jimkring 5cd13a9
implement __eq__ for TdmsTimestamp type
jimkring d2bbddd
set raw_timestamps=True when reading files
jimkring File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to have a check that if you read in the defragmented file, there hasn't been a loss of precision of the timestamp properties
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@adamreeve great idea. I've added assertions that the
channel.data
andchannel.time_track()
are the same in both the input and output data (usingnp.testing.assert_equal
). I'm not sure if this is checking for loss of precision of the timestamps and could use your input on that.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I don't think that's enough as the time track will be cast down to a numpy datetime64. To check that this test is actually testing the fix, it should fail if we remove
raw_timestamps=True
fromTdmsWriter.defragment
.I think what you'll want to do is pass
raw_timestamps=True
when opening bothoutput_tdms
andinput_tdms
, and then add a check like:To make that work correctly you'll also need to implement
__eq__
forTdmsTimestamp
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@adamreeve BTW, I also just refactored the test_defragment to test more example files. In doing so, I noticed that one of the example files raises an error, due to scalar channel data. However, this error should probably be addressed in a separate issue and PR.