refactor(capacitance): `spectraldiffx.CapacitanceSolver` shares its public name with the unrelated `gaussx.CapacitanceSolver`; rename the spectraldiffx wrapper

Open
#123 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
55/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Active
Tech stack
python
Domain
api, documentation

Research direction

Start by tracing the spectraldiffx.CapacitanceSolver export and build_capacitance_solver in spectraldiffx/_src/fourier/capacitance.py, then read docs/capacitance_guide.md and docs/theory/capacitance.md. Check how the public export and deprecation behavior are tested, if tests are present, and review #115 before choosing between the proposed names. Done means the new wrapper name is exported, the old name warns, both docs identify gaussx.CapacitanceSolver by full path, and the finitevolX re-export can follow #318.

Written by the indexing model from the issue text.

Description

enhancement

Part of #84. Found by the finitevolX audit (jejjohnson/finitevolX#318), which re-exports the spectraldiffx class under the shared name.

Summary

Two different classes are exported as CapacitanceSolver:

  • gaussx.CapacitanceSolver (gaussx/_operators/_capacitance.py): generic "enforce homogeneous point constraints on a flat vector via the capacitance-matrix correction"; takes (base_solve, boundary_indices, n).
  • spectraldiffx.CapacitanceSolver (spectraldiffx/_src/fourier/capacitance.py): an eqx.Module holding a gaussx CapacitanceSolver plus a 2-D mask, dx, dy, lambda_, base_bc, reshaping between fields and flat vectors; returned by build_capacitance_solver.

A user with both packages imported (finitevolX depends on both) sees two CapacitanceSolver names with different constructors and semantics, and finitevolX's docs cannot say "the CapacitanceSolver" unambiguously.

Proposed fix

Rename the spectraldiffx wrapper to MaskedSpectralSolver (or SpectralCapacitanceSolver), keep CapacitanceSolver as a deprecated alias for one release, and have build_capacitance_solver return the new type. This dovetails with #115, where the wrapper is expected to become a thin adapter over gaussx.solve(MaskedOperator(...)) and the gaussx name is the one that should survive.

Acceptance criteria

  • spectraldiffx.MaskedSpectralSolver (or chosen name) exported; spectraldiffx.CapacitanceSolver warns.
  • Docs (docs/capacitance_guide.md, docs/theory/capacitance.md) use the new name and mention the gaussx class by its full path.
  • finitevolX re-export updated in jejjohnson/finitevolX#318.
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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from jejjohnson/spectraldiffx

All issues in jejjohnson/spectraldiffx

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.