2.0 (August 26, 2025)#

  • Released August 26, 2025

  • 26 contributors (10 new contributors)

  • 312 pull requests since v1.3, 497 pull requests since 1.0

  • 118 closed issues

Summary#

Gammapy v2.0 is a new Long Term Stable (LTS) release. It will be maintained for the next development cycle (approximately two years), while support for Gammapy 1.x versions is now dropped. With Gammapy 2.0, we provide analysis support for most major Imaging Atmospheric Cherenkov Telescopes including H.E.S.S., VERITAS, MAGIC, LST1, Water Cherenkov Telescopes like HAWC and SWGO, as well as Fermi-LAT.

Since Gammapy 1.3, improved support is provided for Fermi-LAT analysis, and analysis of VERITAS telescope data has been validated.

Bayesian inference with nested sampling is now supported. A Sampler class that wraps around sampler libraries is introduced. It provides an interface similar to the Fit class. For now, the Sampler relies on the ultranest library. A detailed tutorial is provided.

Flux sensitivity can now be computed by the various flux estimator classes such as FluxPointsEstimator, with the "sensitivity" option. The calculation is based on the Asimov dataset following the method described in ParameterSensitivityEstimator.

There has been significant code cleanup and restructuring. They should not break user codes but might marginally change analysis results. We mention here a number of changes and undergoing re-structuring efforts:

  • The computation of flux errors is no longer performed with regular error propagation. Because the latter is a linear approximation, it frequently leads to unexpected flux ranges when extrapolating over a wide range of energies. Butterfly plots computed this way can become incorrect far from the decorrelation energy. To overcome this, error bands are now computed using multi-normal sampling of spectral parameters taking into account all correlations. The plot_error method now builds an envelope of the sampled spectra using vectorized evaluation of the model.

  • The separation of the internal DL3 data model from GADF specification is close to being over. In particular, the EventList internal table does no longer follow the GADF structure now.

  • The restructuring of statistics and Dataset has started with the addition of FitStatistic classes and a registry to allow configuration of the statistic on a dataset.

Significant effort has been put in cleaning up the documentation and re-organising the tutorial structure.

API changes#

Two API-breaking changes have been introduced in this version:

Features deprecated since Gammapy v1.3 have been removed.

Documentation improvements#

  • Documentation appearance has been updated using less custom css code, and now support a dark theme.

  • The ordering of tutorials has been restructured for clarity.

  • Four new tutorials have been added:

  • The tutorial showing how to handle Fermi-LAT data (Fermi-LAT with Gammapy) has been rewritten to expose a full Fermi-LAT analysis.

  • Code examples have been added in docstrings.

New features#

gammapy.catalog

gammapy.data

  • Helper method for observation selection at Datastore level, specially useful for WCD

gammapy.datasets

  • Add a helper function to create a global dataset from a list of datasets

gammapy.estimators

gammapy.makers

gammapy.modeling

gammapy.stats

  • Introduce optional numba optimized fit statistic functions. By default, Gammapy v2.0 still relies on Cython optimized code.

gammapy.utils

Bug fixes and improvements#

Infrastructure#

  • Remove dependency on sphinx-astropy

  • Support of astropy v7.1

  • Utilise OpenAstronomy in our release workflow to build wheels

  • Added extra workflows for

    • Scheduling run for doctests in rst and examples

    • Scheduling link check (separated from CI)

Contributors#

  • Fabio Acero

  • Arnau Aguasca-Cabot

  • Tora T H Arnesen

  • Luis Barrios-Jiménez

  • Anushka Bhatt

  • Tomas Bylund

  • Katharina Egg

  • Kirsty Feijen

  • Lucas Gréaux

  • Bruno Khélifi

  • Maximilian Linhoff

  • Edgar Molina

  • Daniel Morcuende

  • Mireia Nievas-Rosillo

  • Robert Daniel Parsons

  • Natthan Pigoux

  • Fabio Pintore

  • Tobi Preis

  • Maxime Regeard

  • Quentin Remy

  • Leander Schlegel

  • Atreyee Sinha

  • Hanna Stapel

  • Mitsunari Takahashi

  • Régis Terrier

  • Samantha Wong