Make chart naming consistent + simplify menu datafile selection
This commit is contained in:
+28
-12
@@ -573,24 +573,28 @@ my %handlers = (
|
||||
die "No plot selected" unless @selected_charts;
|
||||
|
||||
# Need to know which chart uses which datafile
|
||||
my @faults_charts = grep { /heatmap|scatter|sankey/ } @selected_charts;
|
||||
my @faults_charts =
|
||||
grep { /heatmap|scatter|sankey|instr_fault_correlation/ }
|
||||
@selected_charts;
|
||||
my @resultsdata_charts =
|
||||
grep {
|
||||
/result$|combined_comparison|ratio_comparison|ratio_correlation/
|
||||
} @selected_charts;
|
||||
grep { /result|combined_comparison|combined_ratio/ } @selected_charts;
|
||||
|
||||
# Select if faults.csv or a filtered variant should be used
|
||||
my $faults_csv;
|
||||
my $resultsdata_csv;
|
||||
if (@faults_charts) {
|
||||
$faults_csv = Util::pick_data_file(
|
||||
"$local_archive_dir/$selected_experiments[0]", "faults" );
|
||||
}
|
||||
|
||||
# Select if resultsdata.csv or a filtered variant should be used
|
||||
my $resultsdata_csv;
|
||||
if (@resultsdata_charts) {
|
||||
$resultsdata_csv = Util::pick_data_file(
|
||||
"$local_archive_dir/$selected_experiments[0]",
|
||||
"resultsdata" );
|
||||
}
|
||||
|
||||
# Plot single-experiment charts
|
||||
my @single_charts = grep { /single/ } @selected_charts;
|
||||
foreach my $experiment (@selected_experiments) {
|
||||
foreach my $chart (@single_charts) {
|
||||
@@ -600,18 +604,24 @@ my %handlers = (
|
||||
"$local_charts_dir/$chart.r",
|
||||
"$local_archive_dir/$experiment"
|
||||
);
|
||||
|
||||
# If the chart is marked in @faults_charts,
|
||||
# append the $faults_csv to the args
|
||||
push @r_args, $faults_csv
|
||||
if defined $faults_csv && $chart =~ /heatmap|scatter|sankey/;
|
||||
if defined $faults_csv
|
||||
&& grep { $_ eq $chart } @faults_charts;
|
||||
|
||||
# If the chart is marked in @resultsdata_charts,
|
||||
# append the $resultsdata_csv to the args
|
||||
push @r_args, $resultsdata_csv
|
||||
if defined $resultsdata_csv
|
||||
&& $chart =~ /result$|combined_comparison/;
|
||||
&& grep { $_ eq $chart } @resultsdata_charts;
|
||||
system(@r_args);
|
||||
}
|
||||
}
|
||||
|
||||
my @combined_charts =
|
||||
grep { /combined|ratio_comparison|ratio_correlation/ }
|
||||
@selected_charts;
|
||||
grep { /combined/ } @selected_charts;
|
||||
my $print_experiments = join " ", @selected_experiments;
|
||||
my @path_experiments =
|
||||
map { "$local_archive_dir/$_" } @selected_experiments;
|
||||
@@ -619,12 +629,18 @@ my %handlers = (
|
||||
say " - Generating plot $chart for ($print_experiments)...";
|
||||
my @r_args =
|
||||
( 'Rscript', "$local_charts_dir/$chart.r", @path_experiments );
|
||||
|
||||
# If the chart is marked in @faults_charts,
|
||||
# append the $faults_csv to the args
|
||||
push @r_args, $faults_csv
|
||||
if defined $faults_csv && $chart =~ /heatmap|scatter|sankey/;
|
||||
if defined $faults_csv
|
||||
&& grep { $_ eq $chart } @faults_charts;
|
||||
|
||||
# If the chart is marked in @resultsdata_charts,
|
||||
# append the $resultsdata_csv to the args
|
||||
push @r_args, $resultsdata_csv
|
||||
if defined $resultsdata_csv
|
||||
&& $chart =~
|
||||
/result$|combined_comparison|ratio_comparison|ratio_correlation/;
|
||||
&& grep { $_ eq $chart } @resultsdata_charts;
|
||||
system(@r_args);
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user