Skip to content

Add optional sinceYear to IAreaReference for rolling-archive append l… - #1

Open
andrewcottam wants to merge 1 commit into
masterfrom
feat/since-year-area-reference
Open

andrewcottam wants to merge 1 commit into
masterfrom
feat/since-year-area-reference

Conversation

@andrewcottam

Copy link
Copy Markdown

Summary

  • Adds an optional sinceYear?: number field to IAreaReference (src/insights.ts), so a calculation request can say "resume from this year" instead of always recomputing full history.
  • First consumer: Net Primary Productivity (ModisNPPCalculations.ts in restor2-gee-integration), prototyped and verified locally against a local AreaReferenceWithSinceYear type-augmentation cast — this PR replaces the need for that cast with the real, published field.
  • Optional and additive, so this is backwards compatible for every existing caller of IAreaReference.
  • dist/src/insights.d.ts is hand-updated to match the source change (rather than a full tsc rebuild, to avoid unrelated compiler-version noise across the rest of dist/). dist/src/insights.js is unchanged, since interface fields are compile-time only and emit no JS.
  • Version bumped 1.9.3 → 1.9.4.

Part of the Year-Series Append Plan (rolling-archive calculations -- NDVI, Net Primary Productivity, Evapotranspiration -- appending only new years instead of recomputing history). NPP is first; this is the shared-package piece that unblocks it.

Test plan

  • Verified locally against live Earth Engine (dev project, Ape Malaysia Volunteer Site 5): unfiltered request returns years 2001–2025; sinceYear: 2022 returns exactly 2022–2025, with all overlapping yValues numerically identical between the two.
  • Bump restor-data-types dependency version in restor2-gee-integration once this is merged, and drop the local AreaReferenceWithSinceYear cast in favor of the real field.

…ogic

Lets a calculation resume from a given year instead of recomputing its
full history -- first consumer is Net Primary Productivity
(ModisNPPCalculations.ts in restor2-gee-integration), prototyped and
verified there against a local AreaReferenceWithSinceYear cast. This
adds the field to the real, published type so that cast can be
dropped.

Optional and additive, so this is backwards compatible for every
existing caller. dist/src/insights.d.ts is hand-updated to match
(rather than a full tsc rebuild, to avoid unrelated compiler-version
noise across the rest of dist/); dist/src/insights.js is unchanged
since interface fields are compile-time only and emit no JS.

Version bumped 1.9.3 -> 1.9.4.
@andrewcottam
andrewcottam requested a review from vetm73 September 18, 2026 14: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.

1 participant