refactor(api): move the 18 eigenvalue builders and `modify_rhs_*` under `spectraldiffx.fourier`; deprecate the un-numbered `solve_helmholtz_dst/dct` aliases; document what remains public
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 40/100
- Issue type
- Refactor
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- jupyter-notebook, python
- Domain
- backend-api-design, documentation, tooling
Research direction
The work involves understanding the package structure in spectraldiffx/init.py and solvers.py. Start by reading the existing exports and the deprecation logic. The main tasks are creating a new subpackage spectraldiffx.fourier, moving eigenvalue builders and modify_rhs_* functions there, and adding all to modules. Check the linked issue #83 for context. Run mkdocs build --strict to verify documentation. 'Done' means the top-level all has ≤40 names, deprecated names warn, and the API docs are complete.
Written by the indexing model from the issue text.
Description
Part of #83. Do last in the epic, after the kernel and class consolidation.
Summary
spectraldiffx/__init__.py exports 116 names: 38 solve_{helmholtz,poisson}_{fft,dct,dct1,dct2,dst,dst1,dst2}[_1d|_3d], 18 {fft,dct1..4,dst1..4}_eigenvalues[_ps], 8 transforms, 3 modify_rhs_*, 3 BC/capacitance names, 46 classes. Of these:
solve_helmholtz_dst1 = solve_helmholtz_dst,solve_helmholtz_dct2 = solve_helmholtz_dct, and the two poisson equivalents (solvers.py:1589-1597) are exported aliases with no API page; the un-numbered names hide which grid type (regular vs staggered) they use.- The 18 eigenvalue builders are three formulas (FD2
2(cos θ − 1)/dx², PS−k², and the four identical mixed-BC wrappers ateigenvalues.py:213-306);fft_eigenvalues_psduplicatesgrid.k**2. They are implementation details of the solvers and only appear at top level because nothing else was there to hold them. modify_rhs_1d/2d/3dare solver internals.- 17 of the 116 names have no API page (list in #85's docs issue).
- No module has an
__all__except the package root.
Proposed fix
- Create
spectraldiffx.fourier(public subpackage) re-exporting grids, operators, filters, solvers, transforms; andspectraldiffx.fourier.eigenvaluesholding onelaplacian_eigenvalues(N, dx, bc, approximation)function plus the existing 18 as thin deprecated wrappers. Same pattern forspectraldiffx.chebyshev(after #79) andspectraldiffx.spherical. - Keep the top-level exports for one release with
DeprecationWarningon the moved names (via a module__getattr__), then remove them. - Deprecate
solve_helmholtz_dst,solve_helmholtz_dct,solve_poisson_dst,solve_poisson_dctin favour of the numbered names (or ofsolve_helmholtz_nd). - Add
__all__to every module; makeruff'sF401/PLC0414configuration enforce it. - Write
docs/api/index.mdwith the intended public surface: transforms · grids · derivatives/filters ·HelmholtzSolver+solve_helmholtz_nd·CapacitanceSolver· spherical/Chebyshev equivalents.
Acceptance criteria
- Top-level
__all__≤ 40 names after the deprecation window; every one has an API page (a test walks__all__and grepsdocs/api/**/*.mdfor::: spectraldiffx.<name>). - Deprecated names emit
DeprecationWarningwith the replacement in the message. -
mkdocs build --strictpasses.
- 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