Skip to content

Commit

Permalink
fix(analysis): Avoid attempting to read non-existant "logLikelihood" …
Browse files Browse the repository at this point in the history
…attributes

If an analysis group does not have this attribute, do not read it and do not report on log-likelihood.
  • Loading branch information
abensonca committed Jul 28, 2021
1 parent f2bc234 commit c62cbe5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions scripts/analysis/analysesPlot.pl
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,11 @@
};
($attributes->{$_}) = $analysisGroup->attrGet($_)
foreach ( @attributeNames );
(my $logLikelihood) = $analysisGroup->attrGet('logLikelihood');
print " -> logℒ = ".$logLikelihood."\n";
$logLikelihoodTotal += $logLikelihood;
if ( grep {$_ eq "logLikelihood"} $analysisGroup->attrs() ) {
(my $logLikelihood) = $analysisGroup->attrGet('logLikelihood');
print " -> logℒ = ".$logLikelihood."\n";
$logLikelihoodTotal += $logLikelihood;
}
# Skip cases for which we have no "type" specified.
unless ( exists($attributes->{'type'}) ) {
print "Warning: analysis '".$analysisName."' has no 'type' attribute, so it can not be processed.\n";
Expand Down

0 comments on commit c62cbe5

Please sign in to comment.