Skip to content
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

Update io.py to change metadata dates into a more readable format #33

Merged
merged 2 commits into from
Nov 11, 2024

Conversation

claaslendt
Copy link
Contributor

Hej everyone,

I am unsure about the current dateformat for the metadata of the GT3X files. It may be more user friendly if the date is formatted into a more readable datetime format instead of .NET ticks.

I changed the _format_time function inside io.py accordingly.

datetime format for metadata
@Trybnetic
Copy link
Owner

Thanks for pointing that out and I agree that the datetime format here is a better choice. However, I am a bit unsure whether its best to format the np.datetime64 object as str, given that you might want to further use the meta data dict? Also the test_loading_metadata test in tests/test_io.py fails now because of the failed format and needs adjustment.

@claaslendt
Copy link
Contributor Author

I'd say it's somewhat cleaner this way and potentially more flexible. I have updated the test_io.py to reflect the change.

Copy link

codecov bot commented Nov 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 72.02%. Comparing base (79b8384) to head (a59f7bd).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #33   +/-   ##
=======================================
  Coverage   72.02%   72.02%           
=======================================
  Files           8        8           
  Lines         579      579           
=======================================
  Hits          417      417           
  Misses        162      162           
Flag Coverage Δ
unittests 72.02% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Owner

@Trybnetic Trybnetic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I played a bit around with it and agree that it is cleaner and for most applications anyway better to have it as a string.

Thanks again for this PR!

@Trybnetic Trybnetic merged commit 7ad362c into Trybnetic:main Nov 11, 2024
6 checks passed
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