From d2aa224bc86793070f92cf1fac2e48e711498b73 Mon Sep 17 00:00:00 2001 From: sp Date: Mon, 15 Jan 2024 17:09:58 +0100 Subject: [PATCH] move isodate to expname --- examples/shields/rl/utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/shields/rl/utils.py b/examples/shields/rl/utils.py index 5339063..4ffcd89 100644 --- a/examples/shields/rl/utils.py +++ b/examples/shields/rl/utils.py @@ -134,9 +134,10 @@ class MiniGridShieldHandler(ShieldHandler): return self.__create_shield_dict() def expname(args): - return f"{args.env}_{args.shielding}_{args.shield_comparison}_{args.shield_value}" + return f"{datetime.datetime.now().strftime('%Y%m%dT%H%M%S')}_{args.env}_{args.shielding}_{args.shield_comparison}_{args.shield_value}" + def create_log_dir(args): - log_dir = f"{args.log_dir}/{datetime.datetime.now().strftime('%Y%m%dT%H%M%S')}_{expname(args)}" + log_dir = f"{args.log_dir}/{expname(args)}" os.makedirs(log_dir, exist_ok=True) return log_dir