ggchangepoint 0.2.0: unified ggcpt API, new engines, hardening - #1
Merged
Conversation
Implements the v0.2.0 scope from the roadmap and fixes correctness bugs found while auditing the implementation against it. New infrastructure - ggcpt S3 result class with print method - broom-style tidy()/glance()/augment() and ggplot2::autoplot(), all re-exported so library(ggchangepoint) is enough to call them - cpt_detect() dispatcher and cpt_penalty() helper - geoms/stat: geom_changepoint(), geom_cpt_segment(), geom_cpt_ci(), stat_changepoint(); theme_ggcpt(); annotate_segments() - wrappers: fpop, gfpop, wbs, wbs2, not, mosum, idetect, tguh (optional engines guarded via requireNamespace and kept in Suggests) - ggcpt_compare()/ggcpt_compare_table(); cpt_metrics()/ cpt_metrics_annotated()/ggcpt_eval(); cpt_simulate()/rcpt() and the canonical signal_* test signals Bug fixes found during the audit - gfpop_wrapper(): stop reporting the series endpoint n as a changepoint - idetect_wrapper(): read IDetect::ID()$cpt (was the non-existent $change_points, so it never returned a changepoint) - cpt_simulate(): apply per-segment standard deviations, so "var" and "meanvar" actually simulate a variance change - cpt_detect(): record the penalty actually used (glance() was always reporting MBIC); fall back to SIC for SegNeigh, which cannot use MBIC - ecp_wrapper(): no-change series returns an empty tibble (no spurious boundary changepoints / NA) - ggplot2 size -> linewidth migration with a lifecycle-deprecated alias Packaging / docs - modern "_PACKAGE" doc idiom; drop LazyData (no data/); drop datasets from Suggests; README.html no longer emitted - vignettes (introduction, comparison) rewritten for accuracy, with affiliation, complete/correct citations, and Suggests-aware chunks - testthat suite incl. regression tests for the fixes above Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
CRAN-ready 0.2.0 release. Implements the v0.2.0 scope from
next_release.mdand fixes correctness bugs found while auditing the implementation against the roadmap.What's in 0.2.0
ggcptS3 class;tidy()/glance()/augment()/autoplot()(re-exported);cpt_detect()dispatcher;cpt_penalty().geom_changepoint(),geom_cpt_segment(),geom_cpt_ci(),stat_changepoint(),theme_ggcpt(),annotate_segments().Suggests, guarded): fpop, gfpop, wbs, wbs2, not, mosum, idetect, tguh.ggcpt_compare(),ggcpt_compare_table(),cpt_metrics(),cpt_metrics_annotated(),ggcpt_eval(),cpt_simulate()/rcpt(),signal_*.Audit fixes (bugs that were actually broken)
gfpop_wrapper()reported the series endpointnas a changepoint.idetect_wrapper()read a non-existent field ($change_points) and never returned anything — now reads$cpt.cpt_simulate()ignored per-segment SDs, so"var"/"meanvar"did not actually change variance.glance()always reportedMBIC; now reports the penalty actually used. SegNeigh falls back to SIC (it can't use MBIC upstream).ecp_wrapper()no-change fix;size→linewidthmigration retained.Packaging / docs
"_PACKAGE"idiom; droppedLazyData(nodata/) anddatasetsfrom Suggests;README.htmlno longer emitted.introduction,comparison) rewritten for accuracy, with affiliation, complete/correct citations, and Suggests-aware chunks.testthatsuite, including regression tests for each fix above.Check status
R CMD check --as-cranon R 4.4.1: 0 errors / 0 warnings / 0 notes other than environment-only items on the test machine (qpdf, LaTeX, HTMLtidy, and network time verification are unavailable here; all present on CRAN).🤖 Generated with Claude Code