From 673e81ce9936b39a0075341771546c6787ebbe45 Mon Sep 17 00:00:00 2001 From: Xiong-Hui Chen Date: Wed, 7 Dec 2022 15:28:59 +0800 Subject: [PATCH 1/2] Update migrate_expt.py --- rla_scripts/migrate_expt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rla_scripts/migrate_expt.py b/rla_scripts/migrate_expt.py index 58a4ce5..4b5efab 100644 --- a/rla_scripts/migrate_expt.py +++ b/rla_scripts/migrate_expt.py @@ -10,7 +10,7 @@ import argparse def argsparser(): - parser = argparse.ArgumentParser("Archive Log") + parser = argparse.ArgumentParser("Migrate Log") # reduce setting parser.add_argument('--task_table', type=str) parser.add_argument('--target_task_table', type=str) From d3c35119caf323d1108946e3abb1c744c781589e Mon Sep 17 00:00:00 2001 From: Xiong-Hui Chen Date: Wed, 14 Dec 2022 13:37:59 +0800 Subject: [PATCH 2/2] refactor (easy_plot): rename the confusing parameter `xlim` -> `x_bound` --- RLA/easy_plot/plot_func_v2.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/RLA/easy_plot/plot_func_v2.py b/RLA/easy_plot/plot_func_v2.py index 66712e4..785b020 100644 --- a/RLA/easy_plot/plot_func_v2.py +++ b/RLA/easy_plot/plot_func_v2.py @@ -28,7 +28,7 @@ def default_key_to_legend(parse_dict, split_keys, y_name, use_y_name=True): def plot_func(data_root:str, task_table_name:str, regs:list, split_keys:list, metrics:list, use_buf=False, verbose=True, - xlim: Optional[tuple] = None, + x_bound: Optional[int]=None, xlabel: Optional[str] = DEFAULT_X_NAME, ylabel: Optional[str] = None, scale_dict: Optional[dict] = None, regs2legends: Optional[list] = None, key_to_legend_fn: Optional[Callable] = default_key_to_legend, @@ -57,8 +57,7 @@ def plot_func(data_root:str, task_table_name:str, regs:list, split_keys:list, me :type metrics: :param use_buf: use the preloaded csv data instead of loading from scratch :type use_buf: bool - :param xlim: set the x limits of the x axes. - :type xlim: Optional[tuple] + :param x_bound: drop the collected with time-step larger than x_bound. :param xlabel: set the label of the y axes. :type xlabel: Optional[str] :param ylabel: set the label of the y axes. @@ -90,7 +89,7 @@ def plot_func(data_root:str, task_table_name:str, regs:list, split_keys:list, me counter = 0 for k, v in log_dict.items(): result = plot_util.load_results(v.dirname, names=metrics + [DEFAULT_X_NAME], - x_bound=[DEFAULT_X_NAME, xlim], use_buf=use_buf) + x_bound=[DEFAULT_X_NAME, x_bound], use_buf=use_buf) if len(result) == 0: continue assert len(result) == 1