shyft.dashboard.time_series.formatter
Functions
|
Create human readable formatting of UTC time |
|
Create human readable formatting of UTC time conditional on dt. |
- shyft.dashboard.time_series.formatter.conditional_time_formatter(time_input: Iterable, time_zone: str | None = None) List[str] [source]
Create human readable formatting of UTC time conditional on dt.
Assumption of an equidistant dt, time in UTC Formatting and converting time values for the table view
Additional time_zone can be provided to convert from UTC to time_zone
Examples
dt == DAY: [‘2018.03.12 (W.11)’, ‘2018.03.13 (W.11)’, ‘2018.03.14 (W.11)’]
dt == WEEK: [‘2018 Week 11’, ‘2018 Week 12’, ‘2018 Week 13’]
dt == MONTH: [‘2018 Mar’, ‘2018 Apr’, ‘2018 May’]
dt == QUARTER: [‘2018 Q.1’, ‘2018 Q.2’, ‘2018 Q.3’]
dt == YEAR: [‘2018’, ‘2019’, ‘2020’]
else: [‘2018.03.12 16:26’, ‘2018.03.12 17:26’, ‘2018.03.12 18:26’]
- Parameters:
time_input (numpy array with utc time) –
time_zone (Optional time_zone to convert time to) –
- Returns:
time_formatted
- Return type:
list with reformatted times
- shyft.dashboard.time_series.formatter.basic_time_formatter(time_input: Iterable, time_zone: str | None = None) List[str] [source]
Create human readable formatting of UTC time
Additional time_zone can be provided to convert from UTC to time_zone
Examples
[‘2018.03.12 16:26’, ‘2018.03.12 17:26’, ‘2018.03.12 18:26’]
- Parameters:
time_input (numpy array with utc time) –
time_zone (Optional time_zone to convert time to) –
- Returns:
time_formatted
- Return type:
list with reformatted times