improve knit_print for LogisticNormalMixture#937
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the knit_print() output for LogisticNormalMixture models and adds snapshot coverage to ensure the rendered LaTeX/markdown/HTML stays stable.
Changes:
- Reworked
knit_print.LogisticNormalMixture()to build the mixture prior LaTeX directly (instead of embedding nestedknit_print(ModelParamsNormal)output). - Added a new snapshot test for
knit_print()onLogisticNormalMixtureand corresponding markdown snapshot. - Updated the macOS/Darwin HTML snapshot for
knit_print_LogisticNormalMixture.htmlto reflect the new rendering.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
R/helpers_knitr_GeneralModel.R |
Adjusts knit_print.LogisticNormalMixture() output construction for mixture prior rendering. |
tests/testthat/test-helpers_knitr_GeneralModel.R |
Adds a snapshot test for knit_print() on LogisticNormalMixture. |
tests/testthat/_snaps/helpers_knitr_GeneralModel.md |
Adds the expected snapshot output for the new test. |
tests/testthat/_snaps/Darwin/helpers_knitr/knit_print_LogisticNormalMixture.html |
Updates the Darwin HTML snapshot to match the new output. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
….com/openpharma/crmPack into fix_knit_print_LogisticNormalMixture
There was a problem hiding this comment.
Pull request overview
Fixes knit_print() rendering for LogisticNormalMixture in knitr/rmarkdown output and adds regression coverage to prevent reintroducing the formatting issue.
Changes:
- Refactors
knit_print.LogisticNormalMixture()to render mixture components via a dedicated internal LaTeX helper (avoiding malformed nestedknit_print()output). - Adds a new snapshot test for
knitr::knit_print()on aLogisticNormalMixtureinstance and updates snapshots. - Bumps development version and documents the fix in
NEWS.md.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/testthat/test-helpers_knitr_GeneralModel.R | Adds snapshot regression test for knitr::knit_print(LogisticNormalMixture). |
| tests/testthat/_snaps/Darwin/helpers_knitr_GeneralModel.md | Adds Darwin snapshot output for the new GeneralModel knit_print test. |
| tests/testthat/_snaps/Darwin/helpers_knitr/knit_print_LogisticNormalMixture.html | Updates Darwin HTML snapshot showing corrected mixture-prior rendering in rendered HTML. |
| R/helpers_knitr_GeneralModel.R | Introduces internal Normal-component renderer and updates knit_print.LogisticNormalMixture() to use it. |
| NEWS.md | Notes the LogisticNormalMixture knit_print rendering bugfix. |
| DESCRIPTION | Bumps package version to 2.1.0.9000. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
tests/testthat/_snaps/Darwin/helpers_knitr/knit_print_LogisticNormalMixture.html
Show resolved
Hide resolved
Unit Tests Summary 1 files 55 suites 4m 41s ⏱️ Results for commit ba2705e. ♻️ This comment has been updated with latest results. |
Unit Test Performance Difference
Additional test case details
Results for commit 747f8b5 ♻️ This comment has been updated with latest results. |
Code Coverage SummaryDiff against mainResults for commit: ba2705e Minimum allowed coverage is ♻️ This comment has been updated with latest results |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
No description provided.