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

Replace usage of datetime library types with hightime types #1449

Merged
merged 4 commits into from
May 19, 2020

Conversation

sbethur
Copy link
Contributor

@sbethur sbethur commented May 14, 2020

  • This contribution adheres to CONTRIBUTING.md.

  • I've updated CHANGELOG.md if applicable.

  • I've added tests applicable for this pull request

What does this Pull Request accomplish?

In all nimi-python modules, change the type of applicable properties and method parameters from datetime.timedelta to hightime.timedelta and from datetime.datetime to hightime.datetime.

hightime types are drop-in replacements for datetime counterparts, with sub-microsecond resolution. See #1445 (comment) for the rationale behind this change.

  • Update code generator to generate code using hightime types
  • Update applicable attribute and function metadata to use hightime types
  • Update nifake unit tests to verify usage of hightime types

List issues fixed by this Pull Request below, if any.

What testing has been done?

Update unit tests for converter and nifake to verify usage of hightime types. CI runs all the tests.

Change the type of applicable properties and method parameters from `datetime.timedelta` to `hightime.timedelta` and from `datetime.datetime` to `hightime.datetime`.
sbethur added 2 commits May 14, 2020 17:56
# Conflicts:
#	build/templates/setup.py.mako
@codecov
Copy link

codecov bot commented May 14, 2020

Codecov Report

Merging #1449 into master will increase coverage by 1.44%.
The diff coverage is 94.44%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1449      +/-   ##
==========================================
+ Coverage   91.92%   93.37%   +1.44%     
==========================================
  Files          20       25       +5     
  Lines        3655     5177    +1522     
==========================================
+ Hits         3360     4834    +1474     
- Misses        295      343      +48     
Flag Coverage Δ
#codegenunittests 88.24% <ø> (ø)
#nidigitalsystemtests 96.91% <ø> (?)
#nifakeunittests 96.40% <100.00%> (+<0.01%) ⬆️
#nifgensystemtests 96.91% <0.00%> (?)
#nimodinstsystemtests 87.23% <ø> (?)
#nimodinstunittests 95.37% <ø> (ø)
#nisesystemtests 100.00% <ø> (?)
#nitclkunittests 95.45% <100.00%> (ø)
Impacted Files Coverage Δ
build/helper/codegen_helper.py 92.44% <ø> (ø)
build/helper/metadata_add_all.py 81.35% <ø> (ø)
generated/nifgen/nifgen/_library.py 96.91% <0.00%> (ø)
generated/nifake/nifake/_attributes.py 94.73% <100.00%> (ø)
generated/nifake/nifake/_converters.py 96.70% <100.00%> (+0.02%) ⬆️
generated/nifake/nifake/session.py 97.69% <100.00%> (ø)
generated/nitclk/nitclk/session.py 95.45% <100.00%> (ø)
generated/nimodinst/nimodinst/_library.py 87.23% <0.00%> (ø)
...digital/nidigital/history_ram_cycle_information.py 100.00% <0.00%> (ø)
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7ad5d73...3a728f8. Read the comment docs.

@sbethur sbethur dismissed marcoskirsch’s stale review May 17, 2020 20:19

Addressed feedback

@sbethur sbethur requested a review from marcoskirsch May 17, 2020 20:19
@marcoskirsch marcoskirsch merged commit 5740196 into master May 19, 2020
@marcoskirsch marcoskirsch deleted the bugs_744_1368_1382_1397/use_hightime branch May 19, 2020 00:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment