Skip to content

Fix inconsistent shift_operator (#146)#157

Merged
astanziola merged 2 commits intomainfrom
146-inconsistent-shift-operator
Feb 13, 2026
Merged

Fix inconsistent shift_operator (#146)#157
astanziola merged 2 commits intomainfrom
146-inconsistent-shift-operator

Conversation

@astanziola
Copy link
Copy Markdown
Member

Fixes #146

The FiniteDifferences shift_operator used dx[0] for all axes instead of dx[i] per axis, and did not broadcast single-element dx lists to multi-dimensional domains (unlike FourierSeries).

Changes

  • FiniteDifferences shift now applies dx[i] per axis
  • Single-element dx is broadcast to all dimensions for both discretizations
  • Updated docstrings for dx argument

Tests

  • Pinned exact numerical outputs for 1D shifts (both FD and Fourier)
  • Per-axis dx verification for 2D vector fields
  • Broadcast equivalence (dx=[a] == dx=[a, a])
  • Direction consistency between FD and Fourier
  • Zero-shift identity
  • jit compatibility

Closes #146

@astanziola astanziola marked this pull request as ready for review February 13, 2026 19:16
@astanziola astanziola merged commit 89f4a23 into main Feb 13, 2026
5 checks passed
@astanziola astanziola deleted the 146-inconsistent-shift-operator branch February 14, 2026 09:39
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.

inconsistent results of shift_operator

1 participant