Getting Started¶
Four ways to use GSF, roughly in order of commitment:
- GSF Explorer — interactive model exploration in the browser, nothing to install.
- Tutorial gallery — notebooks running in the browser, editable and downloadable.
- Run notebooks locally — marimo or Jupyter, full filesystem access (e.g. for custom fit directories).
- Use as a package —
import globalsplinefitin your own code.
Install¶
Note
Until the first PyPI release lands, install from GitHub instead:
The core package depends only on numpy and scipy. Quick check:
import numpy as np
from globalsplinefit import GSFEnergy
gsf = GSFEnergy() # default: version "2026"
print(gsf.flux(np.logspace(3, 5, 3), "p"))
See the User Guide for model classes, versions, and units.
Run the tutorials locally¶
The tutorials in examples/
are marimo notebooks — plain Python files. From a clone:
git clone https://github.com/gsf-project/globalsplinefit.git
cd globalsplinefit
uv run marimo edit examples/cosmic_ray_flux.py # interactive editor
uv run python examples/cosmic_ray_flux.py # run straight through
Prefer Jupyter? Convert any notebook:
uvx marimo export ipynb examples/cosmic_ray_flux.py -o cosmic_ray_flux.ipynb
jupyter lab cosmic_ray_flux.ipynb
Run the GSF Explorer locally¶
The Explorer is a static web app (Pyodide — Python in the browser); the local server is only needed to serve the files:
If you changed the package source, rebuild the wheel the Explorer loads
first: webapp/update_wheel.sh.
Build from source¶
Development uses uv; uv.lock is committed.
git clone https://github.com/gsf-project/globalsplinefit.git
cd globalsplinefit
uv sync --all-extras # create/refresh .venv with all extras
uv run pytest tests/ # run the test suite
uv build # build sdist + wheel into dist/
Build and preview this documentation site:
The browser tutorials under /gallery/ are produced in CI by
marimo export html-wasm; to build one locally: