Skip to content

Commit a65f78e

Browse files
committed
Better path handling in write_hdf
1 parent 23bbb6f commit a65f78e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/napari_deeplabcut/_writer.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import os
22
from itertools import groupby
3+
from pathlib import Path
34

45
import pandas as pd
56
import yaml
@@ -66,8 +67,8 @@ def write_hdf(filename, data, metadata):
6667
name = os.path.splitext(gt_file)[0]
6768
else:
6869
# Let us fetch the config.yaml file to get the scorer name...
69-
project_folder = root.rsplit(os.sep, 2)[0]
70-
config = _load_config(os.path.join(project_folder, "config.yaml"))
70+
project_folder = Path(root).parents[1]
71+
config = _load_config(str(project_folder / "config.yaml"))
7172
new_scorer = config["scorer"]
7273
header.scorer = new_scorer
7374
df.columns = header.columns

0 commit comments

Comments
 (0)