2.1 (2nd April, 2026)#

  • Released: 2nd April, 2026

  • contributors: 27

  • pull requests since v2.0: 133

  • closed issues: 20

Summary#

Gammapy v2.1 is the first feature release since LTS v2.0. This release includes a number of new features, bug fixes, infrastructural changes and documentation improvements.

Notable new features include support for CosmiXs dark matter spectral models, for multiple OFF regions in the theta square plots, for simultaneous flux point extraction for a collection of sources with FluxCollectionEstimator. Extracting flux points from datasets generated from different telescope data is now allowed, but should be used with care as responses and the associated systematics might be strongly different.

A bug affecting flux maps calculations in TSMapEstimator has been corrected. It is advised to upgrade to get correct flux maps.

Prototype support for multi-parametric priors and for Bayesian model selection as been introduced. This is the first feature release where we are using town_crier for the changelog. Please see below for a list of PRs. Minor fixes are not listed.

API changes#

Infrastructure#

  • Integrate SonarQube checks for quality assurance as required by CTAO standards. [#6150]

  • Move the package configuration from setup.cfg to pyproject.toml as recommended by PEP621. [#6176]

Documentation improvements#

  • Clarify usage of from_regions regarding underlying projection effects. [#6272]

  • Remove unused obstime and location variables from FoVICRSFrame docstring example. [#6460]

New features#

  • Add an inverted option for time selection in select_time for EventList, GTI and Observation. [#5436]

  • Switch default SpectrumDataset write/read format to gadf instead of ogip (for better preservation of masks) [#5812]

  • Add a FitStatisticPenalty class to support constraints on multiple parameters e.g. regularity constraints, multiparametric priors [#5838]

  • Add BayesianModelSelection class to perform model performance comparison from a Bayesian perspective. [#6025]

  • Add a log parabola model defined such as the energy scale of the exponent and the reference energy can be different. [#6147]

  • Add axis_name argument to plot_ts_profiles to allow the user to select the axis to plot. [#6197]

  • Add support for Field of View frames that have a time axis, such as when one performs drift-scan type observations. [#6198]

  • Implementation of the option of using CosmiXs or PPPC4 as a source models for creating dark matter spectra. [#6232]

  • Add sample_parameters_from_covariance method on models allowing to create parameters samples from covariance using multivariate normal distribution. [#6255]

  • Enable the addition of Datasets and individual Dataset objects to create a new Datasets instance. [#6256]

  • Add a new FluxCollectionEstimator that enables the computation of flux points or flux samples jointly for a group of sources. [#6322]

  • Add an boolean argument allow_multiple_telescopes which allows the user to compute FluxPointsEstimator for multiple telescopes. [#6339]

  • Replace make_theta_squared_table with ThetaSquaredTable class. Overlapping regions are now forbidden. User can define multiple non-overlapping OFF regions. [#6348]

  • Add GTI to datasets created by FermipyDatasetsReader. [#6378]

  • Make LogScale clipping threshold adaptive to input dtype. This allows interpolation on float64 arrays without hard clipping at the float32 threshold (~1e-38). [#6387]

  • Add plot_samples_violin_vs_energy to create a violin plot from samples of a given quantity as a function of energy.` [#6389]

  • Replaced the slow coadd() fallback in WcsNDMap.crop and WcsNDMap.pad with direct dynamic tensor slicing, drastically improving performance for irregular non-spatial geometries. [#6428]

  • Support chained comparisons in gammapy.utils.scripts.logic_parser (e.g., 1 < x < 3). [#6467]

Bug Fixes#

  • Fix issue #5783, the to_table method now always outputs standard flux units. [#6108]

  • Adapted the size_factor default value to be consistent for all spatial models. [#6137]

  • Extra sensitivity options were added to FluxMaps. The additional options we now support are: “dnde_sensitivity”, “e2dnde_sensitivity”, “eflux_sensitivity”. [#6141]

  • Fixed gammapy.irf.EDispKernel.plot_bias so the correct axis is now being called for the xaxis.units. [#6159]

  • Fixed the incorrect brackets in the error calculation for compute_flux_doubling. [#6164]

  • Corrected TemplatePhaseCurveTemporalModel integration by performing global normalisation by the duration of the integration window as done in the other temporal models. [#6182]

  • Replaced the deprecated keyword RADECSYS for the coordinate system in the GADF event list fits table with RADESYSa. [#6189]

  • Ignore observations without spatial overlap with the target dataset geometry in DatasetsMaker instead of raising an error. [#6194]

  • Corrected SkyModel _check_unit unit requirement for models where exposure is not applied. [#6227]

  • Modify default interpolation conditions in TemplateSpatialModel to allow using Hpx geometry maps. [#6248]

  • Fixed plot_error for BrokenPowerLawSpectralModel and TemplateNDSpectralModel [#6251]

  • Fix plot_error for models evaluated with non-finite values. [#6252]

  • Fix the addition logic so that gammapy.modeling.models.Models and gammapy.modeling.models.DatasetModels can be added together regardless of the order they are given. [#6253]

  • Fix map stacking if data type is not float. [#6254]

  • Adapted SpectrumDataset.create() to avoid creating PSFMap during dataset creation. Moved creation of SpectrumDataset.create() into the SpectrumDataset class. Added check for RegionGeom of given geometry. [#6259]

  • Add an optional normalize argument on TemplatePhaseCurveTemporalModel. It is set by default to True, for backward compatibility with 2.0. [#6270]

  • Fixed kinematics in gammapy.astro.darkmatter.DarkMatterDecaySpectralModel. The model now correctly uses mass/2 for the primary flux lookup. [#6298]

  • Correct issue #6304. Include CITATION file in the gammapy directory. Modify the _get_bibtex and _get_acknowledgement functions accordingly. [#6308]

  • Add default Parameter values on init in gammapy.astro models. This solves docs build issues which appeared recently. [#6333]

  • Correct bug with command-line-interface (gammapy analysis run) that forces background maker method to be reflected regions. [#6367]

  • Fix an off-by-one error in pix_to_idx by clipping indices to npix - 1. [#6383]

  • Fix hpx.geom.pix_to_idx to correctly handle non-spatial pixel coordinates, ensuring consistency with WCS. [#6388]

  • requests and tqdm are now included as core dependencies so that gammapy download datasets works out of the box without requiring users to install extra packages manually. [#6400]

  • Parameter bounds are now synchronized dynamically with UniformPrior and LogUniformPrior bounds to prevent Minuit from hitting infinite likelihood. [#6409]

  • Fix gammapy.datasets.utils.set_and_restore_mask_fit such as it does not ignore the existing dataset.mask_fit by default. [#6416]

  • Improve parsing of config file in FermipyDatasetsReader.read() and raise more explicit errors for invalid cases. [#6421]

  • Fix a RuntimeWarning due to division by zero in plot_offset_dependence when the maximum effective area is zero. [#6450]

  • Fix flux estimates in gammapy.estimators.TSMapEstimator (now the kernel is properly normalized in each energy bin rather than over the total energy range). [#6466]

  • Fix select_time in EventList, GTI and Observation to always utilise start time (inclusive) and stop time (exclusive). [#6497]

  • Fix unit handling in RegionNDMap.plot_mask [#6520]

  • Propagated the overwrite argument in the write method of TemplateNDSpectralModel. [#6525]

  • Introduce default threshold value to remove numerical artifacts created when applying to_edisp_kernel(). [#6547]

Contributors#

  • Fabio Acero

  • Kush Agarwal

  • Arnau Aguasca-Cabot

  • Tora T. H. Arnesen

  • Ebraam Ashraf

  • Y.Emre Bahar

  • Tomas Bylund

  • Marie-Sophie Carrasco

  • Alexander Cerviño Cortínez

  • Pratham Chaudary

  • Yaocheng Chen

  • Anshita Dubey

  • Katharina Egg

  • Kirsty Feijen

  • Lea Heckmann

  • Basmala Hekal

  • Bruno Khélifi

  • Daniel Morcuende

  • Mireia Nievas-Rosillo

  • Pierre Pichard

  • Natthan Pigoux

  • Fabio Pintore

  • Maxime Regeard

  • Quentin Remy

  • Leander Schlegel

  • Atreyee Sinha

  • Régis Terrier