Skip to content

Commit

Permalink
CR 2375: time_type.py -- mark microseconds explicitly. Format test_ty…
Browse files Browse the repository at this point in the history
…pe.py with Black. Add isoformat to spellcheck CI"
  • Loading branch information
Ahmad-Bamba committed Mar 11, 2024
1 parent a5805aa commit c572884
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/actions/spelling/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ isdir
isfile
isinstance
isnumeric
isoformat
Isr
issubclass
iterdir
Expand Down Expand Up @@ -246,6 +247,7 @@ testbuild
testimpl
textwrap
timebase
timespec
toctree
todo
toolchain
Expand Down
4 changes: 2 additions & 2 deletions src/fprime/common/models/serialize/time_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,10 +289,10 @@ def to_readable(self, time_zone=None):

# If we could convert to a valid datetime, use that, otherwise, format
if dt:
# datetime.isoformat() returns time string with microsecond
# datetime.isoformat() returns time string with microsecond
# precision.
# This line can be changed for other precisions or needs.
return dt.isoformat()
return dt.isoformat(timespec="microseconds")
return "%s: %d.%06ds, context=%d" % (
TimeBase(self.__timeBase.val).name,
self.__secs.val,
Expand Down
1 change: 1 addition & 0 deletions src/fprime/common/models/serialize/type_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
@author: reder
Replaced type base class with decorators
"""

import abc

from .type_exceptions import AbstractMethodException
Expand Down

0 comments on commit c572884

Please sign in to comment.