Skip to content

Trace utilities no longer available to downstream packages after Maven migration #42

@alexeid

Description

@alexeid

Problem

Reported by Joelle Barido-Sottani:

I'm currently testing the new Maven build - seems the test classes are no longer exported? I was using some of the trace reading utilities (in the test.beast.beast2vs1.trace package) for my own tests and they can't be found anymore. Is there a way to put them back?

The old Ant build explicitly created a test.beast.jar containing all compiled test classes. When we migrated to Maven, this was not carried over — Maven only packages src/main/java classes by default.

Analysis

The classes in test.beast.beast2vs1.trace are not actually test classes. They are general-purpose trace-analysis tools that were misplaced in the test tree:

  • LogAnalyser — a BEAST Runnable with @Description/@Citation and Input fields
  • Expectation — a BEASTObject for comparing expected vs actual trace values
  • LogFileTraces — log file parser
  • TraceStatistics — computes mean, stdev, median, HPD, ESS, autocorrelation time, etc.
  • NumberFormatter, TraceException, TraceType, TrimLineReader — supporting utilities
  • DiscreteStatistics — identical duplicate of beast.base.util.DiscreteStatistics

Proposed solution

  1. Move the 8 classes (excluding the duplicate DiscreteStatistics) from src/test/java/test/beast/beast2vs1/trace/ to src/main/java/beast/base/trace/ in beast-base.
  2. Delete the test DiscreteStatistics and have TraceStatistics use the existing beast.base.util.DiscreteStatistics.
  3. Export beast.base.trace in module-info.java.
  4. Update internal test imports.

Future work

beastfx.app.tools.LogAnalyser duplicates much of this functionality (log parsing, ESS, HPD, etc.) but is coupled to beast-fx via a Swing file-chooser fallback — even though the class is otherwise entirely GUI-less. A follow-up refactor should extract the pure computation from the beast-fx LogAnalyser into beast.base.trace and have the beast-fx class delegate to it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions