Epic: Fourier consolidation and public API (one N-D Helmholtz kernel, one grid, one derivative class)
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
This is an epic consolidating the Fourier module. Start by reading spectraldiffx/_src/fourier/solvers.py to understand the current duplication. The work is broken into child issues (#106-#111) that must be tackled in order. First, implement the N-D Helmholtz kernel and per-axis BC spec table as described in #106, using existing tests to verify bit-compatibility. This requires deep familiarity with the codebase and spectral methods.
Written by the indexing model from the issue text.
Description
Scope
spectraldiffx/_src/fourier/solvers.py is 2523 lines of which roughly 85% is copies of one N-D kernel: 30 same-BC solvers are a 12-line skeleton × {fft, dst1, dst2, dct1, dct2} × {1d, 2d, 3d} × {helmholtz, poisson}, and 15 solve_poisson_* are forwarders. solve_helmholtz_3d (solvers.py:597-747) is already the generic per-axis loop. The three grid classes, three derivative classes and three filter classes are likewise hand-unrolled per dimension, with feature drift between them (only 1D has k_dealias, only 2D/3D have K2, only 1D has __call__(u, order)). exponential_filter and hyperviscosity are implemented seven times across Fourier, Chebyshev and spherical.
The public surface has 116 exports (38 solve_*, 18 eigenvalue builders, 8 transforms, 3 modify_rhs_*, 46 classes), two overlapping solver APIs neither of which is a superset of the other, four calling conventions, and lambda_ vs alpha.
Goal: one solve_helmholtz_nd kernel driven by a static per-axis BC spec table; one HelmholtzSolver module; N-D FourierGrid and SpectralDerivative; shared filter formulas; the existing names kept as thin aliases so nothing breaks. Expected reduction: ~1500–2000 lines. The existing "matches the monolithic solver to 1e-10" tests guard bit-compatibility.
Child issues (in suggested order)
- #106 refactor(solvers): one N-D Helmholtz kernel + per-axis spec table (2523 → ~600 lines; fixes 2D transform ordering; mixed BCs gain
approximation) — high - #107 refactor(solvers): one
HelmholtzSolver(grid, bc, approximation)replacing nine classes; unifylambda_/alphaand BC vocabulary — high - #108 refactor(fourier): N-D
FourierGridandSpectralDerivative, rfft path, spectral-in/spectral-out (1.5–1.75x) — medium - #109 refactor(filters): one implementation of the filter formulas (currently seven) — medium
- #110 feat(operators): missing operators (3/2-rule product, iterated Laplacian, vorticity helpers, spectra, IMEX inverse) — medium
- #111 refactor(api): move eigenvalue builders and
modify_rhs_*underspectraldiffx.fourier; deprecate un-numbered aliases — low - #122 docs(solvers): state where the boundary node sits for each transform type, with a staggered-grid example — requested by finitevolX (jejjohnson/finitevolX#300)
Do this after #80 so the consolidation preserves fixed behaviour, and after #102 so the new modules are born with static fields. #119 (dense-Kronecker sweep) is the regression net for #106.
Related
- #65 (scan-based time stepping) depends on #108's spectral-in/spectral-out RHS.
- #114 (express solvers through
gaussx.DiagonalisedOperator) builds on #106/#107. - Downstream consumer: jejjohnson/finitevolX#315 (adapter over
solve_helmholtz_nd/HelmholtzSolver).
- Dominant language
- Python
- Stars
- 2
- Forks
- 0
- Avg merge
- 8h 13m
- Merged PRs (30d)
- 8
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from jejjohnson/spectraldiffx
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
jejjohnson/spectraldiffx#172 ·
-
epic
Difficulty 1/5 Under an hour Newbie friendliness 62/100
jejjohnson/spectraldiffx#167 · 1 comment ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
jejjohnson/spectraldiffx#113 ·
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
jejjohnson/spectraldiffx#105 ·
-
dependencies
Difficulty 4/5 3-5 days Newbie friendliness 45/100
jejjohnson/spectraldiffx#181 ·
All issues in jejjohnson/spectraldiffx
Similar issues
-
bug(operator): VolterraOperator built inside jax.jit with a concrete decay raises TracerBoolConversionErrorPossibly taken @jejjohnson claimed this today. Opentype:bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
jejjohnson/integrix#144 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
finos/ai-governance-framework#459 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
autowarefoundation/autoware_carla_scenario#2963 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
freelawproject/litigant-portal#1307 ·
Maintainers usually reply within 2 days
-
type/bug
Difficulty 1/5 Under an hour Newbie friendliness 86/100
h2oai/h2o-llmstudio#1163 ·
Maintainers usually reply within 1 day