Skip to content

Commit

Permalink
only generate gradient XML blocks when needed
Browse files Browse the repository at this point in the history
  • Loading branch information
GuyBaele committed Oct 10, 2024
1 parent 9c9f62e commit 68a519c
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/dr/app/beauti/generator/ClockModelGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@
import dr.util.Attribute;
import dr.xml.XMLParser;

import java.util.Map;

import static dr.inference.model.ParameterParser.PARAMETER;
import static dr.inferencexml.distribution.PriorParsers.*;
import static dr.inferencexml.distribution.shrinkage.BayesianBridgeLikelihoodParser.*;
Expand Down Expand Up @@ -299,10 +301,13 @@ public void writeBranchRatesModel(PartitionClockModel clockModel, XMLWriter writ

writeCovarianceStatistic(writer, tag, prefix, treePrefix);

//TODO put this in an IF statement depending on choice in BEAUti
//TODO add more String constants for this type of code
boolean generateScaleGradient = false;
if (options.getOperator("HMCRCS").isUsed()) {
generateScaleGradient = true;

for (Operator operator : options.selectOperators()) {
if (operator.getName().equals("HMC relaxed clock location and scale") && operator.isUsed()) {
generateScaleGradient = true;
}
}

if (generateScaleGradient) {
Expand Down

0 comments on commit 68a519c

Please sign in to comment.