Commit ec3e83d dberenbaum
committed
1 parent 33288cd commit ec3e83d Copy full SHA for ec3e83d
File tree 3 files changed +15
-9
lines changed
3 files changed +15
-9
lines changed Original file line number Diff line number Diff line change 1
1
metrics :
2
2
- ../../../../private/var/folders/24/99_tf1xj3vx8k1k_jkdmnhq00000gn/T/pytest-of-dave/pytest-255/test_dvclive_log_metrics_10_0/metrics.json
3
3
- ../../../../private/var/folders/24/99_tf1xj3vx8k1k_jkdmnhq00000gn/T/pytest-of-dave/pytest-255/test_dvclive_log_metrics_None_0/metrics.json
4
+ - ../../../../private/var/folders/24/99_tf1xj3vx8k1k_jkdmnhq00000gn/T/pytest-of-dave/pytest-256/test_dvclive_log_metrics_10_0/metrics.json
5
+ - ../../../../private/var/folders/24/99_tf1xj3vx8k1k_jkdmnhq00000gn/T/pytest-of-dave/pytest-256/test_dvclive_log_metrics_None_0/metrics.json
4
6
plots :
5
7
- ? ../../../../private/var/folders/24/99_tf1xj3vx8k1k_jkdmnhq00000gn/T/pytest-of-dave/pytest-255/test_dvclive_log_metrics_10_0/plots/metrics
6
8
: x : step
7
9
- ? ../../../../private/var/folders/24/99_tf1xj3vx8k1k_jkdmnhq00000gn/T/pytest-of-dave/pytest-255/test_dvclive_log_metrics_None_0/plots/metrics
8
10
: x : step
11
+ - ? ../../../../private/var/folders/24/99_tf1xj3vx8k1k_jkdmnhq00000gn/T/pytest-of-dave/pytest-256/test_dvclive_log_metrics_10_0/plots/metrics
12
+ : x : step
13
+ - ? ../../../../private/var/folders/24/99_tf1xj3vx8k1k_jkdmnhq00000gn/T/pytest-of-dave/pytest-256/test_dvclive_log_metrics_None_0/plots/metrics
14
+ : x : step
Original file line number Diff line number Diff line change 4
4
import logging
5
5
import math
6
6
import os
7
+ from pathlib import PureWindowsPath
7
8
from typing import TYPE_CHECKING
8
9
9
10
from dvc_studio_client .config import get_studio_config
@@ -38,8 +39,11 @@ def _cast_to_numbers(datapoints: dict):
38
39
39
40
40
41
def _adapt_path (live : Live , name : StrPath ):
41
- dvc_root_path = live ._dvc_repo .root_dir if live ._dvc_repo else None
42
- return rel_path (name , dvc_root_path )
42
+ if live ._dvc_repo is not None :
43
+ name = rel_path (name , live ._dvc_repo .root_dir )
44
+ if os .name == "nt" :
45
+ name = str (PureWindowsPath (name ).as_posix ())
46
+ return name
43
47
44
48
45
49
def _adapt_plot_datapoints (live : Live , plot : dict ):
Original file line number Diff line number Diff line change 4
4
import os
5
5
import re
6
6
import shutil
7
- from pathlib import Path , PureWindowsPath
7
+ from pathlib import Path
8
8
from platform import uname
9
9
from typing import Union , List , Dict , TYPE_CHECKING
10
10
import webbrowser
@@ -192,12 +192,8 @@ def wrapper(*args, **kwargs):
192
192
193
193
194
194
def rel_path (path , dvc_root_path ):
195
- if dvc_root_path :
196
- absolute_path = Path (path ).absolute ()
197
- path = os .path .relpath (absolute_path , dvc_root_path )
198
- if os .name == "nt" :
199
- return str (PureWindowsPath (path ).as_posix ())
200
- return str (Path (path ).as_posix ())
195
+ absolute_path = Path (path ).absolute ()
196
+ return str (Path (os .path .relpath (absolute_path , dvc_root_path )).as_posix ())
201
197
202
198
203
199
def read_history (live , metric ):
You can’t perform that action at this time.
0 commit comments