Update gammapy/irf/core.py #24
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: [push, pull_request] | |
jobs: | |
lint: | |
name: Run pre-commit hooks | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- name: Install pre-commit | |
run: pip install pre-commit | |
- name: Run pre-commit | |
run: pre-commit run | |
ci-runs: | |
name: ${{ matrix.os }}, ${{ matrix.tox_env }} | |
runs-on: ${{ matrix.os }} | |
continue-on-error: ${{ matrix.allowed_fail }} | |
env: | |
PYTEST_ADDOPTS: --color=yes -n auto --dist=loadscope | |
strategy: | |
fail-fast: true | |
matrix: | |
include: | |
- os: ubuntu-latest | |
python: '3.11' | |
tox_env: 'py311-test-alldeps_noray' | |
gammapy_data_path: /home/runner/work/gammapy/gammapy/gammapy-datasets/dev | |
allowed_fail: false | |
- os: ubuntu-latest | |
python: '3.10' | |
tox_env: 'py310-test-alldeps-cov' | |
gammapy_data_path: /home/runner/work/gammapy/gammapy/gammapy-datasets/dev | |
allowed_fail: false | |
- os: macos-latest | |
python: '3.11' | |
tox_env: 'py311-test' | |
gammapy_data_path: /Users/runner/work/gammapy/gammapy/gammapy-datasets/dev | |
allowed_fail: false | |
- os: macos-14 | |
python: '3.11' | |
tox_env: 'py311-test' | |
allowed_fail: false | |
- os: windows-latest | |
python: '3.11' | |
tox_env: 'py311-test-alldeps_noray' | |
gammapy_data_path: D:\a\gammapy\gammapy\gammapy-datasets\dev | |
allowed_fail: false | |
- os: ubuntu-latest | |
python: '3.12' | |
tox_env: 'py312-test-alldeps_noray' | |
gammapy_data_path: /home/runner/work/gammapy/gammapy/gammapy-datasets/dev | |
allowed_fail: false | |
- os: ubuntu-latest | |
python: '3.10' | |
tox_env: 'py310-test' | |
allowed_fail: false | |
- os: ubuntu-latest | |
python: '3.10' | |
tox_env: 'codestyle' | |
allowed_fail: false | |
- os: ubuntu-latest | |
python: '3.9' | |
tox_env: 'py39-test-alldeps_noray-astropy50-numpy121' | |
allowed_fail: false | |
- os: ubuntu-latest | |
python: '3.9' | |
tox_env: 'oldestdeps' | |
allowed_fail: false | |
- os: ubuntu-latest | |
python: '3.11' | |
tox_env: 'devdeps' | |
allowed_fail: true | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python ${{ matrix.python }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Install base dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install tox | |
- name: download datasets | |
if: ${{ matrix.gammapy_data_path }} | |
run: | | |
python -m pip install tqdm requests | |
python -m pip install -e . | |
gammapy download datasets | |
- name: Print Python, pip, and tox versions | |
run: | | |
python -c "import sys; print(f'Python {sys.version}')" | |
python -c "import pip; print(f'pip {pip.__version__}')" | |
python -c "import tox; print(f'tox {tox.__version__}')" | |
- name: Run tests | |
if: ${{ !matrix.gammapy_data_path }} | |
run: tox -e ${{ matrix.tox_env }} -- -n auto | |
- name: Run tests with data | |
if: ${{ matrix.gammapy_data_path }} | |
env: | |
GAMMAPY_DATA: ${{ matrix.gammapy_data_path}} | |
run: tox -e ${{ matrix.tox_env }} -- -n auto | |
- name: Upload coverage to codecov | |
if: "contains(matrix.tox_env, '-cov')" | |
uses: codecov/codecov-action@v4 | |
with: | |
file: ./coverage.xml | |
verbose: true | |
sphinx: | |
name: Linux python 3.9 sphinx all-deps | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash -l {0} | |
env: | |
PYTEST_ADDOPTS: --color=yes -n auto --dist=loadscope | |
GAMMAPY_DATA: /home/runner/work/gammapy/gammapy/gammapy-datasets/dev | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python ${{ matrix.python }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Install base dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install tox | |
- name: download datasets | |
run: | | |
python -m pip install tqdm requests | |
python -m pip install -e . | |
gammapy download datasets | |
- name: test build docs | |
run: | | |
tox -e build_docs -- -j auto | |
- name: check links | |
continue-on-error: true | |
run: | | |
tox -e linkcheck -- -j auto | |
conda-build: | |
name: Linux python 3.9 conda-build all-deps | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- name: checkout repo | |
uses: actions/checkout@v4 | |
- name: create and activate env | |
uses: mamba-org/setup-micromamba@v1 | |
with: | |
environment-file: environment-dev.yml | |
cache-downloads: true | |
- name: install gammapy | |
run: | | |
pip install -e . | |
- name: test conda build | |
run: | | |
make clean | |
conda install conda-build | |
conda info | |
conda --version | |
conda build --version | |
python setup.py bdist_conda |