Skip to content

cd_summary(): name the trend window when a table holds several trend_start - #109

Merged
NewGraphEnvironment merged 4 commits into
mainfrom
106-cd-summary-trends-from-several-trend-sta
Sep 30, 2026
Merged

NewGraphEnvironment merged 4 commits into
mainfrom
106-cd-summary-trends-from-several-trend-sta

Conversation

@NewGraphEnvironment

Copy link
Copy Markdown
Owner

Summary

  • cd_summary() adds a Start column (the requested trend_start) when a trend table holds more than one window, such as cd_trend(x, trend_start = c(1951, 1981)). Rows that previously differed only by Years now say which window they are. Start follows Period, or Trend on when present. Like cd_summary(): stations sharing a long_name give indistinguishable rows #98's Trend on, it appears only when the table needs it, so single-window tables keep their shape.
  • Both vignettes showed this bug: each trend table had 59 row pairs that were identical on Parameter/Period. They now carry Start, and the hidden trend-table chunk orders rows so each 1951/1981 pair sits together.
  • CLAUDE.md: one sentence next to the Trend on rule.

Related Issues

Test plan

  • devtools::test(): 410 pass, 0 fail. The new tests failed against main's cd_summary().
  • Both vignettes render locally from committed .rds with load_all. Header is Parameter | Period | Start | Slope | …, 118 rows, 0 duplicates on Parameter/Period/Start.
  • Plan review plus 3 code-check rounds, all clean (planning/archive/2026-09-issue-106-summary-trend-start/review-round*.md).

Notes

🤖 Generated with Claude Code

https://claude.ai/code/session_01GignjoKpZADXywTf6pAMgj

NewGraphEnvironment and others added 4 commits September 30, 2026 09:29
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GignjoKpZADXywTf6pAMgj
A table from cd_trend(x, trend_start = c(1951, 1981)) gave two rows per
variable and period that differed only by Years. cd_summary() now adds a
Start column (the requested trend_start) when the table holds more than one,
after Period or Trend on, mirroring the conditional Trend on column (#98).
Single-window tables keep their shape.

Fixes #106

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GignjoKpZADXywTf6pAMgj
Both vignettes' trend tables now carry Start (#106). The hidden trend-table
chunk orders rows by variable, period and start so the 1951 and 1981 rows
of each series sit together instead of 59 rows apart.

Relates to #106

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GignjoKpZADXywTf6pAMgj
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GignjoKpZADXywTf6pAMgj
@NewGraphEnvironment
NewGraphEnvironment merged commit 5e5bf3d into main Sep 30, 2026
1 check passed
@NewGraphEnvironment
NewGraphEnvironment deleted the 106-cd-summary-trends-from-several-trend-sta branch September 30, 2026 16:42
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.

cd_summary(): trends from several trend_start values differ only by Years

1 participant