Skip to content

Commit

Permalink
Improving file naming in copy_path_func
Browse files Browse the repository at this point in the history
  • Loading branch information
DiogenesAnalytics committed Jan 9, 2024
1 parent 93b47e5 commit 38cf48f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/autoencoder/data/anomaly.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,11 @@ def copy_path_func(path: str, error: float, label: str, idx: int) -> None:
# get path obj
source_path = Path(path)

# get error string
err_str = "d".join(str(error).split("."))

# new name
new_name = f"{idx}_{error}_{source_path.name}{source_path.suffix}"
new_name = f"{idx}_{err_str:.8}_{source_path.name}"

# copy
shutil.copy(path, destination_path / f"{label}/{new_name}")
Expand Down

0 comments on commit 38cf48f

Please sign in to comment.