liblaf-cherries 0.0.14__py3-none-any.whl → 0.1.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- liblaf/cherries/__init__.pyi +71 -44
- liblaf/cherries/_run.py +38 -26
- liblaf/cherries/_version.py +2 -2
- liblaf/cherries/config/__init__.pyi +23 -0
- liblaf/cherries/config/_asset.py +72 -0
- liblaf/cherries/config/_config.py +6 -0
- liblaf/cherries/integration/__init__.pyi +66 -0
- liblaf/cherries/integration/_abc.py +144 -0
- liblaf/cherries/integration/_exp.py +97 -0
- liblaf/cherries/integration/comet.py +142 -0
- liblaf/cherries/integration/dvc.py +51 -0
- liblaf/cherries/integration/git.py +44 -0
- liblaf/cherries/integration/logging.py +45 -0
- liblaf/cherries/meta/__init__.py +3 -0
- liblaf/cherries/{info → meta}/__init__.pyi +2 -2
- liblaf/cherries/meta/_name.py +25 -0
- liblaf/cherries/pathutils/__init__.pyi +2 -2
- liblaf/cherries/pathutils/_convert.py +0 -4
- liblaf/cherries/pathutils/_path.py +6 -6
- liblaf/cherries/pathutils/_special.py +2 -2
- liblaf/cherries/presets/__init__.pyi +3 -1
- liblaf/cherries/presets/_default.py +37 -23
- liblaf/cherries/presets/_playground.py +11 -0
- liblaf/cherries/presets/typed.py +5 -0
- {liblaf_cherries-0.0.14.dist-info → liblaf_cherries-0.1.1.dist-info}/METADATA +5 -5
- liblaf_cherries-0.1.1.dist-info/RECORD +40 -0
- liblaf/cherries/_config.py +0 -22
- liblaf/cherries/info/_name.py +0 -30
- liblaf/cherries/plugin/__init__.pyi +0 -77
- liblaf/cherries/plugin/_abc.py +0 -131
- liblaf/cherries/plugin/_dvc.py +0 -63
- liblaf/cherries/plugin/_git.py +0 -46
- liblaf/cherries/plugin/_logging.py +0 -31
- liblaf/cherries/plugin/_mlflow.py +0 -88
- liblaf/cherries/plugin/_run.py +0 -105
- liblaf_cherries-0.0.14.dist-info/RECORD +0 -35
- /liblaf/cherries/{info → config}/__init__.py +0 -0
- /liblaf/cherries/{plugin → integration}/__init__.py +0 -0
- /liblaf/cherries/{info → meta}/_git.py +0 -0
- {liblaf_cherries-0.0.14.dist-info → liblaf_cherries-0.1.1.dist-info}/WHEEL +0 -0
- {liblaf_cherries-0.0.14.dist-info → liblaf_cherries-0.1.1.dist-info}/licenses/LICENSE +0 -0
@@ -1,77 +0,0 @@
|
|
1
|
-
from ._abc import (
|
2
|
-
End,
|
3
|
-
LogArtifact,
|
4
|
-
LogArtifacts,
|
5
|
-
LogMetric,
|
6
|
-
LogParam,
|
7
|
-
Plugin,
|
8
|
-
RunStatus,
|
9
|
-
Start,
|
10
|
-
)
|
11
|
-
from ._dvc import DvcEnd, DvcLogArtifact, DvcLogArtifacts
|
12
|
-
from ._git import GitEnd, GitStart
|
13
|
-
from ._logging import LoggingEnd, LoggingStart
|
14
|
-
from ._mlflow import (
|
15
|
-
MlflowEnd,
|
16
|
-
MlflowLogArtifact,
|
17
|
-
MlflowLogArtifacts,
|
18
|
-
MlflowLogMetric,
|
19
|
-
MlflowLogParam,
|
20
|
-
MlflowSetTag,
|
21
|
-
MlflowStart,
|
22
|
-
)
|
23
|
-
from ._run import (
|
24
|
-
Run,
|
25
|
-
end,
|
26
|
-
log_artifact,
|
27
|
-
log_artifacts,
|
28
|
-
log_input,
|
29
|
-
log_inputs,
|
30
|
-
log_metric,
|
31
|
-
log_output,
|
32
|
-
log_outputs,
|
33
|
-
log_param,
|
34
|
-
log_src,
|
35
|
-
run,
|
36
|
-
set_tag,
|
37
|
-
start,
|
38
|
-
)
|
39
|
-
|
40
|
-
__all__ = [
|
41
|
-
"DvcEnd",
|
42
|
-
"DvcLogArtifact",
|
43
|
-
"DvcLogArtifacts",
|
44
|
-
"End",
|
45
|
-
"GitEnd",
|
46
|
-
"GitStart",
|
47
|
-
"LogArtifact",
|
48
|
-
"LogArtifacts",
|
49
|
-
"LogMetric",
|
50
|
-
"LogParam",
|
51
|
-
"LoggingEnd",
|
52
|
-
"LoggingStart",
|
53
|
-
"MlflowEnd",
|
54
|
-
"MlflowLogArtifact",
|
55
|
-
"MlflowLogArtifacts",
|
56
|
-
"MlflowLogMetric",
|
57
|
-
"MlflowLogParam",
|
58
|
-
"MlflowSetTag",
|
59
|
-
"MlflowStart",
|
60
|
-
"Plugin",
|
61
|
-
"Run",
|
62
|
-
"RunStatus",
|
63
|
-
"Start",
|
64
|
-
"end",
|
65
|
-
"log_artifact",
|
66
|
-
"log_artifacts",
|
67
|
-
"log_input",
|
68
|
-
"log_inputs",
|
69
|
-
"log_metric",
|
70
|
-
"log_output",
|
71
|
-
"log_outputs",
|
72
|
-
"log_param",
|
73
|
-
"log_src",
|
74
|
-
"run",
|
75
|
-
"set_tag",
|
76
|
-
"start",
|
77
|
-
]
|
liblaf/cherries/plugin/_abc.py
DELETED
@@ -1,131 +0,0 @@
|
|
1
|
-
from __future__ import annotations
|
2
|
-
|
3
|
-
import bisect
|
4
|
-
import enum
|
5
|
-
import functools
|
6
|
-
import operator
|
7
|
-
from collections.abc import Iterable
|
8
|
-
from pathlib import Path
|
9
|
-
from typing import Any, override
|
10
|
-
|
11
|
-
import attrs
|
12
|
-
import mlflow
|
13
|
-
import mlflow.entities
|
14
|
-
from loguru import logger
|
15
|
-
|
16
|
-
from liblaf.cherries import pathutils as _path
|
17
|
-
from liblaf.cherries.typed import PathLike
|
18
|
-
|
19
|
-
|
20
|
-
class RunStatus(enum.StrEnum):
|
21
|
-
FAILED = mlflow.entities.RunStatus.to_string(mlflow.entities.RunStatus.FAILED)
|
22
|
-
FINISHED = mlflow.entities.RunStatus.to_string(mlflow.entities.RunStatus.FINISHED)
|
23
|
-
KILLED = mlflow.entities.RunStatus.to_string(mlflow.entities.RunStatus.KILLED)
|
24
|
-
|
25
|
-
|
26
|
-
@functools.total_ordering
|
27
|
-
@attrs.define
|
28
|
-
class Plugin[**P, T]:
|
29
|
-
priority: int = attrs.field(default=0, kw_only=True, eq=True, order=True)
|
30
|
-
_children: list[Plugin] = attrs.field(
|
31
|
-
factory=list, eq=False, order=False, alias="children"
|
32
|
-
)
|
33
|
-
|
34
|
-
def __attrs_post_init__(self) -> None:
|
35
|
-
self._children.sort(key=operator.attrgetter("priority"))
|
36
|
-
|
37
|
-
def __call__(self, *args: P.args, **kwargs: P.kwargs) -> T:
|
38
|
-
ret: T | None = None
|
39
|
-
for child in self._children:
|
40
|
-
try:
|
41
|
-
ret = child(*args, **kwargs)
|
42
|
-
except BaseException as err:
|
43
|
-
if isinstance(err, (KeyboardInterrupt, SystemExit)):
|
44
|
-
raise
|
45
|
-
logger.exception(child)
|
46
|
-
return ret # pyright: ignore[reportReturnType]
|
47
|
-
|
48
|
-
def __lt__(self, other: Plugin) -> bool:
|
49
|
-
if not isinstance(other, Plugin):
|
50
|
-
return NotImplemented
|
51
|
-
return self.priority < other.priority
|
52
|
-
|
53
|
-
def __eq__(self, other: Plugin) -> bool: # pyright: ignore[reportIncompatibleMethodOverride]
|
54
|
-
if not isinstance(other, Plugin):
|
55
|
-
return NotImplemented
|
56
|
-
return self.priority == other.priority
|
57
|
-
|
58
|
-
@property
|
59
|
-
def children(self) -> list[Plugin]:
|
60
|
-
return self._children
|
61
|
-
|
62
|
-
def add(self, *child: Plugin) -> None:
|
63
|
-
for c in child:
|
64
|
-
bisect.insort(self._children, c, key=operator.attrgetter("priority"))
|
65
|
-
|
66
|
-
def extend(self, children: Iterable[Plugin]) -> None:
|
67
|
-
self.add(*children)
|
68
|
-
|
69
|
-
def remove(self, child: Plugin) -> None:
|
70
|
-
self._children.remove(child)
|
71
|
-
|
72
|
-
|
73
|
-
@attrs.define
|
74
|
-
class End(Plugin):
|
75
|
-
@override
|
76
|
-
def __call__(self, status: RunStatus = RunStatus.FINISHED) -> None:
|
77
|
-
return super().__call__(status)
|
78
|
-
|
79
|
-
|
80
|
-
@attrs.define
|
81
|
-
class LogArtifact(Plugin):
|
82
|
-
@override
|
83
|
-
def __call__(
|
84
|
-
self, local_path: PathLike, artifact_path: PathLike | None = None, **kwargs
|
85
|
-
) -> Path:
|
86
|
-
ret: Path | None = super().__call__(local_path, artifact_path, **kwargs)
|
87
|
-
if ret is None:
|
88
|
-
ret = _path.as_path(local_path)
|
89
|
-
return ret
|
90
|
-
|
91
|
-
|
92
|
-
@attrs.define
|
93
|
-
class LogArtifacts(Plugin):
|
94
|
-
@override
|
95
|
-
def __call__(
|
96
|
-
self, local_dir: PathLike, artifact_path: PathLike | None = None, **kwargs
|
97
|
-
) -> Path:
|
98
|
-
ret: Path | None = super().__call__(local_dir, artifact_path, **kwargs)
|
99
|
-
if ret is None:
|
100
|
-
ret = _path.as_path(local_dir)
|
101
|
-
return ret
|
102
|
-
|
103
|
-
|
104
|
-
@attrs.define
|
105
|
-
class LogMetric(Plugin):
|
106
|
-
@override
|
107
|
-
def __call__(
|
108
|
-
self, key: str, value: float, step: int | None = None, **kwargs
|
109
|
-
) -> None:
|
110
|
-
return super().__call__(key, value, step, **kwargs)
|
111
|
-
|
112
|
-
|
113
|
-
@attrs.define
|
114
|
-
class LogParam(Plugin):
|
115
|
-
@override
|
116
|
-
def __call__(self, key: str, value: Any, **kwargs) -> None:
|
117
|
-
return super().__call__(key, value, **kwargs)
|
118
|
-
|
119
|
-
|
120
|
-
@attrs.define
|
121
|
-
class SetTag(Plugin):
|
122
|
-
@override
|
123
|
-
def __call__(self, key: str, value: Any, **kwargs) -> None:
|
124
|
-
return super().__call__(key, value, **kwargs)
|
125
|
-
|
126
|
-
|
127
|
-
@attrs.define
|
128
|
-
class Start(Plugin):
|
129
|
-
@override
|
130
|
-
def __call__(self) -> None:
|
131
|
-
return super().__call__()
|
liblaf/cherries/plugin/_dvc.py
DELETED
@@ -1,63 +0,0 @@
|
|
1
|
-
import subprocess as sp
|
2
|
-
from pathlib import Path
|
3
|
-
from typing import override
|
4
|
-
|
5
|
-
import attrs
|
6
|
-
import git
|
7
|
-
import git.exc
|
8
|
-
|
9
|
-
from liblaf.cherries import pathutils as _path
|
10
|
-
from liblaf.cherries.typed import PathLike
|
11
|
-
|
12
|
-
from ._abc import End, LogArtifact, LogArtifacts, RunStatus
|
13
|
-
|
14
|
-
|
15
|
-
@attrs.define
|
16
|
-
class DvcEnd(End):
|
17
|
-
@override
|
18
|
-
def __call__(self, status: RunStatus = RunStatus.FINISHED) -> None:
|
19
|
-
sp.run(["dvc", "status"], check=True)
|
20
|
-
sp.run(["dvc", "push"], check=True)
|
21
|
-
|
22
|
-
|
23
|
-
@attrs.define
|
24
|
-
class DvcLogArtifact(LogArtifact):
|
25
|
-
@override
|
26
|
-
def __call__(
|
27
|
-
self, local_path: PathLike, artifact_path: PathLike | None = None, **kwargs
|
28
|
-
) -> Path:
|
29
|
-
local_path: Path = _path.as_path(local_path)
|
30
|
-
if check_ignore(local_path) or tracked_by_git(local_path):
|
31
|
-
return local_path
|
32
|
-
sp.run(["dvc", "add", local_path], check=True)
|
33
|
-
return local_path
|
34
|
-
|
35
|
-
|
36
|
-
@attrs.define
|
37
|
-
class DvcLogArtifacts(LogArtifacts):
|
38
|
-
@override
|
39
|
-
def __call__(
|
40
|
-
self, local_dir: PathLike, artifact_path: PathLike | None = None, **kwargs
|
41
|
-
) -> Path:
|
42
|
-
local_dir: Path = _path.as_path(local_dir)
|
43
|
-
if check_ignore(local_dir) or tracked_by_git(local_dir):
|
44
|
-
return local_dir
|
45
|
-
sp.run(["dvc", "add", local_dir], check=True)
|
46
|
-
return local_dir
|
47
|
-
|
48
|
-
|
49
|
-
def check_ignore(local_path: PathLike) -> bool:
|
50
|
-
proc: sp.CompletedProcess[bytes] = sp.run(
|
51
|
-
["dvc", "check-ignore", local_path], check=False
|
52
|
-
)
|
53
|
-
return proc.returncode == 0
|
54
|
-
|
55
|
-
|
56
|
-
def tracked_by_git(local_path: PathLike) -> bool:
|
57
|
-
local_path: Path = _path.as_path(local_path).absolute()
|
58
|
-
try:
|
59
|
-
repo = git.Repo(search_parent_directories=True)
|
60
|
-
repo.git.ls_files(local_path, error_unmatch=True)
|
61
|
-
except git.exc.GitCommandError:
|
62
|
-
return False
|
63
|
-
return True
|
liblaf/cherries/plugin/_git.py
DELETED
@@ -1,46 +0,0 @@
|
|
1
|
-
from typing import override
|
2
|
-
|
3
|
-
import attrs
|
4
|
-
from environs import env
|
5
|
-
|
6
|
-
from liblaf.cherries import info as _info
|
7
|
-
|
8
|
-
from ._abc import End, RunStatus, Start
|
9
|
-
from ._run import run
|
10
|
-
|
11
|
-
|
12
|
-
@attrs.define
|
13
|
-
class GitEnd(End):
|
14
|
-
dry_run: bool = env.bool("LIBLAF_CHERRIES_GIT_DRY_RUN", default=False)
|
15
|
-
|
16
|
-
@override
|
17
|
-
def __call__(self, status: RunStatus = RunStatus.FINISHED) -> None:
|
18
|
-
git_auto_commit(
|
19
|
-
"chore(cherries): auto commit (on run end)", dry_run=self.dry_run
|
20
|
-
)
|
21
|
-
|
22
|
-
|
23
|
-
@attrs.define
|
24
|
-
class GitStart(Start):
|
25
|
-
dry_run: bool = env.bool("LIBLAF_CHERRIES_GIT_DRY_RUN", default=False)
|
26
|
-
|
27
|
-
@override
|
28
|
-
def __call__(self) -> None:
|
29
|
-
git_auto_commit(
|
30
|
-
"chore(cherries): auto commit (on run start)", dry_run=self.dry_run
|
31
|
-
)
|
32
|
-
|
33
|
-
|
34
|
-
def git_auto_commit(
|
35
|
-
header: str = "chore(cherries): auto commit", *, dry_run: bool = False
|
36
|
-
) -> None:
|
37
|
-
body: str = ""
|
38
|
-
if run.run_name and run.run_url:
|
39
|
-
body += f"🏃 View run {run.run_name} at: {run.run_url}\n"
|
40
|
-
if run.exp_name and run.exp_url:
|
41
|
-
body += f"🧪 View experiment {run.exp_name} at: {run.exp_url}\n"
|
42
|
-
message: str = f"{header}\n\n{body}" if body else header
|
43
|
-
_info.git_auto_commit(message, dry_run=dry_run)
|
44
|
-
run.set_tag("cherries.git.branch", _info.git_branch())
|
45
|
-
run.set_tag("cherries.git.sha", _info.git_commit_sha())
|
46
|
-
run.set_tag("cherries.git.url", _info.git_commit_url())
|
@@ -1,31 +0,0 @@
|
|
1
|
-
from typing import override
|
2
|
-
|
3
|
-
import attrs
|
4
|
-
from loguru import logger
|
5
|
-
|
6
|
-
from liblaf import grapes
|
7
|
-
|
8
|
-
from ._abc import End, RunStatus, Start
|
9
|
-
from ._run import run
|
10
|
-
|
11
|
-
|
12
|
-
@attrs.define
|
13
|
-
class LoggingEnd(End):
|
14
|
-
@override
|
15
|
-
def __call__(self, status: RunStatus = RunStatus.FINISHED) -> None:
|
16
|
-
logger.complete()
|
17
|
-
run.log_artifact(run.exp_dir / "run.log")
|
18
|
-
run.log_artifact(run.exp_dir / "run.log.jsonl")
|
19
|
-
|
20
|
-
|
21
|
-
@attrs.define
|
22
|
-
class LoggingStart(Start):
|
23
|
-
@override
|
24
|
-
def __call__(self) -> None:
|
25
|
-
grapes.init_logging(
|
26
|
-
handlers=[
|
27
|
-
grapes.logging.rich_handler(),
|
28
|
-
grapes.logging.file_handler(sink=run.exp_dir / "run.log"),
|
29
|
-
grapes.logging.jsonl_handler(sink=run.exp_dir / "run.log.jsonl"),
|
30
|
-
]
|
31
|
-
)
|
@@ -1,88 +0,0 @@
|
|
1
|
-
from pathlib import Path
|
2
|
-
from typing import Any, override
|
3
|
-
|
4
|
-
import attrs
|
5
|
-
import mlflow
|
6
|
-
|
7
|
-
from liblaf.cherries import info as _info
|
8
|
-
from liblaf.cherries import pathutils as _path
|
9
|
-
from liblaf.cherries.typed import PathLike
|
10
|
-
|
11
|
-
from ._abc import (
|
12
|
-
End,
|
13
|
-
LogArtifact,
|
14
|
-
LogArtifacts,
|
15
|
-
LogMetric,
|
16
|
-
LogParam,
|
17
|
-
RunStatus,
|
18
|
-
SetTag,
|
19
|
-
Start,
|
20
|
-
)
|
21
|
-
|
22
|
-
|
23
|
-
@attrs.define
|
24
|
-
class MlflowEnd(End):
|
25
|
-
@override
|
26
|
-
def __call__(self, status: RunStatus = RunStatus.FINISHED) -> None:
|
27
|
-
mlflow.end_run(status)
|
28
|
-
|
29
|
-
|
30
|
-
@attrs.define
|
31
|
-
class MlflowLogArtifact(LogArtifact):
|
32
|
-
@override
|
33
|
-
def __call__(
|
34
|
-
self, local_path: PathLike, artifact_path: PathLike | None = None, **kwargs
|
35
|
-
) -> Path:
|
36
|
-
local_path: Path = _path.as_path(local_path)
|
37
|
-
if (dvc_file := local_path.with_name(local_path.name + ".dvc")).is_file():
|
38
|
-
local_path = dvc_file
|
39
|
-
mlflow.log_artifact(
|
40
|
-
_path.as_os_path(local_path), _path.as_posix(artifact_path), **kwargs
|
41
|
-
)
|
42
|
-
return _path.as_path(local_path)
|
43
|
-
|
44
|
-
|
45
|
-
@attrs.define
|
46
|
-
class MlflowLogArtifacts(LogArtifacts):
|
47
|
-
@override
|
48
|
-
def __call__(
|
49
|
-
self, local_dir: PathLike, artifact_path: PathLike | None = None, **kwargs
|
50
|
-
) -> Path:
|
51
|
-
local_dir: Path = _path.as_path(local_dir)
|
52
|
-
if (dvc_file := local_dir.with_name(local_dir.name + ".dvc")).is_file():
|
53
|
-
local_dir = dvc_file
|
54
|
-
mlflow.log_artifact(
|
55
|
-
_path.as_os_path(local_dir), _path.as_posix(artifact_path), **kwargs
|
56
|
-
)
|
57
|
-
return _path.as_path(local_dir)
|
58
|
-
|
59
|
-
|
60
|
-
@attrs.define
|
61
|
-
class MlflowLogParam(LogParam):
|
62
|
-
@override
|
63
|
-
def __call__(self, key: str, value: Any, **kwargs) -> None:
|
64
|
-
mlflow.log_param(key, value, **kwargs)
|
65
|
-
|
66
|
-
|
67
|
-
@attrs.define
|
68
|
-
class MlflowLogMetric(LogMetric):
|
69
|
-
@override
|
70
|
-
def __call__(
|
71
|
-
self, key: str, value: float, step: int | None = None, **kwargs
|
72
|
-
) -> None:
|
73
|
-
mlflow.log_metric(key, value, step, **kwargs)
|
74
|
-
|
75
|
-
|
76
|
-
@attrs.define
|
77
|
-
class MlflowSetTag(SetTag):
|
78
|
-
@override
|
79
|
-
def __call__(self, key: str, value: Any, **kwargs) -> None:
|
80
|
-
mlflow.set_tag(key, value, **kwargs)
|
81
|
-
|
82
|
-
|
83
|
-
@attrs.define
|
84
|
-
class MlflowStart(Start):
|
85
|
-
@override
|
86
|
-
def __call__(self) -> None:
|
87
|
-
mlflow.set_experiment(_info.exp_name())
|
88
|
-
mlflow.start_run(run_name=_info.run_name())
|
liblaf/cherries/plugin/_run.py
DELETED
@@ -1,105 +0,0 @@
|
|
1
|
-
import datetime
|
2
|
-
import functools
|
3
|
-
from pathlib import Path
|
4
|
-
|
5
|
-
import attrs
|
6
|
-
import mlflow
|
7
|
-
|
8
|
-
from liblaf.cherries import pathutils as _path
|
9
|
-
from liblaf.cherries.typed import PathLike
|
10
|
-
|
11
|
-
from ._abc import End, LogArtifact, LogArtifacts, LogMetric, LogParam, SetTag, Start
|
12
|
-
|
13
|
-
|
14
|
-
@attrs.define
|
15
|
-
class Run:
|
16
|
-
end: End = attrs.field(factory=End, init=False)
|
17
|
-
log_artifact: LogArtifact = attrs.field(factory=LogArtifact, init=False)
|
18
|
-
log_artifacts: LogArtifacts = attrs.field(factory=LogArtifacts, init=False)
|
19
|
-
log_metric: LogMetric = attrs.field(factory=LogMetric, init=False)
|
20
|
-
log_param: LogParam = attrs.field(factory=LogParam, init=False)
|
21
|
-
set_tag: SetTag = attrs.field(factory=SetTag, init=False)
|
22
|
-
start: Start = attrs.field(factory=Start, init=False)
|
23
|
-
|
24
|
-
@property
|
25
|
-
def active_run(self) -> mlflow.ActiveRun:
|
26
|
-
return mlflow.active_run() # pyright: ignore[reportReturnType]
|
27
|
-
|
28
|
-
@functools.cached_property
|
29
|
-
def exp_dir(self) -> Path:
|
30
|
-
return _path.run_dir(absolute=True)
|
31
|
-
|
32
|
-
@property
|
33
|
-
def exp_id(self) -> str:
|
34
|
-
return self.active_run.info.experiment_id
|
35
|
-
|
36
|
-
@property
|
37
|
-
def exp_name(self) -> str:
|
38
|
-
return self.exp_id
|
39
|
-
|
40
|
-
@property
|
41
|
-
def exp_url(self) -> str:
|
42
|
-
tracking_uri: str = self.tracking_uri.rstrip("/")
|
43
|
-
return f"{tracking_uri}/#/experiments/{self.exp_id}"
|
44
|
-
|
45
|
-
@property
|
46
|
-
def tracking_uri(self) -> str:
|
47
|
-
return mlflow.get_tracking_uri()
|
48
|
-
|
49
|
-
@property
|
50
|
-
def run_id(self) -> str:
|
51
|
-
return self.active_run.info.run_id
|
52
|
-
|
53
|
-
@property
|
54
|
-
def run_name(self) -> str:
|
55
|
-
return self.active_run.info.run_name # pyright: ignore[reportReturnType]
|
56
|
-
|
57
|
-
@property
|
58
|
-
def run_url(self) -> str:
|
59
|
-
return f"{self.exp_url}/runs/{self.run_id}"
|
60
|
-
|
61
|
-
@property
|
62
|
-
def start_time(self) -> datetime.datetime:
|
63
|
-
return datetime.datetime.fromtimestamp(
|
64
|
-
self.active_run.info.start_time / 1000, tz=datetime.UTC
|
65
|
-
).astimezone()
|
66
|
-
|
67
|
-
def log_input(
|
68
|
-
self, local_path: PathLike, artifact_path: PathLike | None = "inputs", **kwargs
|
69
|
-
) -> Path:
|
70
|
-
return self.log_artifact(local_path, artifact_path, **kwargs)
|
71
|
-
|
72
|
-
def log_inputs(
|
73
|
-
self, local_dir: PathLike, artifact_path: PathLike | None = "inputs", **kwargs
|
74
|
-
) -> Path:
|
75
|
-
return self.log_artifacts(local_dir, artifact_path, **kwargs)
|
76
|
-
|
77
|
-
def log_output(
|
78
|
-
self, local_path: PathLike, artifact_path: PathLike | None = "outputs", **kwargs
|
79
|
-
) -> Path:
|
80
|
-
return self.log_artifact(local_path, artifact_path, **kwargs)
|
81
|
-
|
82
|
-
def log_outputs(
|
83
|
-
self, local_dir: PathLike, artifact_path: PathLike | None = "outputs", **kwargs
|
84
|
-
) -> Path:
|
85
|
-
return self.log_artifacts(local_dir, artifact_path, **kwargs)
|
86
|
-
|
87
|
-
def log_src(
|
88
|
-
self, local_path: PathLike, artifact_path: PathLike | None = "src", **kwargs
|
89
|
-
) -> Path:
|
90
|
-
return self.log_artifact(local_path, artifact_path, **kwargs)
|
91
|
-
|
92
|
-
|
93
|
-
run = Run()
|
94
|
-
end: End = run.end
|
95
|
-
log_artifact: LogArtifact = run.log_artifact
|
96
|
-
log_artifacts: LogArtifacts = run.log_artifacts
|
97
|
-
log_metric: LogMetric = run.log_metric
|
98
|
-
log_param: LogParam = run.log_param
|
99
|
-
set_tag: SetTag = run.set_tag
|
100
|
-
start: Start = run.start
|
101
|
-
log_input = run.log_input
|
102
|
-
log_inputs = run.log_inputs
|
103
|
-
log_output = run.log_output
|
104
|
-
log_outputs = run.log_outputs
|
105
|
-
log_src = run.log_src
|
@@ -1,35 +0,0 @@
|
|
1
|
-
liblaf/cherries/__init__.py,sha256=OHb6Xou2v6u42swTgjRfzej4CIlRg4OmgOIQXUiRjKA,97
|
2
|
-
liblaf/cherries/__init__.pyi,sha256=ShYXNS05TvRjr5XTKurtBiToTR3T1JX2Ub0njjbMsuM,1370
|
3
|
-
liblaf/cherries/_config.py,sha256=rm-Y6roi8hBvQYdH-VQh_ovWCyVsX_7R0x1jokBPCDM,741
|
4
|
-
liblaf/cherries/_run.py,sha256=vbJ5-Fh8azNhemVf4qyNUc5RaFA8HgFHZOmzdRMPF2k,1085
|
5
|
-
liblaf/cherries/_version.py,sha256=JAP571q66KmOqXyFj53ns1X0_trh2aTxt2bW41ljMkc,513
|
6
|
-
liblaf/cherries/_version.pyi,sha256=Pnv4Bxw13LHeuVkPLPsTtnp4N4jOGcAfFJw05uMMgBY,108
|
7
|
-
liblaf/cherries/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
8
|
-
liblaf/cherries/typed.py,sha256=mim8QVtwczTSHyw5mhEdfFcXis9o32n0CZyu8BrEorE,50
|
9
|
-
liblaf/cherries/info/__init__.py,sha256=OHb6Xou2v6u42swTgjRfzej4CIlRg4OmgOIQXUiRjKA,97
|
10
|
-
liblaf/cherries/info/__init__.pyi,sha256=beKfSRY1wVsTPBOkWZ7ukmMZo0NKHzp00Q51cFUArbM,274
|
11
|
-
liblaf/cherries/info/_git.py,sha256=oy1xx23sXWA7RqQuLGc3HxcLCF7zHTSpZvZ9pukJGdI,1232
|
12
|
-
liblaf/cherries/info/_name.py,sha256=RhB0tqygzBNTS6ZK9unLu7DeuiQaudAvIyeHj0nf2HA,752
|
13
|
-
liblaf/cherries/pathutils/__init__.py,sha256=OHb6Xou2v6u42swTgjRfzej4CIlRg4OmgOIQXUiRjKA,97
|
14
|
-
liblaf/cherries/pathutils/__init__.pyi,sha256=JEotcjG2QNC3LaVM7aoLd7l0Ny6m0QyQKeePefS22LM,413
|
15
|
-
liblaf/cherries/pathutils/_convert.py,sha256=JTO9vETXvj7f4GTtIbOmAoDNEDc_4hoEHZ7ujbyTgS8,859
|
16
|
-
liblaf/cherries/pathutils/_path.py,sha256=35WgGghvXq56mFCqT7jYaPo7mO3rnRyRdBh6--woBxE,1548
|
17
|
-
liblaf/cherries/pathutils/_special.py,sha256=UZ9dAPj7EAqlRqzQD_b_Z-uCHjv6W_gtMs1Wfr_nDuc,1415
|
18
|
-
liblaf/cherries/plugin/__init__.py,sha256=OHb6Xou2v6u42swTgjRfzej4CIlRg4OmgOIQXUiRjKA,97
|
19
|
-
liblaf/cherries/plugin/__init__.pyi,sha256=2PPdTp-vfgP34sKGnjCR1oMG5ljTmkZkabr_LV74tXA,1299
|
20
|
-
liblaf/cherries/plugin/_abc.py,sha256=H-NH6Gpv3dTJKjaekuAKSn_H0TJPxF-TLa5UU51NNjg,3748
|
21
|
-
liblaf/cherries/plugin/_dvc.py,sha256=1cMcKJmO-9FFWjiQ_V-BqmF9XaKmOiwdE9y3aeFoodY,1800
|
22
|
-
liblaf/cherries/plugin/_git.py,sha256=AY6AugwyqtcCAaX475zDINFHgHG1UKupWplquEPbjWU,1396
|
23
|
-
liblaf/cherries/plugin/_logging.py,sha256=EJ-6VgY8Fyn_o2R68diqT7vwnOnuJBPQU7IjwvjKVco,784
|
24
|
-
liblaf/cherries/plugin/_mlflow.py,sha256=JS0oGojDyPTUF-Q8ZUJrO36hUXckNFeViAIjJ6lo3ng,2287
|
25
|
-
liblaf/cherries/plugin/_run.py,sha256=ldEzxD-PrAiHBwMGjQKiU9eyc0sriwKXPEU6JbId6kE,3287
|
26
|
-
liblaf/cherries/presets/__init__.py,sha256=OHb6Xou2v6u42swTgjRfzej4CIlRg4OmgOIQXUiRjKA,97
|
27
|
-
liblaf/cherries/presets/__init__.pyi,sha256=ka0zjVDb1kWn1VuDGjAzMX5S9sVKKYcxKelp4EwUBf8,53
|
28
|
-
liblaf/cherries/presets/_default.py,sha256=hhe10JzMui8WJhvoLlOfDCHMRlPmdnzRSduFH7rCtP0,742
|
29
|
-
liblaf/cherries/utils/__init__.py,sha256=OHb6Xou2v6u42swTgjRfzej4CIlRg4OmgOIQXUiRjKA,97
|
30
|
-
liblaf/cherries/utils/__init__.pyi,sha256=F5aTcXpWVmUoctPbLfmQXKyuXYRspAIjaIzfL1_3Lrw,51
|
31
|
-
liblaf/cherries/utils/_functools.py,sha256=0Puwvj1Wq4kp3S--hI-CXwUBZ56AtfkqIzFHllQtuug,181
|
32
|
-
liblaf_cherries-0.0.14.dist-info/METADATA,sha256=_s8gjrpYQBGHkxYz_D9ibagwI478PgQujoy1AI2vnD0,1944
|
33
|
-
liblaf_cherries-0.0.14.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
34
|
-
liblaf_cherries-0.0.14.dist-info/licenses/LICENSE,sha256=Ph4NzyU3lGVDeYv-mf8aRmImH8v9rVL9F362FV4G6Ow,1063
|
35
|
-
liblaf_cherries-0.0.14.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|