gammapy-plugin 0.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- gammapy_plugin-0.0.1/.gitattributes +1 -0
- gammapy_plugin-0.0.1/.github/ISSUE_TEMPLATE/bug_report.md +39 -0
- gammapy_plugin-0.0.1/.github/ISSUE_TEMPLATE/feature_request.md +21 -0
- gammapy_plugin-0.0.1/.github/ISSUE_TEMPLATE.md +17 -0
- gammapy_plugin-0.0.1/.github/dependabot.yml +11 -0
- gammapy_plugin-0.0.1/.github/workflows/build_test_pip.yml +193 -0
- gammapy_plugin-0.0.1/.github/workflows/docs.yml +121 -0
- gammapy_plugin-0.0.1/.gitignore +110 -0
- gammapy_plugin-0.0.1/.pre-commit-config.yaml +12 -0
- gammapy_plugin-0.0.1/.readthedocs.yaml +28 -0
- gammapy_plugin-0.0.1/LICENSE +674 -0
- gammapy_plugin-0.0.1/MANIFEST.in +3 -0
- gammapy_plugin-0.0.1/PKG-INFO +122 -0
- gammapy_plugin-0.0.1/README.md +88 -0
- gammapy_plugin-0.0.1/ci/environment.yml +15 -0
- gammapy_plugin-0.0.1/codecov.yml +24 -0
- gammapy_plugin-0.0.1/docs/Makefile +26 -0
- gammapy_plugin-0.0.1/docs/_static/banner-dark.svg +43 -0
- gammapy_plugin-0.0.1/docs/_static/banner-light.svg +43 -0
- gammapy_plugin-0.0.1/docs/_static/css/override.css +9 -0
- gammapy_plugin-0.0.1/docs/_static/logo.svg +35 -0
- gammapy_plugin-0.0.1/docs/api/API.rst +11 -0
- gammapy_plugin-0.0.1/docs/api/modules.rst +7 -0
- gammapy_plugin-0.0.1/docs/conf.py +45 -0
- gammapy_plugin-0.0.1/docs/download_notebooks.sh +178 -0
- gammapy_plugin-0.0.1/docs/index.rst +54 -0
- gammapy_plugin-0.0.1/docs/installation.md +32 -0
- gammapy_plugin-0.0.1/docs/intro.rst +20 -0
- gammapy_plugin-0.0.1/docs/make.bat +35 -0
- gammapy_plugin-0.0.1/docs/md_docs/converter.md +173 -0
- gammapy_plugin-0.0.1/docs/md_docs/crab_spectrum.md +221 -0
- gammapy_plugin-0.0.1/docs/requirements.txt +11 -0
- gammapy_plugin-0.0.1/gammapy_plugin/__init__.py +5 -0
- gammapy_plugin-0.0.1/gammapy_plugin/_version.py +24 -0
- gammapy_plugin-0.0.1/gammapy_plugin/converter.py +276 -0
- gammapy_plugin-0.0.1/gammapy_plugin/gammapy_like.py +325 -0
- gammapy_plugin-0.0.1/gammapy_plugin/io/__init__.py +0 -0
- gammapy_plugin-0.0.1/gammapy_plugin/io/plot_model.py +89 -0
- gammapy_plugin-0.0.1/gammapy_plugin/models/__init__.py +8 -0
- gammapy_plugin-0.0.1/gammapy_plugin/models/spatial.py +153 -0
- gammapy_plugin-0.0.1/gammapy_plugin/models/spectral.py +184 -0
- gammapy_plugin-0.0.1/gammapy_plugin/test/conftest.py +224 -0
- gammapy_plugin-0.0.1/gammapy_plugin/test/test_GammapyLike.py +114 -0
- gammapy_plugin-0.0.1/gammapy_plugin/test/test_astromodels_converter.py +79 -0
- gammapy_plugin-0.0.1/gammapy_plugin/test/test_astromodels_functions.py +59 -0
- gammapy_plugin-0.0.1/gammapy_plugin/test/test_astromodels_numba_functions.py +26 -0
- gammapy_plugin-0.0.1/gammapy_plugin/test/test_extended-source.py +230 -0
- gammapy_plugin-0.0.1/gammapy_plugin/test/test_gammapy_converter.py +9 -0
- gammapy_plugin-0.0.1/gammapy_plugin/test/test_gammapy_parser.py +53 -0
- gammapy_plugin-0.0.1/gammapy_plugin/test/test_models.py +69 -0
- gammapy_plugin-0.0.1/gammapy_plugin/test/test_point-source.py +118 -0
- gammapy_plugin-0.0.1/gammapy_plugin/test/test_validation.py +91 -0
- gammapy_plugin-0.0.1/gammapy_plugin/test/utils.py +54 -0
- gammapy_plugin-0.0.1/gammapy_plugin/utils/__init__.py +0 -0
- gammapy_plugin-0.0.1/gammapy_plugin/utils/astromodels_functions.py +118 -0
- gammapy_plugin-0.0.1/gammapy_plugin/utils/gammapy_parser.py +90 -0
- gammapy_plugin-0.0.1/gammapy_plugin/utils/package_data.py +28 -0
- gammapy_plugin-0.0.1/gammapy_plugin.egg-info/PKG-INFO +122 -0
- gammapy_plugin-0.0.1/gammapy_plugin.egg-info/SOURCES.txt +65 -0
- gammapy_plugin-0.0.1/gammapy_plugin.egg-info/dependency_links.txt +1 -0
- gammapy_plugin-0.0.1/gammapy_plugin.egg-info/requires.txt +16 -0
- gammapy_plugin-0.0.1/gammapy_plugin.egg-info/scm_file_list.json +61 -0
- gammapy_plugin-0.0.1/gammapy_plugin.egg-info/scm_version.json +8 -0
- gammapy_plugin-0.0.1/gammapy_plugin.egg-info/top_level.txt +1 -0
- gammapy_plugin-0.0.1/pyproject.toml +79 -0
- gammapy_plugin-0.0.1/recipes/gammapy-plugin/recipe.yaml +59 -0
- gammapy_plugin-0.0.1/setup.cfg +4 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
gammapy_plugin/_version.py export-subst
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Bug report
|
|
3
|
+
about: Create a report to help us improve
|
|
4
|
+
title: "[BUG] Name of the issue"
|
|
5
|
+
labels: bug
|
|
6
|
+
assignees: ''
|
|
7
|
+
type: Bug
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
**Describe the bug**
|
|
12
|
+
A clear and concise description of what the bug is.
|
|
13
|
+
|
|
14
|
+
**To Reproduce**
|
|
15
|
+
Steps to reproduce the behavior:
|
|
16
|
+
1. Go to '...'
|
|
17
|
+
2. Click on '....'
|
|
18
|
+
3. Scroll down to '....'
|
|
19
|
+
4. See error
|
|
20
|
+
|
|
21
|
+
**Expected behavior**
|
|
22
|
+
A clear and concise description of what you expected to happen.
|
|
23
|
+
|
|
24
|
+
**Screenshots**
|
|
25
|
+
If applicable, add screenshots to help explain your problem.
|
|
26
|
+
|
|
27
|
+
**Desktop (please complete the following information):**
|
|
28
|
+
- OS: [e.g. iOS]
|
|
29
|
+
- Browser [e.g. chrome, safari]
|
|
30
|
+
- Version [e.g. 22]
|
|
31
|
+
|
|
32
|
+
**Smartphone (please complete the following information):**
|
|
33
|
+
- Device: [e.g. iPhone6]
|
|
34
|
+
- OS: [e.g. iOS8.1]
|
|
35
|
+
- Browser [e.g. stock browser, safari]
|
|
36
|
+
- Version [e.g. 22]
|
|
37
|
+
|
|
38
|
+
**Additional context**
|
|
39
|
+
Add any other context about the problem here.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Feature request
|
|
3
|
+
about: Suggest an idea for this project
|
|
4
|
+
title: "[FEAT] Name of Your Feature"
|
|
5
|
+
labels: enhancement
|
|
6
|
+
assignees: ''
|
|
7
|
+
type: Feature
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
**Is your feature request related to a problem? Please describe.**
|
|
12
|
+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
|
13
|
+
|
|
14
|
+
**Describe the solution you'd like**
|
|
15
|
+
A clear and concise description of what you want to happen.
|
|
16
|
+
|
|
17
|
+
**Describe alternatives you've considered**
|
|
18
|
+
A clear and concise description of any alternative solutions or features you've considered.
|
|
19
|
+
|
|
20
|
+
**Additional context**
|
|
21
|
+
Add any other context or screenshots about the feature request here.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
* Gammapy Plugin version:
|
|
2
|
+
* Gammapy Version:
|
|
3
|
+
* Python version:
|
|
4
|
+
* Numpy version:
|
|
5
|
+
* Operating System:
|
|
6
|
+
|
|
7
|
+
### Description
|
|
8
|
+
|
|
9
|
+
Describe what you were trying to get done.
|
|
10
|
+
Tell us what happened, what went wrong, and what you expected to happen.
|
|
11
|
+
|
|
12
|
+
### What I Did
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
Paste the command(s) you ran and the output.
|
|
16
|
+
If there was a crash, please include the traceback here.
|
|
17
|
+
```
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# To get started with Dependabot version updates, you'll need to specify which
|
|
2
|
+
# package ecosystems to update and where the package manifests are located.
|
|
3
|
+
# Please see the documentation for all configuration options:
|
|
4
|
+
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
|
|
5
|
+
|
|
6
|
+
version: 2
|
|
7
|
+
updates:
|
|
8
|
+
- package-ecosystem: "pip" # See documentation for possible values
|
|
9
|
+
directory: "/" # Location of package manifests
|
|
10
|
+
schedule:
|
|
11
|
+
interval: "weekly"
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
branches:
|
|
5
|
+
- main
|
|
6
|
+
- dev
|
|
7
|
+
paths-ignore:
|
|
8
|
+
- "README.md"
|
|
9
|
+
- "**/docs/**"
|
|
10
|
+
- ".github/workflows/docs.yml"
|
|
11
|
+
pull_request:
|
|
12
|
+
branches:
|
|
13
|
+
- main
|
|
14
|
+
- dev
|
|
15
|
+
schedule:
|
|
16
|
+
- cron: "0 11 * * 1"
|
|
17
|
+
release:
|
|
18
|
+
types: [published]
|
|
19
|
+
|
|
20
|
+
jobs:
|
|
21
|
+
skip_duplicate:
|
|
22
|
+
runs-on: ubuntu-slim
|
|
23
|
+
outputs:
|
|
24
|
+
should_skip: ${{ steps.skip_check.outputs.should_skip }}
|
|
25
|
+
steps:
|
|
26
|
+
- id: skip_check
|
|
27
|
+
uses: fkirc/skip-duplicate-actions@master
|
|
28
|
+
with:
|
|
29
|
+
github_token: ${{ github.token }}
|
|
30
|
+
concurrent_skipping: never
|
|
31
|
+
skip_after_successful_duplicate: true
|
|
32
|
+
paths_ignore: '["**/README.md", "**/docs/**"]'
|
|
33
|
+
do_not_skip: '["pull_request", "schedule"]'
|
|
34
|
+
|
|
35
|
+
test-dev:
|
|
36
|
+
name: Build and Test latest (${{ matrix.os}}, Python ${{ matrix.python-version}})
|
|
37
|
+
needs: skip_duplicate
|
|
38
|
+
runs-on: ${{ matrix.os }}
|
|
39
|
+
strategy:
|
|
40
|
+
fail-fast: false
|
|
41
|
+
matrix:
|
|
42
|
+
os: ["ubuntu-latest","macos-latest"]
|
|
43
|
+
python-version: ["3.12","3.13"]
|
|
44
|
+
|
|
45
|
+
if: ${{ needs.skip_duplicate.outputs.should_skip != 'true' && ((github.event_name == 'push' && github.ref == 'refs/heads/dev') || (github.event_name == 'pull_request' && github.base_ref == 'dev')) }}
|
|
46
|
+
|
|
47
|
+
env:
|
|
48
|
+
GAMMAPY_DATA: ${{ github.workspace }}/gammapy_data
|
|
49
|
+
|
|
50
|
+
steps:
|
|
51
|
+
- uses: actions/checkout@v6
|
|
52
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
53
|
+
uses: actions/setup-python@v6
|
|
54
|
+
with:
|
|
55
|
+
python-version: ${{ matrix.python-version }}
|
|
56
|
+
cache: pip
|
|
57
|
+
- name: Install dependencies
|
|
58
|
+
run: |
|
|
59
|
+
pip install --upgrade --pre git+https://github.com/threeML/astromodels.git@dev
|
|
60
|
+
pip install --upgrade --pre git+https://github.com/threeML/threeML.git@dev
|
|
61
|
+
pip install --upgrade git+https://github.com/gammapy/gammapy.git@main
|
|
62
|
+
pip install --upgrade ultranest
|
|
63
|
+
|
|
64
|
+
pip install -e ".[all]"
|
|
65
|
+
|
|
66
|
+
- name: List installed packages
|
|
67
|
+
run: |
|
|
68
|
+
pip freeze
|
|
69
|
+
- name: Test with pytest
|
|
70
|
+
run: |
|
|
71
|
+
git clone https://github.com/gammapy/gammapy-data.git $GAMMAPY_DATA
|
|
72
|
+
pytest -vv gammapy_plugin --cov=gammapy_plugin --cov-report=xml --cov-report=term -n auto --dist worksteal
|
|
73
|
+
env:
|
|
74
|
+
NUMBA_DISABLE_JIT: 0
|
|
75
|
+
|
|
76
|
+
- name: Upload coverage to Codecov
|
|
77
|
+
uses: codecov/codecov-action@v6
|
|
78
|
+
with:
|
|
79
|
+
token: ${{ secrets.CODECOV_TOKEN }}
|
|
80
|
+
files: coverage.xml
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
test-main:
|
|
84
|
+
name: Build and Test (${{ matrix.os}}, Python ${{ matrix.python-version}})
|
|
85
|
+
needs: skip_duplicate
|
|
86
|
+
runs-on: ${{ matrix.os }}
|
|
87
|
+
strategy:
|
|
88
|
+
fail-fast: false
|
|
89
|
+
matrix:
|
|
90
|
+
os: ["ubuntu-latest","macos-latest"]
|
|
91
|
+
python-version: ["3.12","3.13"]
|
|
92
|
+
|
|
93
|
+
if: ${{ needs.skip_duplicate.outputs.should_skip != 'true' && ((github.event_name == 'push' && github.ref == 'refs/heads/main') || (github.event_name == 'pull_request' && github.base_ref == 'main')) }}
|
|
94
|
+
env:
|
|
95
|
+
GAMMAPY_DATA: ${{ github.workspace }}/gammapy_data
|
|
96
|
+
|
|
97
|
+
steps:
|
|
98
|
+
- uses: actions/checkout@v6
|
|
99
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
100
|
+
uses: actions/setup-python@v6
|
|
101
|
+
with:
|
|
102
|
+
python-version: ${{ matrix.python-version }}
|
|
103
|
+
cache: pip
|
|
104
|
+
- name: Install dependencies
|
|
105
|
+
run: |
|
|
106
|
+
pip install ultranest
|
|
107
|
+
|
|
108
|
+
- name: Test with pytest
|
|
109
|
+
run: |
|
|
110
|
+
git clone https://github.com/gammapy/gammapy-data.git $GAMMAPY_DATA
|
|
111
|
+
pip install -e ".[all]"
|
|
112
|
+
pytest -vv gammapy_plugin --cov=gammapy_plugin --cov-report=xml --cov-report=term -n auto --dist worksteal
|
|
113
|
+
env:
|
|
114
|
+
NUMBA_DISABLE_JIT: 0
|
|
115
|
+
- name: Upload coverage to Codecov
|
|
116
|
+
uses: codecov/codecov-action@v6
|
|
117
|
+
with:
|
|
118
|
+
token: ${{ secrets.CODECOV_TOKEN }}
|
|
119
|
+
files: coverage.xml
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
package:
|
|
123
|
+
name: Build & verify package
|
|
124
|
+
runs-on: "ubuntu-latest"
|
|
125
|
+
|
|
126
|
+
steps:
|
|
127
|
+
- uses: actions/checkout@v6
|
|
128
|
+
- uses: actions/setup-python@v6
|
|
129
|
+
with:
|
|
130
|
+
python-version: "3.12"
|
|
131
|
+
cache: pip
|
|
132
|
+
|
|
133
|
+
- name: Install twine
|
|
134
|
+
run: python -m pip install twine
|
|
135
|
+
- name: Build package
|
|
136
|
+
run: |
|
|
137
|
+
pip install --upgrade setuptools
|
|
138
|
+
pip install --upgrade build
|
|
139
|
+
python -m build
|
|
140
|
+
- name: List result
|
|
141
|
+
run: ls -l dist
|
|
142
|
+
- name: Check long_description
|
|
143
|
+
run: python -m twine check dist/*
|
|
144
|
+
|
|
145
|
+
publish-test:
|
|
146
|
+
name: Publish to TestPyPI
|
|
147
|
+
needs: package
|
|
148
|
+
runs-on: ubuntu-latest
|
|
149
|
+
if: github.event_name == 'release' && github.event.action == 'published' && github.event.release.prerelease
|
|
150
|
+
environment: testpypi
|
|
151
|
+
permissions:
|
|
152
|
+
id-token: write
|
|
153
|
+
|
|
154
|
+
steps:
|
|
155
|
+
- uses: actions/checkout@v6
|
|
156
|
+
- uses: actions/setup-python@v6
|
|
157
|
+
with:
|
|
158
|
+
python-version: "3.13"
|
|
159
|
+
cache: pip
|
|
160
|
+
|
|
161
|
+
- name: Build package
|
|
162
|
+
run: |
|
|
163
|
+
pip install --upgrade build
|
|
164
|
+
python -m build
|
|
165
|
+
|
|
166
|
+
- name: Publish to TestPyPI
|
|
167
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
168
|
+
with:
|
|
169
|
+
repository-url: https://test.pypi.org/legacy/
|
|
170
|
+
|
|
171
|
+
publish:
|
|
172
|
+
name: Publish to PyPI
|
|
173
|
+
needs: package
|
|
174
|
+
runs-on: ubuntu-latest
|
|
175
|
+
if: github.event_name == 'release' && github.event.action == 'published' && !github.event.release.prerelease
|
|
176
|
+
environment: pypi
|
|
177
|
+
permissions:
|
|
178
|
+
id-token: write # trusted publishing (no API token needed)
|
|
179
|
+
|
|
180
|
+
steps:
|
|
181
|
+
- uses: actions/checkout@v6
|
|
182
|
+
- uses: actions/setup-python@v6
|
|
183
|
+
with:
|
|
184
|
+
python-version: "3.13"
|
|
185
|
+
cache: pip
|
|
186
|
+
|
|
187
|
+
- name: Build package
|
|
188
|
+
run: |
|
|
189
|
+
pip install --upgrade build
|
|
190
|
+
python -m build
|
|
191
|
+
|
|
192
|
+
- name: Publish to PyPI
|
|
193
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
name: Docs
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
branches:
|
|
5
|
+
- main
|
|
6
|
+
tags:
|
|
7
|
+
- "v*"
|
|
8
|
+
pull_request:
|
|
9
|
+
branches:
|
|
10
|
+
- main
|
|
11
|
+
release:
|
|
12
|
+
|
|
13
|
+
permissions:
|
|
14
|
+
contents: write # 'write' access to repository contents
|
|
15
|
+
pull-requests: write # 'write' access to pull requests
|
|
16
|
+
|
|
17
|
+
jobs:
|
|
18
|
+
build-notebooks:
|
|
19
|
+
name: "Build the notebooks for the docs"
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
steps:
|
|
22
|
+
- uses: actions/checkout@v7
|
|
23
|
+
- name: Set SHA
|
|
24
|
+
run: |
|
|
25
|
+
SHA="${{ github.event.pull_request.head.sha || github.sha }}"
|
|
26
|
+
echo "SHA=$SHA" >> "$GITHUB_ENV"
|
|
27
|
+
|
|
28
|
+
- name: Set up Python
|
|
29
|
+
uses: actions/setup-python@v6
|
|
30
|
+
with:
|
|
31
|
+
python-version: 3.13
|
|
32
|
+
|
|
33
|
+
- name: Install dependencies
|
|
34
|
+
run: |
|
|
35
|
+
pip install black ultranest
|
|
36
|
+
pip install -e .
|
|
37
|
+
pip install -r docs/requirements.txt
|
|
38
|
+
|
|
39
|
+
- name: Execute the notebooks
|
|
40
|
+
shell: bash -l {0}
|
|
41
|
+
run: |
|
|
42
|
+
set -e
|
|
43
|
+
export GAMMAPY_DATA="/home/runner/work/gammapy_data"
|
|
44
|
+
mkdir -p $GAMMAPY_DATA
|
|
45
|
+
git clone https://github.com/gammapy/gammapy-data.git $GAMMAPY_DATA
|
|
46
|
+
|
|
47
|
+
jupytext --to ipynb --pipe black --execute docs/md_docs/*.md
|
|
48
|
+
|
|
49
|
+
mkdir -p docs/notebooks
|
|
50
|
+
mv docs/md_docs/*.ipynb docs/notebooks
|
|
51
|
+
echo "Next - uploading artifacts for sha ${SHA}"
|
|
52
|
+
|
|
53
|
+
- uses: actions/upload-artifact@v7
|
|
54
|
+
with:
|
|
55
|
+
name: notebooks-for-${{ env.SHA }}
|
|
56
|
+
path: docs/notebooks
|
|
57
|
+
|
|
58
|
+
- name: Generate API stubs
|
|
59
|
+
shell: bash -l {0}
|
|
60
|
+
run: |
|
|
61
|
+
sphinx-apidoc -T gammapy_plugin -o docs/api
|
|
62
|
+
|
|
63
|
+
- uses: actions/upload-artifact@v7
|
|
64
|
+
with:
|
|
65
|
+
name: api_stubs-for-${{ env.SHA }}
|
|
66
|
+
path: docs/api
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
- name: Trigger RTD
|
|
70
|
+
shell: bash -l {0}
|
|
71
|
+
run: |
|
|
72
|
+
curl -X POST \
|
|
73
|
+
"https://app.readthedocs.org/api/v3/projects/gammapy-plugin/versions/${PR_NUMBER}/builds/" \
|
|
74
|
+
-H "Authorization: Token $TOKEN" \
|
|
75
|
+
-H "Content-Type: application/json" \
|
|
76
|
+
-d "{
|
|
77
|
+
\"branch\": \"${BRANCH}\"
|
|
78
|
+
}"
|
|
79
|
+
|
|
80
|
+
env:
|
|
81
|
+
TOKEN: ${{ secrets.RTD_API }}
|
|
82
|
+
BRANCH: ${{ github.event.pull_request.head.ref || github.ref_name }}
|
|
83
|
+
PR_NUMBER: ${{ github.event.number || 'latest' }}
|
|
84
|
+
|
|
85
|
+
pages:
|
|
86
|
+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
|
87
|
+
needs: build-notebooks
|
|
88
|
+
runs-on: ubuntu-latest
|
|
89
|
+
environment:
|
|
90
|
+
name: github-pages
|
|
91
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
|
92
|
+
permissions:
|
|
93
|
+
pages: write
|
|
94
|
+
id-token: write
|
|
95
|
+
steps:
|
|
96
|
+
- uses: actions/checkout@v7
|
|
97
|
+
|
|
98
|
+
- name: Set SHA
|
|
99
|
+
run: |
|
|
100
|
+
SHA="${{ github.event.pull_request.head.sha || github.sha }}"
|
|
101
|
+
echo "SHA=$SHA" >> "$GITHUB_ENV"
|
|
102
|
+
|
|
103
|
+
- name: Install pandoc
|
|
104
|
+
uses: pandoc/actions/setup@v1
|
|
105
|
+
|
|
106
|
+
- name: Get Notebooks
|
|
107
|
+
uses: actions/download-artifact@v8
|
|
108
|
+
with:
|
|
109
|
+
name: notebooks-for-${{ env.SHA }}
|
|
110
|
+
path: docs/notebooks
|
|
111
|
+
|
|
112
|
+
- name: Get API stubs
|
|
113
|
+
uses: actions/download-artifact@v8
|
|
114
|
+
with:
|
|
115
|
+
name: api_stubs-for-${{ env.SHA }}
|
|
116
|
+
path: docs/api
|
|
117
|
+
|
|
118
|
+
- id: deployment
|
|
119
|
+
uses: sphinx-notes/pages@v3
|
|
120
|
+
with:
|
|
121
|
+
checkout: false
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
docs/notebooks/*
|
|
2
|
+
docs/md_docs/chains
|
|
3
|
+
examples/*_run
|
|
4
|
+
gammapy_plugin/data/test/
|
|
5
|
+
gammapy_plugin/_version.py
|
|
6
|
+
examples/chain*
|
|
7
|
+
examples/*.fits
|
|
8
|
+
*.prof
|
|
9
|
+
# Byte-compiled / optimized / DLL files
|
|
10
|
+
__pycache__/
|
|
11
|
+
*.py[cod]
|
|
12
|
+
*$py.class
|
|
13
|
+
|
|
14
|
+
# C extensions
|
|
15
|
+
*.so
|
|
16
|
+
|
|
17
|
+
# Distribution / packaging
|
|
18
|
+
.Python
|
|
19
|
+
env/
|
|
20
|
+
build/
|
|
21
|
+
develop-eggs/
|
|
22
|
+
dist/
|
|
23
|
+
downloads/
|
|
24
|
+
eggs/
|
|
25
|
+
.eggs/
|
|
26
|
+
lib/
|
|
27
|
+
lib64/
|
|
28
|
+
parts/
|
|
29
|
+
sdist/
|
|
30
|
+
var/
|
|
31
|
+
wheels/
|
|
32
|
+
*.egg-info/
|
|
33
|
+
.installed.cfg
|
|
34
|
+
*.egg
|
|
35
|
+
|
|
36
|
+
# PyInstaller
|
|
37
|
+
# Usually these files are written by a python script from a template
|
|
38
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
39
|
+
*.manifest
|
|
40
|
+
*.spec
|
|
41
|
+
|
|
42
|
+
# Installer logs
|
|
43
|
+
pip-log.txt
|
|
44
|
+
pip-delete-this-directory.txt
|
|
45
|
+
|
|
46
|
+
# Unit test / coverage reports
|
|
47
|
+
htmlcov/
|
|
48
|
+
.tox/
|
|
49
|
+
.coverage
|
|
50
|
+
.coverage.*
|
|
51
|
+
.cache
|
|
52
|
+
nosetests.xml
|
|
53
|
+
coverage.xml
|
|
54
|
+
*.cover
|
|
55
|
+
.hypothesis/
|
|
56
|
+
.pytest_cache/
|
|
57
|
+
|
|
58
|
+
# Translations
|
|
59
|
+
*.mo
|
|
60
|
+
*.pot
|
|
61
|
+
|
|
62
|
+
# Django stuff:
|
|
63
|
+
*.log
|
|
64
|
+
local_settings.py
|
|
65
|
+
|
|
66
|
+
# Flask stuff:
|
|
67
|
+
instance/
|
|
68
|
+
.webassets-cache
|
|
69
|
+
|
|
70
|
+
# Scrapy stuff:
|
|
71
|
+
.scrapy
|
|
72
|
+
|
|
73
|
+
# Sphinx documentation
|
|
74
|
+
docs/_build/
|
|
75
|
+
|
|
76
|
+
# PyBuilder
|
|
77
|
+
target/
|
|
78
|
+
|
|
79
|
+
# Jupyter Notebook
|
|
80
|
+
.ipynb_checkpoints
|
|
81
|
+
|
|
82
|
+
# pyenv
|
|
83
|
+
.python-version
|
|
84
|
+
|
|
85
|
+
# celery beat schedule file
|
|
86
|
+
celerybeat-schedule
|
|
87
|
+
|
|
88
|
+
# SageMath parsed files
|
|
89
|
+
*.sage.py
|
|
90
|
+
|
|
91
|
+
# dotenv
|
|
92
|
+
.env
|
|
93
|
+
|
|
94
|
+
# virtualenv
|
|
95
|
+
.venv
|
|
96
|
+
venv/
|
|
97
|
+
ENV/
|
|
98
|
+
|
|
99
|
+
# Spyder project settings
|
|
100
|
+
.spyderproject
|
|
101
|
+
.spyproject
|
|
102
|
+
|
|
103
|
+
# Rope project settings
|
|
104
|
+
.ropeproject
|
|
105
|
+
|
|
106
|
+
# mkdocs documentation
|
|
107
|
+
/site
|
|
108
|
+
|
|
109
|
+
# mypy
|
|
110
|
+
.mypy_cache/
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
repos:
|
|
2
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
3
|
+
# Ruff version.
|
|
4
|
+
rev: v0.17.3
|
|
5
|
+
hooks:
|
|
6
|
+
# Run the linter.
|
|
7
|
+
- id: ruff-check
|
|
8
|
+
args: [ "--fix", "--ignore=RUF012" , "--config=pyproject.toml", "--show-fixes"]
|
|
9
|
+
exclude: "^gammapy_plugin/test/"
|
|
10
|
+
# Run the formatter.
|
|
11
|
+
- id: ruff-format
|
|
12
|
+
args: ["--config=pyproject.toml"]
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Read the Docs configuration file for Sphinx projects
|
|
2
|
+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
|
|
3
|
+
|
|
4
|
+
version: 2
|
|
5
|
+
|
|
6
|
+
build:
|
|
7
|
+
os: ubuntu-24.04
|
|
8
|
+
tools:
|
|
9
|
+
python: "3.12"
|
|
10
|
+
jobs:
|
|
11
|
+
pre_build:
|
|
12
|
+
- sphinx-apidoc . -o docs/api
|
|
13
|
+
- bash docs/download_notebooks.sh
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
# Build documentation in the "docs/" directory with Sphinx
|
|
17
|
+
sphinx:
|
|
18
|
+
configuration: docs/conf.py
|
|
19
|
+
fail_on_warning: false
|
|
20
|
+
|
|
21
|
+
python:
|
|
22
|
+
install:
|
|
23
|
+
- requirements: docs/requirements.txt
|
|
24
|
+
- method: pip
|
|
25
|
+
path: .
|
|
26
|
+
extra_requirements:
|
|
27
|
+
- docs
|
|
28
|
+
|