Skip to content

Commit

Permalink
Fix dendrogram names
Browse files Browse the repository at this point in the history
Separates legacy behavior (YAML files) and modern behavior (TOML files).
When using TOML files, the output name is updated to reflect the subset
of platforms that were actually included in the analysis.

Signed-off-by: John Pennycook <john.pennycook@intel.com>
  • Loading branch information
Pennycook committed Mar 6, 2024
1 parent a09cbe6 commit 2abf3d1
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions bin/codebasin
Original file line number Diff line number Diff line change
Expand Up @@ -306,11 +306,17 @@ def main():

# Print clustering report
if report_enabled("clustering"):
if config_file is None:
platform_names = [p[0] for p in args.platforms]
output_prefix = "-".join(platform_names)
else:
# Legacy behavior: guess prefix from YAML filename
if config_file is not None:
output_prefix = os.path.realpath(guess_project_name(config_file))

# Modern behavior: append platforms to TOML filename
else:
basename = os.path.basename(args.analysis_file)
filename = os.path.splitext(basename)[0]
platform_names = [p for p in codebase["platforms"]]
output_prefix = "-".join([filename] + platform_names)

clustering_output_name = output_prefix + "-dendrogram.png"
clustering = report.clustering(clustering_output_name, setmap)
if clustering is not None:
Expand Down

0 comments on commit 2abf3d1

Please sign in to comment.