-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy patherror.py
47 lines (32 loc) · 1.17 KB
/
error.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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
42
43
44
45
46
47
from typing import Any
class DvcLiveError(Exception):
pass
class InvalidDataTypeError(DvcLiveError):
def __init__(self, name, val):
self.name = name
self.val = val
super().__init__(f"Data '{name}' has not supported type {val}")
class InvalidDvcyamlError(DvcLiveError):
def __init__(self):
super().__init__("`dvcyaml` path must have filename 'dvc.yaml'")
class InvalidImageNameError(DvcLiveError):
def __init__(self, name):
self.name = name
super().__init__(f"Cannot log image with name '{name}'")
class InvalidPlotTypeError(DvcLiveError):
def __init__(self, name):
from .plots import SKLEARN_PLOTS
self.name = name
super().__init__(
f"Plot type '{name}' is not supported."
f"\nSupported types are: {list(SKLEARN_PLOTS)}"
)
class InvalidParameterTypeError(DvcLiveError):
def __init__(self, msg: Any):
super().__init__(msg)
class InvalidReportModeError(DvcLiveError):
def __init__(self, val):
super().__init__(
f"`report` can only be `None`, `auto`, `html`, `notebook` or `md`. "
f"Got {val} instead."
)