Skip to content

Beast3 - #16

Open
walterxie wants to merge 18 commits into
masterfrom
beast3
Open

Beast3#16
walterxie wants to merge 18 commits into
masterfrom
beast3

Conversation

@walterxie

@walterxie walterxie commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Migrates model-selection from BEAST2 (2.7.x) / Ant to BEAST3 (2.8.0-beta7) / Maven across 17 commits. Tracked in #14 ("Migrate to beast3").

Build system: Ant → Maven

  • Replaced build.xml with pom.xml (Java 25 release target, Maven Central publishing plugin).
  • Reorganized source tree into standard Maven layout: src/main/java, src/main/resources, src/test/java, src/test/resources.
  • Added module-info.java (JPMS), declaring requires/exports/provides, including the new org.apache.commons.statistics.distribution dependency and optional BEAST FX/JavaFX modules for the GUI.
    • Fixed two categories of service-provider registration errors here: MCMC2IS was dropped from the provides list because it's abstract and doesn't qualify (its shared logic was split into a new abstract MCMC2Abstract base class); ExponentialProductPosteriorMeansLikelihood, LogTransformedNormalKDEDistribution, and LogitTransformedNormalKDEDistribution each gained a public no-arg constructor so they do qualify.
  • Added .github/workflows/ci-publish.yml for tag-triggered CI + zip release, and src/assembly/beast-package.xml for the BEAST package zip (including sources jar and BeAUti fxtemplates).
  • Bumped version.xml to 1.7.0, depending on BEAST.base/BEAST.app >=2.8.0; registered the new MCMC2IS provider.

Parameter → Tensor

BEAST3 replaced beast.base.inference.parameter.Parameter/RealParameter with a generic Tensor type system (beast.base.spec.type.Tensor, RealScalarParam, RealVectorParam, etc.). Updated throughout:

  • KernelDensityEstimatorDistribution and its subclasses (NormalKDEDistribution, LogTransformedNormalKDEDistribution, LogitTransformedNormalKDEDistribution, MultivariateKccept Tensor<?, ? extends Double> instead ofParameter/RealParameter, including bounds-checking logic previously done via Parameter.getLower()/getUpper().
  • CPOAnalyser and the *SamplingStep classes updated d Prior wrapper distribution: LogNormal/Gamma/etc.now extend TensorDistribution directly, so the code pulls the target Tensor out via tensorDistribution.paramInput.get() instead of unwrapping a RealParameter from a Prior.
  • Related type fix in MCMC2IS: BEAST3's StateNode no longer implements Function, so a raw StateNode can no longer be pasFunction is expected. Narrowed via pattern-matching <?> before use.
  • PathSampler also gained fallback code paths so all example XMLs run correctly against the new type hierarchy.
    Commons Math → Commons Statistics
    BEAST3 dropped org.apache.commons.math (BetaDistribution/BetaDistributionImpl, GammaDistribution/GammaDistributionImpl, ExponentialDistribution/ExponentialDistributionImpl,athException). Replaced withorg.apache.commons.statistics.distribution in GSSTreeDistribution, PathSampler, PathSampleAnalyser, GeneralisedSteppingStone, and the KDE distribution classes. Mostly mechanical: newnstructors became static XDistribution.of(...)factory calls (e.g. BetaDistribution.of(alpha, 1.0)), and the checked MathException is gone, so the surrounding try/catch was
    removed. Declared the new module dependency in modul

Evaluator removed

BEAST3 deleted beast.base.inference.Evaluator and si() to a zero-arg method. In PathSamplingStep,PairedPathSamplingStep, and GeneralisedSteppingStoneStep, the old Evaluator-based block is commented out (not deleted) with a TODO explaining why: it was only ever exercised by BEAST2esn't exist in BEAST3 and wasn't used by this package anyway — replaced with a plain operator.proposal() call.

JUnit 4 → 5

  • GSSTreeDistributionTest migrated from org.junit.Test/junit.framework.TestCase to org.junit.jupiter.api.Test with static org.junit.jupiter.api.Assertions.assertEquals.
  • pom.xml adds junit-jupiter 5.8.2 and assertj-core as test dependencies, with Surefire configured for JPMS (--add-reads flags) and a BEAST_PACKAGE_PATH system property so tests can ret runtime.

Maven release beta1 is https://central.sonatype.com/artifact/io.github.beast2-dev/model-selection


TODO:

@walterxie
walterxie requested review from alexeid and rbouckaert July 28, 2026 04:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant