From b52d72d087fcfcd6677c4aa9596b49018ad8ea28 Mon Sep 17 00:00:00 2001 From: JJJHolscher Date: Sat, 30 Mar 2024 09:11:50 +0100 Subject: [PATCH] shorter run_dir names --- pyproject.toml | 2 +- src/root.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 6666af3..9fb4811 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "jo3util" -version = "0.0.15" +version = "0.0.16" description = "" dependencies = [] dynamic = ["readme"] diff --git a/src/root.py b/src/root.py index dbaf13c..cc748cb 100644 --- a/src/root.py +++ b/src/root.py @@ -81,10 +81,10 @@ def root_file(): raise NotImplementedError -def run_dir(obj, root=Path(os.path.abspath("./out"))): +def run_dir(obj, root=Path(os.path.abspath("./run")), name_len=8): run_id: str = json.dumps( obj, default=lambda x: vars(x) if hasattr(x, "__dict__") else str(x) ) - run_id: str = hash_string(run_id) + run_id: str = hash_string(run_id)[:name_len] return root / run_id