Skip to content

Commit ebef3c4

Browse files
author
Claudio Galelli
authored
Merge branch 'gammapy:main' into fitresults
2 parents e868dd8 + 2510115 commit ebef3c4

File tree

103 files changed

+1276
-752
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+1276
-752
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ gammapy/gammapy.cfg
8585
docs/_generated
8686
docs/gen_modules
8787
docs/api
88+
docs/sg_execution_times.rst
8889
.coverage
8990

9091
dev/crab

README.rst

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,43 @@
11
.. image:: https://anaconda.org/conda-forge/gammapy/badges/license.svg
2-
:target: https://github.com/gammapy/gammapy/blob/master/LICENSE.rst
3-
:alt: Licence
2+
:target: https://github.com/gammapy/gammapy/blob/master/LICENSE.rst
3+
:alt: Licence
44

55
.. image:: http://img.shields.io/badge/powered%20by-AstroPy-orange.svg?style=flat
6-
:target: http://www.astropy.org/
7-
6+
:target: http://www.astropy.org/
7+
|
88
.. image:: https://anaconda.org/conda-forge/gammapy/badges/platforms.svg
9-
:target: https://anaconda.org/conda-forge/gammapy
10-
9+
:target: https://anaconda.org/conda-forge/gammapy
10+
|
1111
.. image:: http://img.shields.io/pypi/v/gammapy.svg?text=version
12-
:target: https://pypi.org/project/gammapy/
13-
:alt: Latest release
12+
:target: https://pypi.org/project/gammapy/
13+
:alt: Latest release
1414

1515
.. image:: https://img.shields.io/pypi/dm/gammapy?label=downloads%20%7C%20pip&logo=PyPI
1616
:alt: PyPI - Downloads
1717

1818
.. image:: https://anaconda.org/conda-forge/gammapy/badges/version.svg
19-
:target: https://anaconda.org/conda-forge/gammapy
19+
:target: https://anaconda.org/conda-forge/gammapy
2020

2121
.. image:: https://img.shields.io/conda/dn/conda-forge/gammapy?label=downloads%20%7C%20conda&logo=Conda-Forge
22-
:target: https://anaconda.org/conda-forge/gammapy
22+
:target: https://anaconda.org/conda-forge/gammapy
2323

2424
.. image:: https://img.shields.io/badge/launch-binder-579aca.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFkAAABZCAMAAABi1XidAAAB8lBMVEX///9XmsrmZYH1olJXmsr1olJXmsrmZYH1olJXmsr1olJXmsrmZYH1olL1olJXmsr1olJXmsrmZYH1olL1olJXmsrmZYH1olJXmsr1olL1olJXmsrmZYH1olL1olJXmsrmZYH1olL1olL0nFf1olJXmsrmZYH1olJXmsq8dZb1olJXmsrmZYH1olJXmspXmspXmsr1olL1olJXmsrmZYH1olJXmsr1olL1olJXmsrmZYH1olL1olLeaIVXmsrmZYH1olL1olL1olJXmsrmZYH1olLna31Xmsr1olJXmsr1olJXmsrmZYH1olLqoVr1olJXmsr1olJXmsrmZYH1olL1olKkfaPobXvviGabgadXmsqThKuofKHmZ4Dobnr1olJXmsr1olJXmspXmsr1olJXmsrfZ4TuhWn1olL1olJXmsqBi7X1olJXmspZmslbmMhbmsdemsVfl8ZgmsNim8Jpk8F0m7R4m7F5nLB6jbh7jbiDirOEibOGnKaMhq+PnaCVg6qWg6qegKaff6WhnpKofKGtnomxeZy3noG6dZi+n3vCcpPDcpPGn3bLb4/Mb47UbIrVa4rYoGjdaIbeaIXhoWHmZYHobXvpcHjqdHXreHLroVrsfG/uhGnuh2bwj2Hxk17yl1vzmljzm1j0nlX1olL3AJXWAAAAbXRSTlMAEBAQHx8gICAuLjAwMDw9PUBAQEpQUFBXV1hgYGBkcHBwcXl8gICAgoiIkJCQlJicnJ2goKCmqK+wsLC4usDAwMjP0NDQ1NbW3Nzg4ODi5+3v8PDw8/T09PX29vb39/f5+fr7+/z8/Pz9/v7+zczCxgAABC5JREFUeAHN1ul3k0UUBvCb1CTVpmpaitAGSLSpSuKCLWpbTKNJFGlcSMAFF63iUmRccNG6gLbuxkXU66JAUef/9LSpmXnyLr3T5AO/rzl5zj137p136BISy44fKJXuGN/d19PUfYeO67Znqtf2KH33Id1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IUfFLqvgUN4C0qNqYs5YhPL+aVZYDE4IpUk57oSFnJm4FyCqqOE0jhY2SMyLFoo56zyo6becOS5UVDdj7Vih0zp+tcMhwRpBeLyqtIjlJKAIZSbI8SGSF3k0pA3mR5tHuwPFoa7N7reoq2bqCsAk1HqCu5uvI1n6JuRXI+S1Mco54YmYTwcn6Aeic+kssXi8XpXC4V3t7/ADuTNKaQJdScAAAAAElFTkSuQmCC
2525
:target: mybinder.org
26-
26+
|
2727
.. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.4701488.svg?style=flat
28-
:target: https://doi.org/10.5281/zenodo.4701488
28+
:target: https://doi.org/10.5281/zenodo.4701488
2929

3030
.. image:: https://archive.softwareheritage.org/badge/origin/https://github.com/gammapy/gammapy/
31-
:target: https://archive.softwareheritage.org/browse/origin/?origin_url=https://github.com/gammapy/gammapy
31+
:target: https://archive.softwareheritage.org/browse/origin/?origin_url=https://github.com/gammapy/gammapy
3232

33+
.. image:: https://archive.softwareheritage.org/badge/swh:1:snp:11e81660a96c3252c4afa4d48b58d1d2f78ea80a/
34+
:target: https://archive.softwareheritage.org/swh:1:snp:11e81660a96c3252c4afa4d48b58d1d2f78ea80a;origin=https://github.com/gammapy/gammapy
35+
|
3336
.. image:: https://img.shields.io/badge/A&A-Published-Green.svg
34-
:target: https://doi.org/10.1051/0004-6361/202346488
37+
:target: https://doi.org/10.1051/0004-6361/202346488
38+
|
39+
.. image:: https://img.shields.io/badge/Matomo-3152A0?style=for-the-badge&logo=Matomo&logoColor=white
40+
:target: https://matomo.org/
3541

3642
Gammapy
3743
=======

codemeta.json

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,18 +253,31 @@
253253
}
254254
],
255255
"codeRepository": "https://github.com/gammapy/gammapy",
256-
"datePublished": "2024-02-29",
256+
"dateCreated": "2013-08-19",
257+
"datePublished": "2014-08-25",
258+
"dateModified": "2024-02-29",
257259
"description": "Gammapy analyzes gamma-ray data and creates sky images, spectra and lightcurves, from event lists and instrument response information; it can also determine the position, morphology and spectra of gamma-ray sources. It is used to analyze data from H.E.S.S., Fermi-LAT, HAWC, and the Cherenkov Telescope Array (CTA).",
258260
"identifier": "https://doi.org/10.5281/zenodo.4701488",
259261
"keywords": [
260262
"Astronomy",
261263
"Gamma-rays",
262-
"Data analysis"
264+
"Data analysis",
265+
"Scientific/Engineering"
263266
],
264267
"license": "https://spdx.org/licenses/BSD-3-Clause",
265268
"name": "Gammapy: Python toolbox for gamma-ray astronomy",
266269
"url": "https://gammapy.org/",
267270
"softwareVersion": "v1.2",
271+
"applicationCategory": "Astronomy",
272+
"applicationSubCategory": "Very-high-energy gamma rays",
273+
"programmingLanguage": "Python 3",
274+
"operatingSystem": "Linux, Mac OS, Windows",
275+
"referencePublication": "https://doi.org/10.1051/0004-6361/202346488",
276+
"audience": {
277+
"@id": "/audience/science-research",
278+
"@type": "Audience",
279+
"audienceType": "Science/Research"
280+
},
268281
"maintainer": {
269282
"@id": "https://orcid.org/0000-0003-4568-7005",
270283
"@type": "Person",

dev/codemeta.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import logging
55
from configparser import ConfigParser
66
import click
7+
from datetime import date
78

89
log = logging.getLogger(__name__)
910

@@ -24,6 +25,10 @@ def update_codemeta(maintainer, filename, setup_file=None):
2425
data["developmentStatus"] = ("active",)
2526
data["email"] = "[email protected]"
2627

28+
modified_date = str(date.today())
29+
data["dateModified"] = modified_date
30+
31+
2732
if setup_file:
2833
# complete with software requirements from setup.cfg
2934
cf = ConfigParser()

dev/github_summary.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ def list_merged_PRs(filename, milestones, from_backports):
198198
table = Table.read(filename)
199199

200200
# Keep only merged PRs
201-
table = table[table["is_merged"] is True]
201+
table = table[table["is_merged"] == True]
202202

203203
# Keep the requested milestones
204204
valid = np.zeros((len(table)), dtype="bool")

docs/_static/custom.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ p {
8888
color: white;
8989
}
9090

91-
#navbar-icon-links i.fa-twitter-square::before {
91+
#navbar-icon-links i.fa-square-x-twitter::before {
9292
color: white;
9393
}
9494

docs/_static/matomo.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Licensed under a 3-clause BSD style license - see LICENSE.rst
2+
3+
// Matomo Tracking Code
4+
var _paq = window._paq = window._paq || [];
5+
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
6+
_paq.push(['trackPageView']);
7+
_paq.push(['enableLinkTracking']);
8+
(function() {
9+
var u="https://apcstatview.in2p3.fr/";
10+
_paq.push(['setTrackerUrl', u+'matomo.php']);
11+
_paq.push(['setSiteId', '3']);
12+
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
13+
g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
14+
})();
15+

docs/conf.py

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
# be accessible, and the documentation will not build correctly.
2727

2828
import datetime
29+
import sys
30+
import os
2931

3032
# Get configuration information from setup.cfg
3133
from configparser import ConfigParser
@@ -35,7 +37,7 @@
3537
from sphinx_astropy.conf import *
3638

3739
# Sphinx-gallery config
38-
from sphinx_gallery.sorting import ExplicitOrder, FileNameSortKey
40+
from sphinx_gallery.sorting import ExplicitOrder
3941

4042
# Load utils docs functions
4143
from gammapy.utils.docs import SubstitutionCodeBlock, gammapy_sphinx_ext_activate
@@ -56,6 +58,8 @@ def setup(app):
5658
conf.read([os.path.join(os.path.dirname(__file__), "..", "setup.cfg")])
5759
setup_cfg = dict(conf.items("metadata"))
5860

61+
sys.path.insert(0, os.path.dirname(__file__))
62+
5963
linkcheck_anchors_ignore = []
6064
linkcheck_ignore = [
6165
"http://gamma-sky.net/#",
@@ -70,6 +74,8 @@ def setup(app):
7074
"https://www.hawc-observatory.org/", # invalid certificate
7175
"https://ipython.org", # invalid certificate
7276
"https://jupyter.org", # invalid certificate
77+
"https://hess-confluence.desy.de/confluence/display/HESS/HESS+FITS+data", # private page
78+
"https://hess-confluence.desy.de/"
7379
]
7480

7581
# the buttons link to html pages which are auto-generated...
@@ -111,7 +117,6 @@ def setup(app):
111117
# List of patterns, relative to source directory, that match files and
112118
# directories to ignore when looking for source files.
113119
exclude_patterns.append("_templates")
114-
exclude_patterns.append("_static")
115120
exclude_patterns.append("**.ipynb_checkpoints")
116121
exclude_patterns.append("user-guide/model-gallery/*/*.ipynb")
117122
exclude_patterns.append("user-guide/model-gallery/*/*.md5")
@@ -220,7 +225,7 @@ def setup(app):
220225
{
221226
"name": "Twitter",
222227
"url": "https://twitter.com/gammapyST",
223-
"icon": "fab fa-twitter-square",
228+
"icon": "fab fa-square-x-twitter",
224229
},
225230
{
226231
"name": "Slack",
@@ -234,6 +239,10 @@ def setup(app):
234239
},
235240
"navbar_end": ["version-switcher", "theme-switcher", "navbar-icon-links"],
236241
"navigation_with_keys": True,
242+
# footers
243+
"footer_start": ["copyright"],
244+
"footer_center": ["last-updated"],
245+
"footer_end": ["sphinx-version", "theme-version"]
237246
}
238247

239248

@@ -314,7 +323,7 @@ def setup(app):
314323
"exclude_implicit_doc": {},
315324
"filename_pattern": r"\.py",
316325
"reset_modules": ("matplotlib",),
317-
"within_subsection_order": FileNameSortKey,
326+
"within_subsection_order": "sphinxext.TutorialExplicitOrder",
318327
"download_all_examples": True,
319328
"capture_repr": ("_repr_html_", "__repr__"),
320329
"nested_sections": False,
@@ -328,11 +337,12 @@ def setup(app):
328337
}
329338

330339
html_static_path = ["_static"]
331-
332-
html_css_files = [
333-
"custom.css",
334-
]
340+
html_css_files = ["custom.css"]
341+
html_js_files = ["matomo.js"]
335342

336343
html_context = {
337344
"default_mode": "light",
338345
}
346+
347+
# Add-on to insert the Matomo tracker
348+
templates_path = ['_templates']

docs/development/dev_howto.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,12 @@ Notes:
7070
Gammapy names defined here, to the names used in the formats.
7171
Of course, where formats are not set in stone yet, we advocate and encourage
7272
the use of the names chosen here.
73-
* Finally, we realise that eventually probably CTA will define this, and Gammapy
74-
is only a prototype. So if CTA chooses something else, probably we will follow
75-
suite and do one more backward-incompatible change at some point to align with CTA.
73+
* Finally, CTAO has proposed a full data model associated to the needed quantities. And
74+
the community is working to create a data format for very-high-energy data produced by gamma-ray
75+
and neutrino experiments within the open initiative `Very-high-energy Open Data Format`_. This format
76+
aims to respect the CTAO data model, to respect the `FAIR principles`_ and to follow as much as
77+
possible the `IVOA`_ recommendations. In order to handle past, current and old formats,
78+
Gammapy should follow the `FAIR4RS principles`_ by proposing a user-friendly interface.
7679

7780
Clobber or overwrite?
7881
+++++++++++++++++++++

docs/development/doc_howto.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ following command.
144144
145145
pytest --doctest-modules --ignore-glob=*/tests gammapy
146146
147-
If you get a zsh error try using putting to ignore block inside quotes
147+
If you get a zsh error try using putting to ignore block inside quotes
148148

149149
.. code-block:: bash
150150
@@ -157,6 +157,7 @@ The documentation built-in process uses the `sphinx-gallery <https://sphinx-gall
157157
extension to build galleries of illustrated examples on how to use Gammapy (i.e.
158158
:ref:`model-gallery`). The Python scripts used to produce the model gallery are placed in
159159
``examples/models`` and ``examples/tutorials``. The configuration of the ``sphinx-gallery`` module is done in ``docs/conf.py``.
160+
The tutorials are order using a python dictionary stored in ``docs/sphinxext.py``.
160161

161162

162163
Choose a thumbnail and tooltip for the tutorial gallery
@@ -179,9 +180,9 @@ choose the thumbnail for the tutorial by adding a comment before the plot:
179180
plt.show()
180181
181182
The example is taken from the `sphinx-gallery documentation <https://sphinx-gallery.github.io/stable/auto_examples/plot_4_choose_thumbnail.html>`__,
182-
please refer to it for more details.
183+
please refer to it for more details.
183184

184-
The tooltip is the text that appears when you hover over the thumbnail. It is taken from the first line
185+
The tooltip is the text that appears when you hover over the thumbnail. It is taken from the first line
185186
of the docstring of the tutorial. You can change it by editing the docstring. See e.g.
186187
`Analysis 1 Tutorial <https://github.com/gammapy/gammapy/blob/main/examples/tutorials/starting/analysis_1.py#L5>`__.
187188

@@ -194,7 +195,7 @@ Links in tutorials are just handled via normal RST syntax.
194195
Links to other tutorials
195196
++++++++++++++++++++++++
196197

197-
From docstrings and RST documentation files in Gammapy you can link to other tutorials
198+
From docstrings and RST documentation files in Gammapy you can link to other tutorials
198199
and gallery examples by using RST syntax like this:
199200

200201
.. code-block:: rst
@@ -217,7 +218,7 @@ To make a reference to a heading within an RST file, first you need to define an
217218
==============
218219
219220
220-
The reference is the rendered as ``datasets``.
221+
The reference is the rendered as ``datasets``.
221222
To link to this in the documentation you can use:
222223

223224
.. code-block:: rst

0 commit comments

Comments
 (0)