From e0536fb96cb0066e5574db43c90f232f9c0b2569 Mon Sep 17 00:00:00 2001 From: Joel Tony Date: Wed, 19 Jun 2024 15:01:59 +0530 Subject: [PATCH] fmt: Rename `input_filename` to `trace_name` --- drishti/handlers/handle_darshan.py | 8 ++++---- drishti/handlers/handle_recorder.py | 10 +++++----- drishti/includes/module.py | 12 ++++++------ 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/drishti/handlers/handle_darshan.py b/drishti/handlers/handle_darshan.py index 24c0519..ea690f3 100644 --- a/drishti/handlers/handle_darshan.py +++ b/drishti/handlers/handle_darshan.py @@ -753,9 +753,9 @@ def handler(): display_footer(console, insights_start_time, insights_end_time) # Export to HTML, SVG, and CSV - input_filename = os.path.basename(args.log_path).replace('.darshan', '') + trace_name = os.path.basename(args.log_path).replace('.darshan', '') out_dir = args.export_dir if args.export_dir != "" else os.getcwd() - export_html(console, out_dir, input_filename) - export_svg(console, out_dir, input_filename) - export_csv(out_dir, input_filename, job['job']['jobid']) + export_html(console, out_dir, trace_name) + export_svg(console, out_dir, trace_name) + export_csv(out_dir, trace_name, job['job']['jobid']) diff --git a/drishti/handlers/handle_recorder.py b/drishti/handlers/handle_recorder.py index 0084c84..afccfce 100644 --- a/drishti/handlers/handle_recorder.py +++ b/drishti/handlers/handle_recorder.py @@ -580,11 +580,11 @@ def process_helper(file_map, df_intervals, df_posix_records, fid=None): display_footer(console, insights_start_time, insights_end_time) # Export to HTML, SVG, and CSV - input_filename = os.path.basename(os.path.dirname(args.log_path)) + trace_name = os.path.basename(os.path.dirname(args.log_path)) if args.split_files: - input_filename = f"{input_filename}.{fid}" + trace_name = f"{trace_name}.{fid}" out_dir = args.export_dir if args.export_dir != "" else os.getcwd() - export_html(console, out_dir, input_filename) - export_svg(console, out_dir, input_filename) - export_csv(out_dir, input_filename) + export_html(console, out_dir, trace_name) + export_svg(console, out_dir, trace_name) + export_csv(out_dir, trace_name) diff --git a/drishti/includes/module.py b/drishti/includes/module.py index f6f9fcf..9c2df16 100644 --- a/drishti/includes/module.py +++ b/drishti/includes/module.py @@ -1824,12 +1824,12 @@ def display_footer(console, insights_start_time, insights_end_time): ) -def export_html(console, export_dir, filename): +def export_html(console, export_dir, trace_name): if not args.export_html: return os.makedirs(export_dir, exist_ok=True) # Ensure export directory exists - filepath = os.path.join(export_dir, f"{filename}.html") + filepath = os.path.join(export_dir, f"{trace_name}.html") console.save_html( filepath, @@ -1838,12 +1838,12 @@ def export_html(console, export_dir, filename): ) -def export_svg(console, export_dir, filename): +def export_svg(console, export_dir, trace_name): if not args.export_svg: return os.makedirs(export_dir, exist_ok=True) # Ensure export directory exists - filepath = os.path.join(export_dir, f"{filename}.svg") + filepath = os.path.join(export_dir, f"{trace_name}.svg") console.save_svg( filepath, @@ -1853,7 +1853,7 @@ def export_svg(console, export_dir, filename): ) -def export_csv(export_dir, filename, jobid=None): +def export_csv(export_dir, trace_name, jobid=None): if not args.export_csv: return @@ -1903,7 +1903,7 @@ def export_csv(export_dir, filename, jobid=None): os.makedirs(export_dir, exist_ok=True) # Ensure export directory exists - filepath = os.path.join(export_dir, f"{filename}.csv") + filepath = os.path.join(export_dir, f"{trace_name}.csv") with open(filepath, 'w') as f: w = csv.writer(f)