Skip to content

fix: linear-interpolation#161

Merged
pollytur merged 7 commits into
sensorium-competition:mainfrom
binary69:fix/linear-interpolation
May 18, 2026
Merged

fix: linear-interpolation#161
pollytur merged 7 commits into
sensorium-competition:mainfrom
binary69:fix/linear-interpolation

Conversation

@binary69

Copy link
Copy Markdown
Collaborator

Closes #160

Fixes the linear interpolation in PhaseShiftedSequenceInterpolator.interpolate and SequenceInterpolator.interpolate

Copilot AI review requested due to automatic review settings April 15, 2026 11:31
@gitnotebooks

gitnotebooks Bot commented Apr 15, 2026

Copy link
Copy Markdown

@codecov

codecov Bot commented Apr 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes linear interpolation time calculations when start_time != 0 for both SequenceInterpolator and PhaseShiftedSequenceInterpolator, and extends tests to cover non-zero start times (issue #160).

Changes:

  • Add start_time when computing times_lower/times_upper in SequenceInterpolator.interpolate (linear mode).
  • Add start_time and per-signal phase shifts to times_lower/times_upper in PhaseShiftedSequenceInterpolator.interpolate (linear mode), and adjust numerator computation accordingly.
  • Expand linear interpolation tests to run with start_time set to 0.0 and 15.0.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.

File Description
experanto/interpolators.py Corrects linear interpolation time math to account for non-zero start_time (and phase shifts for the phase-shifted interpolator).
tests/test_sequence_interpolator.py Adds coverage for start_time != 0 in linear interpolation tests.
diff_output.txt Newly added artifact file containing an encoded diff; appears unintended.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread experanto/interpolators.py Outdated
@binary69

Copy link
Copy Markdown
Collaborator Author

hey @pollytur @schewskone did the changes, happy to get a review :)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes linear interpolation correctness when start_time != 0 for sequence-based interpolators, aligning computed sample times with the underlying timestamp origin (and per-signal phase shifts).

Changes:

  • Correct SequenceInterpolator.interpolate(..., interpolation_mode="linear") to include start_time in times_lower/times_upper.
  • Correct PhaseShiftedSequenceInterpolator.interpolate(..., interpolation_mode="linear") to include start_time (and phase shifts) in times_lower/times_upper, and apply the overflow row mask consistently to all derived arrays.
  • Extend linear interpolation tests to cover non-zero start_time.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
experanto/interpolators.py Fixes linear interpolation time math for non-zero start_time (and phase-shifted linear path), ensuring correct weight computation and consistent masking.
tests/test_sequence_interpolator.py Expands linear interpolation test parametrization to validate behavior when start_time is non-zero.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@schewskone schewskone 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.

LGTM, thanks for fixing this.

Comment thread experanto/interpolators.py Outdated
Comment thread experanto/interpolators.py Outdated
@binary69
binary69 requested a review from pollytur April 17, 2026 01:21
@pollytur
pollytur merged commit 09fd691 into sensorium-competition:main May 18, 2026
6 checks passed
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.

start_time missing from times_lower/times_upper in linear interpolation

4 participants