Metadata-Version: 2.4
Name: LMID-conformally-flat-puncture
Version: 1.0.0
Summary: Certified, differentiable, parametric conformally-flat binary-black-hole puncture initial data — lemaitre.initial_data.conformally_flat_puncture
Author: Frederik De Ceuster
License-Expression: GPL-3.0-or-later
Project-URL: Homepage, https://github.com/LemaitreModels/LMID-conformally-flat-puncture
Project-URL: Repository, https://github.com/LemaitreModels/LMID-conformally-flat-puncture
Project-URL: Issues, https://github.com/LemaitreModels/LMID-conformally-flat-puncture/issues
Project-URL: Family, https://github.com/LemaitreModels/Lemaitre
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Astronomy
Classifier: Topic :: Scientific/Engineering :: Physics
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: lemaitre
Requires-Dist: LM-initial-data
Requires-Dist: numpy
Requires-Dist: scipy
Requires-Dist: jax
Requires-Dist: matplotlib
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: sympy; extra == "dev"
Requires-Dist: pytest-xdist; extra == "dev"
Requires-Dist: pytest-testmon; extra == "dev"
Provides-Extra: docs
Requires-Dist: sphinx; extra == "docs"
Requires-Dist: furo; extra == "docs"
Requires-Dist: myst-parser; extra == "docs"
Dynamic: license-file

# lemaitre.initial_data.conformally_flat_puncture (LMID-conformally-flat-puncture)

Certified, differentiable, **parametric** conformally-flat binary-black-hole
*initial data* via spectral collocation — the code and paper.

This is the `conformally_flat_puncture` model of the `initial_data` domain of the
**Lemaitre** package family. It installs under the shared `lemaitre` namespace,
so once installed:

```python
import lemaitre as lm

lm.initial_data.conformally_flat_puncture.solver.solver_3d   # the production 3-D xCFC solver
lm.initial_data.conformally_flat_puncture.parametric         # the certified/differentiable ROM layer
```

Its sibling `lemaitre.initial_data.curved_puncture` (repo `LMID-curved-puncture`) is the
non-conformally-flat successor, and reuses this package's ABT chart,
Newton–Krylov solver and ROM directly. Further family members
(`lemaitre.inspiral`, …) slot in under the same `lemaitre.` prefix when
installed alongside.

## Install

```bash
pip install LMID-conformally-flat-puncture
python -c "import lemaitre as lm; lm.initial_data.conformally_flat_puncture"   # smoke check
```

This installs the package with its two namespace parents, `lemaitre` and
`LM-initial-data`, and the solver stack. The trained models download themselves
from Zenodo on first use (see the
[documentation](https://lmid-conformally-flat-puncture.readthedocs.io/)).

### Development install

All three distributions are on PyPI, so a bare `pip install -e .` here resolves
the two parents from PyPI rather than from your checkout — which is not what you
want while developing against one. Install all three from a checkout of the
family superproject, outermost first, with `--no-deps` so pip uses the
checked-out parents:

```bash
pip install numpy scipy jax matplotlib pytest sympy    # the solver stack + test deps

# from the Lemaitre superproject root -- https://github.com/LemaitreModels/Lemaitre
# -- with LMID-conformally-flat-puncture checked out
for d in . LM-initial-data LM-initial-data/LMID-conformally-flat-puncture; do
  pip install -e "$d" --config-settings editable_mode=compat --no-deps
done
python -c "import lemaitre as lm; lm.initial_data.conformally_flat_puncture"   # smoke check
```

`--no-deps` and the **order** go together: pip must not resolve the two parents
from PyPI in place of your checkout, and each must already be installed before its
dependents — so the runtime stack is installed first, by hand. `sympy` is the
`[dev]` extra, needed by one test that fails rather than skips without it.

`editable_mode=compat` is not optional either — the modern editable mode makes
the two namespace levels degrade into PEP 420 portions, and lazy attribute
access then fails while a direct `import` still works.

Pure Python: `jax`, `numpy`, `scipy`, `matplotlib` (float64 throughout), plus the
dependency-free `lemaitre` / `LM-initial-data` namespace packages. No
machine-learning framework and no external solver code are required — the
package is self-contained (enforced by `tests/test_self_containment.py`).

## Layout

```
src/lemaitre/initial_data/conformally_flat_puncture/
  solver/         spatial elliptic (xCFC) solver — production 3-D stack + base layers
  parametric/     parameter-space collocation, Hermite/Smolyak, POD — the ROM
  applications/   parameter targeting, eccentricity control, differentiable sensitivity
  validation/     TwoPunctures oracle wrapper + ADM / constraint diagnostics
  pipeline/       canonical producers, runnable and importable:
                    run_*.py    per-figure / per-table data producers
                    build_*.py  surrogate-model builders (heavy; cluster)
tests/            acceptance suite (float64, CPU)
paper/            paper.tex + figures/ (recompute + plot scripts)
docs/             DATA.md (data regeneration + oracle)
                  · MODELS.md (which surrogate is shipped, and what it stores)
                  · conf.py + index.md: the Sphinx site (`make docs`, Read the Docs)
```

Only `lemaitre/initial_data/conformally_flat_puncture/` is shipped by this distribution —
`lemaitre/` and `lemaitre/initial_data/` are namespace levels owned by the
`lemaitre` core and the `LM-initial-data` umbrella respectively, so they
carry no `__init__.py` here.

## Reproduce the paper

```bash
make test        # run the acceptance suite
make figures     # (re)build any missing figure data, then plot every PDF
make tables      # recompute the table data then render the LaTeX bodies
```

**What a bare clone can and cannot do.** The plot tier is fully reproducible: the
plotters read `paper/figures/figdata/*.json` and nothing else — no `reports/`, no
models, no jax — so `make figures` redraws all ten PDFs from committed data with
only matplotlib. `make tables` genuinely recomputes: Table I derives its node
counts and box edges from `pipeline/production_box.py` in seconds, with no solve.

The **data** tier is not reproducible from a clone, and the numbers are the
paper's:

- each `figNN_*_data.py` **distils** a raw run artifact under `$LM_REPORTS` — it
  reshapes numbers a heavy-tier run already produced, rather than recomputing
  them from the solver. `fig07` additionally evaluates a shipped surrogate model
  (`.npz`) through the ROM; `fig10` distils an external GRTeclyn run tree.
- those raw artifacts are the **heavy tier**: multi-GB χ surrogate corpora
  (`make models`, cluster), the external TwoPunctures binary (`make oracle`), and
  the GRTeclyn constraint runs. None is committed.
- `make figdata` **skips any figdata that already exists**, and all ten are
  committed — so on a clone it rebuilds nothing and `make figures` only replots.
  `--force` re-distils, and then needs the heavy tier.

See `docs/DATA.md` for the heavy runs and how to rebuild each figure's data.

## License

GPL-3.0-or-later (GPLv3+) — the wording of the `License ::` classifier in
`pyproject.toml`. See `LICENSE`.
