From bf9afedc5365d6b7164d569cc659817250e911d6 Mon Sep 17 00:00:00 2001 From: Eric Neilsen Date: Fri, 5 Jan 2024 09:03:53 -0800 Subject: [PATCH] be robust wrt absent rewards in archive --- rubin_scheduler/sim_archive/sim_archive.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/rubin_scheduler/sim_archive/sim_archive.py b/rubin_scheduler/sim_archive/sim_archive.py index d69a9d6c..ec1b9d44 100644 --- a/rubin_scheduler/sim_archive/sim_archive.py +++ b/rubin_scheduler/sim_archive/sim_archive.py @@ -22,7 +22,7 @@ import socket import sys from contextlib import redirect_stdout -from numbers import Number, Real, Integral +from numbers import Number, Integral from pathlib import Path from tempfile import TemporaryDirectory @@ -404,12 +404,14 @@ def make_sim_archive_cli(*args): parser.add_argument( "--script", type=str, default=None, help="The file name of the script run to create the simulation." ) + + notebook_help = "The file name of the notebook run to create the simulation." + notebook_help = notebook_help + " This can be produced using the %%notebook magic." parser.add_argument( "--notebook", type=str, default=None, - help="""The file name of the notebook run to create the simulation. - This can be produced using the %notebook magic.""", + help=notebook_help, ) parser.add_argument( "--current_env", @@ -437,6 +439,9 @@ def make_sim_archive_cli(*args): obs_rewards = pd.read_hdf(arg_values.rewards, "obs_rewards") except KeyError: obs_rewards = None + else: + reward_df = None + obs_rewards = None filename_args = ["scheduler", "script", "notebook"] in_files = {}