nicfel / CoupledMCMC

Adaptive parallel tempering for Beast2
GNU General Public License v3.0
7 stars 4 forks source link

Throws exception when a loggable has 0 inputs #15

Closed jordandouglas closed 4 years ago

jordandouglas commented 4 years ago

I wrote a loggable class (implements Loggable) which does not have any Input<> members and I got this error message:

This BEASTInterface (testLog) has no input with name value. Choose one of these inputs: fileName,logEvery,model,mode,sort,sanitiseHeaders,log

Error detected about here:
  <beast>
      <run id='mcmc' spec='beast.coupledMCMC.HeatedChain'>
          <coupledLogger id='testLog' spec='beast.coupledMCMC.CoupledLogger'>

This was fixed on my end by adding this line to the new loggable class:

final public Input<Tree> tmpInput = new Input<>("tmp", "fudge factor", Input.Validate.FORBIDDEN);

Cheers

rbouckaert commented 4 years ago

If there were a @Description annotation on the class (which you should have anyway), this problem would not occur. It stems from the XMLProducer in the beast2 package, which considers classes without inputs, description or @param annotation to be primitive objects.