Skip to content

[codex] Add Groovy formula DSL docs and verification close-out#291

Merged
perNyfelt merged 2 commits intomainfrom
stats-2.4.0-groovyFormulas-5
Apr 11, 2026
Merged

[codex] Add Groovy formula DSL docs and verification close-out#291
perNyfelt merged 2 commits intomainfrom
stats-2.4.0-groovyFormulas-5

Conversation

@perNyfelt
Copy link
Copy Markdown
Member

Summary

Finish the Groovy formula DSL work for matrix-stats by landing the section 4 fit helpers, the DSL follow-up fixes, the section 5 documentation updates, and the final section 6 verification record.

What Changed

  • Added FitDsl convenience entry points for lm, loess, and gam
  • Added regression tests for FitDsl parity against FitRegistry.instance().get(...).fit(ModelFrame.of(...).evaluate())
  • Centralized invalid-response | handling in TermExpr so non-variable response shapes report the formula-specific error instead of Groovy's generic missing-method error
  • Removed redundant or(...) overrides from formula DSL subclasses once the base implementation was in place
  • Documented the Groovy formula DSL in matrix-stats/README.md, docs/tutorial/3-matrix-stats.md, and docs/cookbook/matrix-stats.md
  • Added the Groovy formula DSL and fit helper entries to matrix-stats/release.md
  • Updated matrix-stats/req/v2.4.0-groovyFormulas.md through section 6 with the recorded validation commands

Why

The Groovy formula work needed three things to be complete:

  1. Direct fit helpers so callers can write lm(data) { ... } without manually building a ModelFrame
  2. Consistent DSL failure messages for invalid response-side expressions
  3. Documentation and recorded verification so the 2.4.0 feature scope is complete and reviewable

User Impact

Callers can now write:

lm(data) { y | x + group }
loess(data) { y | x }
gam(data) { y | smooth(time, 6) + group }

The docs now also describe:

  • string-vs-Groovy formula parity
  • deferred syntax (| and noIntercept)
  • dynamic propertyMissing / operator-dispatch behavior
  • the supported arithmetic scope inside I { ... }
  • interaction(x, group, z) for three-way interactions

Validation

  • GRADLE_USER_HOME=$PWD/.gradle-user ./gradlew :matrix-stats:test --tests 'formula.GroovyFormulaDslTest'
  • GRADLE_USER_HOME=$PWD/.gradle-user ./gradlew :matrix-stats:test --tests 'formula.*' --tests 'regression.*'
  • GRADLE_USER_HOME=$PWD/.gradle-user ./gradlew :matrix-stats:spotlessApply :matrix-stats:test :matrix-stats:codenarcMain :matrix-stats:codenarcTest
  • git diff --check -- matrix-stats/README.md docs/tutorial/3-matrix-stats.md docs/cookbook/matrix-stats.md matrix-stats/release.md
  • GRADLE_USER_HOME=$PWD/.gradle-user ./gradlew test

All of the above passed. The final full-repo run completed with:

BUILD SUCCESSFUL in 17m 6s
530 actionable tasks: 529 executed, 1 up-to-date
Configuration cache entry stored.

@perNyfelt perNyfelt marked this pull request as ready for review April 11, 2026 21:03
@perNyfelt perNyfelt merged commit 7c9414f into main Apr 11, 2026
1 check passed
@perNyfelt perNyfelt deleted the stats-2.4.0-groovyFormulas-5 branch April 11, 2026 21:04
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