rics.ml.time_split.settings#
Global settings for the splitting logic.
Classes
Configuration for the 'auto' |
|
Global settings for the |
|
|
Global settings for the |
- class auto_flex[source]#
Bases:
objectConfiguration for the ‘auto’
Flexlogic.This class determines how
(lo, hi)-tuples are expanded when flexible bounds are enabled.- classmethod set_level(level: Literal['hour', 'day'], *, start_at: str | Timedelta | timedelta | timedelta64, round_to: str | Timedelta | timedelta | timedelta64, tolerance: str | Timedelta | timedelta | timedelta64) None[source]#
Set a
Levelused by the auto-flex logic.Inputs are not verified until an actual split is made.
- Parameters:
level – The level to set; ‘hour’ or ‘day’.
start_at – Span size at which this level starts.
round_to – Frequency to round the range limits to.
tolerance – Maximum amount by which to alter limits.
- Raises:
AttributeError – For unknown level names.
- class Level(start_at: str | Timedelta | timedelta | timedelta64, round_to: str | Timedelta | timedelta | timedelta64, tolerance: str | Timedelta | timedelta | timedelta64)[source]#
Bases:
NamedTupleLevel type used by
auto_flex.- start_at: str | Timedelta | timedelta | timedelta64#
Span size at which this level starts.
- round_to: str | Timedelta | timedelta | timedelta64#
Frequency to round the range limits to.
- tolerance: str | Timedelta | timedelta | timedelta64#
Maximum amount by which to alter limits.
- class plot[source]#
Bases:
objectGlobal settings for the
plot()-function.- THOUSANDS_SEPARATOR_CUTOFF: int = 10000#
Minimum value before bar_labels include a
THOUSANDS_SEPARATOR.
- class log_split_progress[source]#
Bases:
objectGlobal settings for the
log_split_progress()-function.- FOLD_FORMAT: str = "('{start.auto}' <= [schedule: '{mid.auto}' ({mid:%A})] < '{end.auto}')"#
Pretty-printed fold-key for other messages.
Only the
start,mid, andendkeys are available (seeDatetimeSplitBounds). You may use<key>.autoto format as a date when time is zero (this is the default).
Sample output.#('2021-12-30' <= [schedule: '2022-01-04' (Tuesday)] < '2022-01-04 18:00:00')
- SECONDS_FORMATTER: str | Callable[[float], str] = 'rics.performance.format_seconds'#
A callable
(seconds) -> formatted_seconds.Both
secondsandformatted_secondswill be available to theEND_MESSAGEmessage. If a string is given, the actual callable will be resolved usingrics.misc.get_by_full_name().
- START_MESSAGE: str = 'Begin fold {n}/{n_splits}: {fold}.'#
Message indicating that the current fold has been yielded to the user.
Has access to all keys from the previous section, as well as:
The
foldkey (seeFOLD_FORMAT), andThe
nkey, which is the 1-based position of the fold in splits, andThe
n_foldskey, which is justlen(splits).
Sample output.#Begin fold 5/7: ('2021-12-30' <= [schedule: '2022-01-04' (Tuesday)] < '2022-01-04 18:00:00').
- END_MESSAGE: str = "Finished fold {n}/{n_splits} [schedule: '{mid.auto}' ({mid:%A})] after {formatted_seconds}."#
Message indicating that the user is done with the current fold.
Has access to all keys from the previous sections, as well as:
The
secondskey, which is the (fractional) time the user spent in the fold, andThe
formatted_secondskey, obtained using theSECONDS_FORMATTER.
The value of
secondsis obtained usingtime.perf_counter().Sample output.#Finished fold 5/7 [schedule: '2022-01-04' (Tuesday)] after 5m 21s.
- AUTO_DATE_FORMAT = '%Y-%m-%d'#
Short-form timestamp format_spec used by
<key>.auto.
- AUTO_DATETIME_FORMAT = '%Y-%m-%d %H:%M:%S'#
Long-form timestamp format_spec used by
<key>.auto.