Skip to content

Commit

Permalink
fmt: Rename input_filename to trace_name
Browse files Browse the repository at this point in the history
  • Loading branch information
jay-tau committed Jun 19, 2024
1 parent 42f1bf3 commit e0536fb
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
8 changes: 4 additions & 4 deletions drishti/handlers/handle_darshan.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'])
10 changes: 5 additions & 5 deletions drishti/handlers/handle_recorder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
12 changes: 6 additions & 6 deletions drishti/includes/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit e0536fb

Please sign in to comment.