Fix several simple bugs in Prior panel - #161
Conversation
|
EDIT: Sorry, my initial concern was incorrect. For a SimplexParam, Dirichlet is the only compatible entry, so the combo value never changes and the swap handler never runs. The problem only shows up for a vector parameter with IID is domain-polymorphic. What it can be applied to depends on its inner scalar distribution, not on its own param. But getDomain reads the domain off the template instance's placeholder param, which for IID is hardcoded domain="Real", so IID advertises itself as Real-only. That's the same placeholder mechanism this PR extends to Dirichlet. It is fine for Dirichlet, which genuinely is simplex-only, but it's the reason PositiveReal vectors match nothing. The fix is to special-case the two: IID compatible with any vector param (constrain the inner distr by the param's domain instead), Dirichlet only with a Simplex. That also closes the Real-vector hole from the earlier discussion, since Dirichlet would stop being offered there. |
|
Small issues from the same pass. In this PR
Pre-existing, surfaced while reviewing
|
|
Sorry, check my edit above. |

#159 — OneOnX prior removed in beast3, BEAUti had no replacement
Fix (beba5a4, c6093be):
#160 — Prior panel showing wrong info for parameters
Two separate bugs under this issue:
Bug 1 — Dirichlet prior parameter not shown (d7766f6):
The Dirichlet template was missing its param (simplex) input and suppressInputs setting, so BEAUti displayed it incorrectly in the Priors panel.
Fix: Added the missing SimplexParam and suppressInputs to the template.
Bug 2 — Wrong "type" label in the initial-value dialog (ebb69b9):
When you click a parameter's value/range button in the Priors panel, BEAUti opens a dialog whose title label is built from a Class argument. That argument was hardcoded to a generic interface (RealScalar.class, IntScalar.class) instead of the parameter's real class — so every dialog showed the same generic label (e.g. "RealScalar:") regardless of what parameter you were actually editing, and in two cases (IIDInputEditor, TensorDistributionInputEditor) it even used the scalar interface for vector parameters.
Fix: Pass p1.getClass() (the parameter's actual class) instead, in ScalarDistributionInputEditor, IIDInputEditor, and TensorDistributionInputEditor — 5 call sites total. Removed now-unused imports.