toolkit
Modules:
Classes:
-
BaseConfig– -
Experiment– -
Timer–
Functions:
-
as_dict_of_numpy– -
as_numpy– -
flatten– -
get_running_experiment– -
is_array_like– -
is_jax– -
is_numpy– -
is_subsequence– -
is_torch– -
load_pydantic– -
log_once– -
main– -
merge_mapping–Updates the original dict with the new data. Similar to
dict.update(), but works with nested dicts. -
save_pydantic– -
start– -
strip_comments–
Attributes:
-
critical_once– -
debug_once– -
error_once– -
info_once– -
success_once– -
timer– -
trace_once– -
warning_once–
BaseConfig
Bases: BaseSettings
Methods:
Attributes:
Source code in src/toolkit/exp/_config.py
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | |
model_config
class-attribute
instance-attribute
model_config = SettingsConfigDict(cli_parse_args=True, yaml_file='params.yaml')
settings_customise_sources
classmethod
settings_customise_sources(settings_cls: type[BaseSettings], init_settings: PydanticBaseSettingsSource, env_settings: PydanticBaseSettingsSource, dotenv_settings: PydanticBaseSettingsSource, file_secret_settings: PydanticBaseSettingsSource) -> tuple[PydanticBaseSettingsSource, ...]
Source code in src/toolkit/exp/_config.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | |
Experiment
Methods:
-
__init__– -
get_parameter– -
log_asset– -
log_other– -
log_others– -
log_parameter– -
log_parameters–
Attributes:
-
exp_dir(Path) – -
name(str) – -
project_dir(Path) – -
project_name(str) –
Source code in src/toolkit/exp/_exp.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | |
__init__
__init__(exp: BaseExperiment | None = None) -> None
Source code in src/toolkit/exp/_exp.py
22 23 | |
get_parameter
Source code in src/toolkit/exp/_exp.py
33 34 | |
log_asset
Source code in src/toolkit/exp/_exp.py
42 43 44 45 46 47 48 49 50 51 52 53 | |
log_other
Source code in src/toolkit/exp/_exp.py
66 67 | |
log_others
Source code in src/toolkit/exp/_exp.py
69 70 | |
log_parameter
Source code in src/toolkit/exp/_exp.py
36 37 | |
Timer
Methods:
Attributes:
Source code in src/toolkit/logging/_timer.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | |
__call__
Source code in src/toolkit/logging/_timer.py
35 36 37 38 39 40 41 42 43 44 45 46 47 | |
__enter__
__enter__() -> None
Source code in src/toolkit/logging/_timer.py
49 50 | |
__exit__
__exit__(exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None) -> None
Source code in src/toolkit/logging/_timer.py
52 53 54 55 56 57 58 | |
__init__
Source code in src/toolkit/logging/_timer.py
24 25 26 27 28 29 30 31 32 33 | |
start
start() -> None
Source code in src/toolkit/logging/_timer.py
64 65 | |
stop
stop() -> None
Source code in src/toolkit/logging/_timer.py
67 68 69 70 71 | |
as_dict_of_numpy
Source code in src/toolkit/array/numpy/_utils/_as_numpy.py
20 21 22 23 | |
as_numpy
as_numpy(obj: Any) -> ndarray
Source code in src/toolkit/array/numpy/_utils/_as_numpy.py
12 13 14 15 16 17 | |
flatten
flatten(iterable: _T | Iterable[_T] | Iterable[Iterable[_T]] | Iterable, base_type: tuple[type, ...] = (str, bytes)) -> Iterable[_T]
Source code in src/toolkit/_iter/_sequence.py
9 10 11 12 13 14 15 16 17 18 19 20 21 | |
get_running_experiment
get_running_experiment() -> Experiment
Source code in src/toolkit/exp/_exp.py
73 74 | |
is_array_like
Source code in src/toolkit/array/array_like/_utils.py
4 5 | |
is_jax
Source code in src/toolkit/array/jax/_utils.py
11 12 | |
is_numpy
Source code in src/toolkit/array/numpy/_utils/_is.py
10 11 | |
is_subsequence
Source code in src/toolkit/_iter/_sequence.py
24 25 26 27 28 29 30 31 | |
is_torch
Source code in src/toolkit/array/torch/_utils.py
11 12 | |
load_pydantic
Source code in src/toolkit/serialize/_pydantic.py
11 12 13 | |
log_once
cached
Source code in src/toolkit/logging/once.py
6 7 8 | |
main
main(*, config: dict[str, Any] | None = None, exp_name: str | None = None, log_file: StrPath | None = 'exp.log', log_level: int | str = NOTSET, tags: list[str] | None = None) -> Callable[[Callable[[_C], _T]], Callable[[_C], _T]]
Source code in src/toolkit/exp/_main.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | |
merge_mapping
Updates the original dict with the new data. Similar to dict.update(), but works with nested dicts.
References
- [ConfZ/confz/loaders/loader.py:L10-L28)(https://github.com/Zuehlke/ConfZ/blob/6c99cc2a2938e231590dceeef66749ccf2eb6b4c/confz/loaders/loader.py#L10-L28)
Source code in src/toolkit/_iter/_mapping.py
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | |
save_pydantic
Source code in src/toolkit/serialize/_pydantic.py
16 17 18 19 | |
start
start(*, name: str | None = None, tags: list[str] | None = None) -> Experiment
Source code in src/toolkit/exp/_start.py
51 52 53 54 55 56 57 58 59 60 | |
strip_comments
Source code in src/toolkit/_text/_strip_comments.py
4 5 6 7 8 | |