Point OneOnX @deprecated at LogUniform#86
Merged
Conversation
The previous deprecation message said only '1/x can be simulated. Use other distributions.' which left migrators guessing. LogUniform is the natural proper replacement: density 1/(x log(upper/lower)) on [lower, upper], so on its support it is proportional to 1/x and is normalisable. Suggest it explicitly so a same-simple-name automated migration hint isn't the only option. Surfaced by the deprecated-class scan in beast3-migration: until this edit, OneOnX referenced in package XMLs (bModelTest, ORC, CoupledMCMC, the bModelTest fxtemplate) was reported as 'no spec equivalent found' because no class with the literal simple name OneOnX exists in any spec package. With the link in the javadoc, the linter's javadoc fallback now resolves OneOnX -> LogUniform automatically.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
OneOnX's deprecation message previously said only "1/x can be simulated. Use other distributions" — which leaves migrators (and downstream tooling) guessing what to substitute.LogUniformis the natural proper replacement: its density1 / (x · log(upper/lower))on[lower, upper]is, on its support, proportional to1/x. Unlike the legacy improper1/xprior it's normalisable and can be sampled from directly.Point the
@deprecatedbody explicitly atLogUniformso a future migrator can read the replacement off the javadoc, and so deprecation-aware tooling can produce a non-empty hint without hand-curated mappings.Test plan
mvn -q compilesucceeds locallybeast.base.inference.distribution.OneOnX→beast.base.spec.inference.distribution.LogUniformautomatically via its javadoc-fallback (89 → 90 of 105 deprecated classes carry an automated spec replacement).