feat(pipekit): `spectraldiffx.pipekit` scaffolding — `Spectral` carrier, transforms, `GridSpec`, contract test
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
Direzione di ricerca
Start by reading the pipekit E1.2 JaxOperator contract and the implementation around Graph.describe() and JSON state round trips. Then implement the proposed spectraldiffx/pipekit/ modules and use testing.py to check transforms, pytree behavior, and operator contracts. The issue is done when the listed acceptance criteria pass, including the optional dependency error.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Part of epic #148. Depends on: pipekit E1.2 (pipekit_jax.JaxOperator). Not blocked by #108.
Proposal
spectraldiffx/
pipekit/
__init__.py
_src/
carrier.py # Spectral, as_hat, emit
base.py # SpectralOperator, GridSpec, build_grid
transforms.py # ToSpectral, ToPhysical
derivatives.py # #152 (E4.2)
solvers.py # #153 (E4.3)
diagnostics.py # #154 (E4.4)
testing.py # check_operator, count_transforms
class Spectral(eqx.Module):
"""Fourier coefficients of a real field. hat: complex[..., Ny, Nx(/2+1)]"""
hat: Array
real: bool = eqx.field(static=True, default=False) # True → rfft layout (#108)
# linear algebra on the carrier, so LinComb / RK stages work unchanged
def __add__(self, o): return Spectral(self.hat + o.hat, self.real)
def __sub__(self, o): return Spectral(self.hat - o.hat, self.real)
def __mul__(self, c): return Spectral(c * self.hat, self.real) # scalar only
__rmul__ = __mul__
def __neg__(self): return Spectral(-self.hat, self.real)
GridSpec = tuple # (Nx, Ny, Lx, Ly, dealias) — JSON primitives
class SpectralOperator(JaxOperator):
grid: GridSpec = eqx.field(static=True)
out: Literal["physical", "spectral"] = eqx.field(static=True, default="physical")
Carrier helpers, the single place representation is decided:
def as_hat(x, grid): # Array → transform; Spectral → as is
def emit(hat, grid, out, real): # out="spectral" → Spectral; else inverse (.real)
ToSpectral(grid): real [..., Ny, Nx] → Spectral. ToPhysical(grid): Spectral → real. Both are explicit graph nodes, so where the transforms happen is visible in Graph.describe().
testing.count_transforms(fn, *args) -> dict[str, int] counts fft_type=FFT|IFFT|RFFT|IRFFT in jax.jit(fn).lower(*args).compile().as_text(). check_operator(op, *inputs, budget=None) asserts:
- JSON
stateround-trip; - eager ≡ jit;
- leading-axis broadcast on
[2, …]stacks; - grad finite;
- if
budgetis given,count_transformsequals it.
Acceptance criteria
-
Spectralis a pytree.jax.tree.map,vmapandlax.scancarries all work, andrealsurvives round trips as static metadata. -
ToPhysical(ToSpectral(x)) == x(allclose) for random real fields, for both layouts once #108 adds rfft. - Budgets:
ToSpectral1 forward,ToPhysical1 inverse,ToPhysical ∘ ToSpectralexactly 2 (no silent extra transforms). -
import spectraldiffx.pipekitwithout pipekit raises anImportErrornaming the extra.
Generated by Claude Code
- Lingua principale
- Python
- Stelle
- 2
- Fork
- 0
- Merge medio
- 8h 13m
- PR unite (30g)
- 8
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di jejjohnson/spectraldiffx
-
documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
jejjohnson/spectraldiffx#172 ·
-
[EPIC] spectraldiffx roadmapApertaepic
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 62/100
jejjohnson/spectraldiffx#167 · 1 commento ·
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
jejjohnson/spectraldiffx#113 ·
-
documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
jejjohnson/spectraldiffx#105 ·
-
dependencies
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
jejjohnson/spectraldiffx#181 ·
Tutte le issue di jejjohnson/spectraldiffx
Issue simili
-
bug(operator): VolterraOperator built inside jax.jit with a concrete decay raises TracerBoolConversionErrorForse già presa @jejjohnson l’ha presa oggi. Apertatype:bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
jejjohnson/integrix#144 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
finos/ai-governance-framework#459 ·
-
slurm: a case outcome nested too deep crashes status/collect instead of reading as no outcomeAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
autowarefoundation/autoware_carla_scenario#2963 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
freelawproject/litigant-portal#1307 ·
I maintainer di solito rispondono entro 2 giorni
-
type/bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 86/100
h2oai/h2o-llmstudio#1163 ·
I maintainer di solito rispondono entro 1 giorno