Visitar URL original
Merge pull request #3467 from DeepLabCut/jaap/pathlib-fixes · DeepLabCut/DeepLabCut@1535b51 · GitHub
Skip to content

Commit 1535b51

Browse files
authored
Merge pull request #3467 from DeepLabCut/jaap/pathlib-fixes
fix faulty str / Path conversions
2 parents 4a82207 + ec58481 commit 1535b51

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

‎deeplabcut/gui/tabs/create_videos.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ def create_videos(self):
276276
self.root.writer.write("Labeled videos created.")
277277
else:
278278
failed_videos = [video for success, video in zip(videos_created, videos, strict=False) if not success]
279-
failed_videos_str = ", ".join(failed_videos)
279+
failed_videos_str = ", ".join(str(video) for video in failed_videos)
280280
self.root.writer.write(f"Failed to create videos from {failed_videos_str}.")
281281

282282
if self.plot_trajectories.isChecked():

‎deeplabcut/utils/conversioncode.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ def convertcsv2h5(config: str | Path, userfeedback=True, scorer=None):
7979
data = pd.read_csv(fn, index_col=index_col, header=header)
8080
data.columns = data.columns.set_levels([scorer], level="scorer")
8181
guarantee_multiindex_rows(data)
82-
data.to_hdf(fn.replace(".csv", ".h5"), key="df_with_missing", mode="w")
82+
h5_path = fn.with_suffix(".h5")
83+
data.to_hdf(h5_path, key="df_with_missing", mode="w")
8384
data.to_csv(fn)
8485
except FileNotFoundError:
8586
print("Attention:", folder, "does not appear to have labeled data!")

‎deeplabcut/utils/plotting.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ def plot_trajectories(
317317

318318
if len(failures) > 0:
319319
# Some videos were not evaluated.
320-
failed_videos = ",".join(failures)
320+
failed_videos = ",".join(str(video) for video in failures)
321321
if len(multianimal_errors) > 0:
322322
verbose_error = ": " + " ".join(multianimal_errors)
323323
else:

0 commit comments

Comments
 (0)