.. include:: ../references.txt .. _gammapy_2p2_release: 2.2 (xx November, 2026) ====================== - Released: xx November, 2026 - New contributors: 7 (Marked with * in the list) - Total contributors: 30 - Total merged PRs: 192 Summary ------- Gammapy v2.2 is a new feature release with a number of performance improvements, new features and bug fixes. The main themes include new tools for Bayesian inference, a broad overhaul of the dark matter module, and ASDF serialization of the core data structures. Python 3.14 and 3.15 are now supported, and issues encountered with `~regions` in the previous versions are now resolved. Three new notebooks have been added and the CTAO notebook significantly updated. Dark matter module ~~~~~~~~~~~~~~~~~~ The dark matter module has been substantially refactored and extended in this release. The spectral model classes have been unified into a single class handling both annihilation and decay, with improved parameter validation and an overall cleaner code structure. ``CosmiXs`` is now the default source for dark matter spectra, replacing ``PPPC4DMID``; note that this changes the results of analyses that relied on the previous default. Users can also provide their own custom spectra from a file. The computation of astrophysical factors has been improved, with corrections for extragalactic sources, the line-of-sight geometry and the treatment of the central pixel. Notably, uncertainties on the astrophysical factor can now be included as a nuisance parameter profiled in the likelihood fit, so that limits on the annihilation cross-section or decay lifetime account for the uncertainty on the target's dark matter distribution, yielding more realistic and typically more conservative constraints. The documentation and tutorials have been updated accordingly, with new and improved tutorials covering both a basic introduction and a complete analysis. ASDF serialization ~~~~~~~~~~~~~~~~~~~ Maps, geometries (WCS, HEALPix, region), map axes, GTIs, IRF maps, Datasets and Models can now be written to and read from ASDF. This is the groundwork for storing a complete analysis state in a single, self-describing file, and is a part of an overhaul of the I/O code in Gammapy. An associated entry in the :ref:`HowTo ` is added as an explanation for ASDF serialisation. Estimators and flux upper limits ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Significant additions have been made to our estimator package. Previously, hidden failures sometimes used to occur at low statistics, causing very low upper limits. This has now been corrected. If a failure is detected during the fit for upper limit computation, the method internally switches to upper limit computation using likelihood profiles. The upper limit tutorial has been updated with more information. A preliminary implementation of a new `~gammapy.estimators.RegularizedFluxPointsEstimator` is introduced for flux point computation in true-energy space with a given regularisation, and will be documented in future releases. Other ~~~~~ The 4FGL catalog is updated, with support for the FL16Y list. A new `~gammapy.makers.OnOffBackgroundMaker` with an associated tutorial is provided for background estimation with paired off runs. The `nautilus `_ is now available as a `~gammapy.modeling.Sampler` backend, which is better suited for higher dimensionality problems, and `~gammapy.modeling.models.LogNormalPrior` and `~gammapy.modeling.models.SamplesKDEPrior` are introduced. A new tutorial is added explaining the details of Bayesian model selection. API changes ----------- - The constructor of `~gammapy.data.ObservationTable` now takes an argument ``table`` instead of ``data``. [`#6620 `_] - Deprecated `~gammapy.utils.make_map_exposure_true_energy`, use the ``make_exposure`` method on `~gammapy.makers.MapDatasetMaker` instead. [`#6882 `_] - Deprecate `gammapy.makers.utils.make_psf_map`. [`#6893 `_] - The options of `~gammapy.modeling.Sampler` are now given in a single ``options`` dictionary, using the backend's own option names. [`#6898 `_] - Deprecate `gammapy.makers.utils.make_edisp_map` and `gammapy.makers.utils.make_edisp_kernel_map`. [`#6906 `_] - Deprecate `gammapy.makers.utils.make_map_background_irf`. [`#6946 `_] Infrastructure -------------- - Add support for Python 3.14. Update tox and CI configurations accordingly. [`#6225 `_] - Fix the ``gammapy-dev`` conda environment for compiling ``sherpa`` from source and adding all documentation dependencies. [`#6930 `_] Documentation improvements -------------------------- - Add PIG for introducing new plotter classes [`#5726 `_] - Improves the documentation in the user guide on fit statistics. [`#6623 `_] - Fix issue in Fermi-LAT tutorial where dimmest sources are used for fitting rather than brightest. [`#6750 `_] - Add a new tutoial showing detailed Dark Matter analysis [`#6774 `_] - Update of the Dark Matter module main documentation. [`#6777 `_] - Add tutorial for on-off analysis using paired off runs. [`#6835 `_] - Add How-To entry to document ASDF [`#6981 `_] - Update the Upper Limit tutorial. [`#6997 `_] - Add a tutorial about Bayesian model selection using arviz package. [`#7018 `_] New features ------------ - Add `~gammapy.utils.regions.CirclePixelRegionArray` and `~gammapy.utils.regions.CircleSkyRegionArray` classes to support array valued regions. [`#5420 `_] - Add `~gammapy.estimators.RegularizedFluxPointsEstimator` to perform estimate of flux points in true energy space using a regularized likelihood approach. [`#5625 `_] - Add `~gammapy.visualization.plot_pulse_profile_3PC` function to plot pulse profiles from the Fermi-LAT 3PC catalog. [`#5761 `_] - Add utility function to creates a 2D grid of `~regions.RectangleSkyRegion` tiles on a given WCS. [`#6006 `_] - Add `~gammapy.modeling.models.SamplesKDEPrior` class to create a prior from samples using `scipy.stats.gaussian_kde`. [`#6503 `_] - Add nautilus-sampler as a possible `~gammapy.modeling.Sampler` backend. [`#6596 `_] - Update Fermi-LAT 4FGL catalog and add support for FL16Y list in `~gammapy.catalog.SourceCatalog4FGL`. [`#6617 `_] - Add support for creating a `~gammapy.data.DataStore` from the results of a ivoa TapQuery. [`#6653 `_] - Implementation of the option of using custom files as dark matter spectra sources. [`#6660 `_] - Add ASDF serialization support for `~gammapy.maps.MapAxis`. [`#6706 `_] - Add ASDF serialization support for `~gammapy.maps.TimeMapAxis` and `~gammapy.maps.LabelMapAxis` . [`#6722 `_] - Add ASDF serialization support for `~gammapy.maps.MapAxes`. [`#6735 `_] - Add `~gammapy.datasets.MapDataset.downsample` functionality for the ``energy_true`` axis, fix `~gammapy.data.IRFMap.downsample` behaviour, and restrict the axes for downsampling. [`#6740 `_] - Added `~gammapy.astro.darkmatter.utils.add_factor_prior` helper function to support log-normal nuisance parameter treatment for astrophysical J-factors and D-factors. [`#6741 `_] - Fixed JFactory to correctly compute J/D-factors for extragalactic sources by decoupling rmax from distance and propagating the source distance through the line-of-sight integration geometry. [`#6743 `_] - Implementation of parameter validation and code restructuring for Dark Matter spectral models. [`#6744 `_] - Add ASDF serialization support for `~gammapy.maps.WcsGeom`. [`#6751 `_] - Add ASDF serialization support for `~gammapy.maps.HpxGeom`. [`#6761 `_] - Add ASDF serialization support for `~gammapy.maps.RegionGeom`. [`#6771 `_] - Add a dark matter analysis tutorial covering the basics of J/D-factor computation, spectral models, and expected gamma-ray flux. [`#6782 `_] - Add ASDF serialization support for `~gammapy.maps.WcsNDMap`. [`#6790 `_] - Add ASDF serialization support for `~gammapy.maps.HpxNDMap`. [`#6791 `_] - Add ASDF serialization support for `~gammapy.maps.RegionNDMap`. [`#6794 `_] - Addition of `~gammapy.modeling.models.LogNormalPrior` class. [`#6799 `_] - Ensure `~gammapy.maps.axes.TimeMapAxis` start and stop values are exported to table in isot format. [`#6805 `_] - Deprecate `~gammapy.datasets.Dataset.stat_sum` and make `~gammapy.datasets.Dataset.stat_sum_likelihood` and `~gammapy.datasets.Datasets.stat_sum_likelihood` public. [`#6812 `_] - Add `~gammapy.makers.OnOffBackgroundMaker` for on-off analysis. [`#6824 `_] - Creation of class `~gammapy.astro.darkmatter.DarkMatterSpectralModel` as the unification of `~gammapy.astro.darkmatter.DarkMatterAnnihilationSpectralModel` and `~gammapy.astro.darkmatter.DarkMatterDecaySpectralModel`. The new class has a parameter `annihilation` to set the type of dark matter process. [`#6825 `_] - Add ASDF serialization support for `~gammapy.maps.Maps`. [`#6830 `_] - Add ASDF serialization support for `~gammapy.data.GTI`. [`#6831 `_] - Add ASDF serialization support for `~gammapy.irf.PSFMap`, `~gammapy.irf.RecoPSFMap`, `~gammapy.irf.EDispMap`, `~gammapy.irf.EDispKernelMap`. [`#6833 `_] - Add Fourth Fermi-LAT Catalog of High-Energy Sources (4FHL). Older 2FHL catalog has been deprecated as of next release (v2.2). [`#6838 `_] - Add `~gammapy.visualization.plotters.BasePlotter` class, first building plot for the new Plotters API defined in PIG 31. [`#6845 `_] - Add ASDF serialization support for `~gammapy.datasets.MapDataset` and `~gammapy.datasets.MapDatasetOnOff`. [`#6849 `_] - Add ASDF serialization support for `~gammapy.modeling.models.Models`. [`#6850 `_] - Adapt the default spectra source in `~gammapy.astro.darkmatter.DarkMatterSpectralModel` and `~gammapy.astro.darkmatter.ContinuumPrimaryFlux` from PPPC4DMID to CosmiXs. [`#6885 `_] - Add Eemin, Eemax (for leptonic models) or Epmin, Epmax (for hadronic models) as fit parameters in the `~gammapy.modeling.models.NaimaSpectralModel`. [`#6889 `_] - Remove the limit of 5 non-spatial axes when reading a `~gammapy.maps.RegionNDMap` with gadf format. [`#6949 `_] Bug Fixes --------- - Correct `~gammapy.datasets.FluxPointsDataset.plot_residuals()` x-axis unit, remove ``ax_spectrum`` and ``ax_residuals`` parameter in `~gammapy.datasets.FluxPointsDataset.plot_fit()` and adjust documentation. [`#6615 `_] - `~gammapy.datasets.MapDataset.stack(other)` now skips stacking if other ``mask_safe`` is invalid. This prevents stacking gti of invalid dataset. [`#6621 `_] - Fixes `~gammapy.modeling.models.integrate_spectrum` to allow integration of spectral models without a closed analytical form (e.g. `~gammapy.modeling.models.BrokenPowerLawSpectralModel`) with energy bounds given as arrays of length 1. [`#6622 `_] - Fixes bug to return ``ax`` object for ``TemplateSpatialModel.plot()``. [`#6636 `_] - Fixes a bug in the `~gammapy.estimators.EnergyDependentMorphologyEstimator` to allow for multiple datasets to be handled correctly. [`#6640 `_] - Corrects `~gammapy.makers.utils.make_effective_livetime_map` to use observation pointing to compute livetime map. [`#6643 `_] - Fixes `~gammapy.irf.EffectiveAreaTable2D.plot_offset_dependence()` to remove area being divided twice. [`#6666 `_] - Fix default behavior of ``sum_over_energy_groups=False`` case in `gammapy.estimators.ExcessMapEstimator`. [`#6685 `_] - Remove dependency to regions deprecated function pixel_scale_angle_at_skycoord in `~gammapy.utils.regions.SkyPolygonRegion`. [`#6705 `_] - Add configuration of interpolation options for `~gammapy.modeling.models.LightCurveTemplateTemporalModel`, now default is to return zero when evaluating outside the times in the template. [`#6712 `_] - Fixes incorrect calling of dataset for frozen models in `~gammapy.estimators.FluxCollectionEstimator`. [`#6721 `_] - Add unit support to the violins plot from `~gammapy.visualization.plot_samples_violin_vs_energy` used with the `~gammapy.estimators.FluxCollectionEstimator` [`#6756 `_] - Fixes `~gammapy.astro.darkmatter.JFactory.compute_differential_jfactor` to use the physical impact parameter in the line-of-sight integration and avoid evaluating the integrable closest-approach singularity directly. [`#6757 `_] - Fix Asimov dataset computation for `~gammapy.datasets.MapDatasetOnOff`: use alpha * N_OFF as expected background. [`#6762 `_] - Fix the `~gammapy.estimators.FluxCollectionEstimator` to support computation over datasets with different spatial geometries, and single flux point. [`#6785 `_] - Fix `~gammapy.maps.RegionGeom` ASDF roundtrip for DS9-formatted regions to clear ``meta`` and ``visual`` on write. [`#6801 `_] - Fix parsing of the `scale` parameter when read from a dictionary in `~gammapy.modeling.models.TemplatePhaseCurveTemporalModel`. [`#6807 `_] - Fix broadcasting in `~gammapy.modeling.models.TemplatePhaseCurveTemporalModel.integral` [`#6813 `_] - Fixes the line-of-sight integration geometry in `~gammapy.astro.darkmatter.JFactory` to account for observers inside or outside the radial integration region. [`#6819 `_] - Fixes `~gammapy.astro.darkmatter.JFactory` when a map pixel center coincides exactly with the dark-matter halo center. [`#6828 `_] - `~gammapy.maps.MapAxis.format_plot_xaxis` no longer produces overlapping scientific-notation minor tick labels on a log x-axis spanning less than one decade. [`#6847 `_] - Makes sure FoV offsets in ``_get_fov_coord`` are calculated in the correct coordinate frame. [`#6861 `_] - Fix `nan` in sensitivity computation using Asimov dataset. [`#6862 `_] - Add `gammapy.stats.utils.ts_to_sigma_sensitivity` and `gammapy.stats.utils.sigma_to_ts_sensitivity` as separate functions and fix computation with more than one degree of freedom [`#6864 `_] - Fixes an out-of-memory error when computing the covariance of models with a large number of parameters (e.g. a full source catalogue) by building diagonal covariances lazily in `~gammapy.modeling.covariance.Covariance`. [`#6867 `_] - Fixes `~gammapy.modeling.models.LogParabola2SpectralModel.e_peak` value for the case where the energy scale E_s is different from the reference energy E_0. [`#6884 `_] - Fixes `~gammapy.irf.PSF3D.containment` when rad is larger than the last bin of the PSF rad axis. [`#6887 `_] - Recompute upper limits using likelihood profiles if the default method using fit confidence fails in `~gammapy.estimators.ParameterEstimator`. [`#6900 `_] - Fixes error in getting the ``pivot_energy`` for a `~gammapy.modeling.models.CompoundSpectralModel` or model which does not contain a ``reference``. [`#6916 `_] - Fix error in `gammapy.data.ivoa.make_hdu_table`. [`#6920 `_] - Fix ``to_dict()`` of `~gammapy.modeling.models.TemplateSpectralModel`, `~gammapy.modeling.models.PiecewiseNormSpectralModel`, `~gammapy.modeling.models.EBLAbsorptionNormSpectralModel` and `~gammapy.modeling.models.PiecewiseNormSpatialModel` failing on big-endian arrays. [`#6952 `_] - Fix the normalisation of `~gammapy.stats.compute_fpp` to match Edelson et al. (2002), also when the light curve has NaN values. [`#7014 `_] Contributors ------------ - Fabio Acero - Nicki R. Bond * - Tomas Bylund - Marie-Sophie Carrasco - R. Alexander Cerviño-Cortínez - Axel Donath - Katharina Egg - Gabriel Emery - Kirsty Feijen - Júlia Gouvêa Mamprim * - Karthik Koundinya Gowrawaram * - Lea Heckmann - Basmala Hekal - Bruno Khélifi - Ahmed Mahmoud * - Esther Michelle * - Daniel Morcuende - Laura Olivera-Nieto - Michele Peresano - Natthan Pigoux - Fabio Pintore - Tobias Preis - Syed Ahnaf Raza * - Maxime Regeard - Quentin Remy - Atreyee Sinha - Régis Terrier - Tim Unbehaun - Thomas Vuillaume - Ziheng Wang *