-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move some utliity and update parameter-name generation
- Loading branch information
1 parent
02709b1
commit effefc1
Showing
3 changed files
with
39 additions
and
23 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import isodate | ||
|
||
|
||
def seconds_to_iso_8601_duration(seconds: int) -> str: | ||
duration = isodate.Duration(seconds=seconds) | ||
iso_duration = isodate.duration_isoformat(duration) | ||
|
||
# TODO: find a better way to format these | ||
# Use PT24H instead of P1D | ||
if iso_duration == "P1D": | ||
iso_duration = "PT24H" | ||
|
||
# iso_duration defaults to P0D when seconds is 0 | ||
if iso_duration == "P0D": | ||
iso_duration = "PT0S" | ||
|
||
return iso_duration | ||
|
||
|
||
def convert_to_meter(level: int) -> str: | ||
level = str(float(level) / 100) | ||
return level |
effefc1
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.
API Unit Test Coverage Report
API Unit Test Coverage Summary