From 789bda4b087542f35f068f8dd08b29aafd8035f1 Mon Sep 17 00:00:00 2001 From: thatguy11325 <148832074+thatguy11325@users.noreply.github.com> Date: Sun, 8 Dec 2024 22:49:59 -0500 Subject: [PATCH] highest --- pokemonred_puffer/sweep.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pokemonred_puffer/sweep.py b/pokemonred_puffer/sweep.py index 56e02eb..e823bb0 100644 --- a/pokemonred_puffer/sweep.py +++ b/pokemonred_puffer/sweep.py @@ -160,7 +160,9 @@ def launch_sweep( # sort by the middle int and take the highest value # dont need split, could also use a regex group save_filename = sorted( - saves, key=lambda x: int(x.replace("carbs_", "").replace("obs.pt", "")) + saves, + key=lambda x: int(x.replace("carbs_", "").replace("obs.pt", "")), + reverse=True, )[0] carbs.warm_start( filename=os.path.join(experiment_dir, save_filename),