Skip to content

Commit

Permalink
Added function for reading logs.
Browse files Browse the repository at this point in the history
  • Loading branch information
rcap107 committed Sep 21, 2023
1 parent 56fb07b commit a6b52d5
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/data_structures/loggers.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,24 @@ def get_exp_name():
return exp_name


def read_logs(run_name):
path_target_run = Path("results/logs/", run_name)
path_raw_logs = Path(path_target_run, "raw_logs")
path_agg_logs = Path(path_target_run, "run_logs")

logs = []
for f in path_raw_logs.glob("*.log"):
logs.append(pl.read_csv(f))
df_raw = pl.concat(logs)

logs = []
for f in path_agg_logs.glob("*.log"):
logs.append(pl.read_csv(f))
df_agg = pl.concat(logs)

return df_raw, df_agg


def setup_run_logging(setup_config=None):
exp_name = get_exp_name()
os.makedirs(f"results/logs/{exp_name}")
Expand Down

0 comments on commit a6b52d5

Please sign in to comment.