Skip to content

feat: add "anchor" method as offset method#107

Merged
officialankan merged 9 commits into
devfrom
104-bug-offset-function-having-issues-with-downscaling-data
Jun 5, 2026
Merged

feat: add "anchor" method as offset method#107
officialankan merged 9 commits into
devfrom
104-bug-offset-function-having-issues-with-downscaling-data

Conversation

@officialankan

Copy link
Copy Markdown
Collaborator

From the new notebook on time offsets

Two grouping methods are available via the method parameter:

  • "anchor" (default): each observation time is the center of a ±offset window; all reference points inside that window are aggregated into one output pair per observation. Works reliably for both sparse and dense/high-frequency reference data.
  • "consecutive": all timestamps from both series are merged, sorted, and split into groups wherever the gap between consecutive timestamps exceeds offset. Both reference and observation values within each group are aggregated. This was the default prior to version 1.0.0, and remains available for very sparse, irregular monitoring data where the chaining behaviour is intentional.

officialankan and others added 8 commits April 21, 2026 06:55
…torized implementation

- Add method="anchor" (default) and method="consecutive" to groupby_time_equivalents
  and analyze_offsets; anchor uses obs-anchored ±offset windows with fully vectorized
  numpy broadcasting, consecutive restores the pre-fix gap-chaining algorithm
- Propagate te_method through all fitting functions and store in FitResultData
- Fix analyze_offsets parameter order to obs-first, matching all other functions
- Update tests and 3_time_offsets.ipynb to reflect new default behaviour

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…torized implementation

- Add method="anchor" (default) and method="consecutive" to groupby_time_equivalents
  and analyze_offsets; anchor uses obs-anchored ±offset windows with fully vectorized
  numpy broadcasting, consecutive restores the pre-fix gap-chaining algorithm
- Propagate te_method through all fitting functions and store in FitResultData
- Fix analyze_offsets parameter order to obs-first, matching all other functions
- Update tests and 3_time_offsets.ipynb to reflect new default behaviour

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@officialankan officialankan self-assigned this May 2, 2026
@officialankan officialankan requested a review from eriktoller May 2, 2026 19:07
@officialankan officialankan added the enhancement New feature or request label May 2, 2026
@officialankan officialankan linked an issue May 2, 2026 that may be closed by this pull request
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

@eriktoller eriktoller left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent work 🎉

@eriktoller

Copy link
Copy Markdown
Collaborator

@officialankan ready to merge

@officialankan officialankan merged commit 4a914c4 into dev Jun 5, 2026
3 checks passed
@officialankan officialankan deleted the 104-bug-offset-function-having-issues-with-downscaling-data branch June 5, 2026 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: Offset function having issues with downscaling data

2 participants