Skip to content

Stop early when run times are not calendar years - #22

Closed
eliotmcintire wants to merge 2 commits into
developmentfrom
defaults-safe
Closed

eliotmcintire wants to merge 2 commits into
developmentfrom
defaults-safe

Conversation

@eliotmcintire

@eliotmcintire eliotmcintire commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

The climate data are by calendar year, but a project set up without times runs in model years 0 to 10, and the module only failed later in an obscure way. It now stops at the start, only when the run's start is outside the climate years it was asked for, and says what to set.

Affects: A run whose start is outside historicalClimateYears and projectedClimateYears (1991 to 2100 by default) now stops at init with an explanatory message; runs inside them are unchanged.

Technical details

Depends-on: PredictiveEcology/climateData#32

Init() (canClimateData.R) never looked at start(sim), so model-year times went straight into climate preparation. Init() now calls climateData::checkCalendarYears() (replacing the copy in this module). When this module builds climateVariables from its parameters, the span is range(c(historicalClimateYears, projectedClimateYears)), so a start of 1950 stops with the years named and the parameters to change. When climateVariables is supplied, its years cannot be read here, so the check keeps the 1901 to 2100 span and the message says to set times to calendar years. end is never limited. The reqdPkgs floor is climateData 2.2.3.9009, today's development version; it must be raised to the version after climateData#32 merges. Tests (test-calendarYears.R) fail on development and pass here. Suite via convertToPackage + test_local: development 12 pass; branch 14 pass, 0 failures.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@eliotmcintire eliotmcintire added enhancement New feature or request backwards compatible Existing code and results keep working unchanged labels Oct 14, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
eliotmcintire added a commit that referenced this pull request Oct 15, 2026
Stop early when run times are not calendar years

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014G18Mik3fH4z5M5CyMSUS6
@eliotmcintire

Copy link
Copy Markdown
Collaborator Author

Closing: this change is carried on modsForFireSense and offered upstream together with our other FireSense fixes in #24. That PR lists it; the discussion here stays for reference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backwards compatible Existing code and results keep working unchanged enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant