Skip to content

Commit

Permalink
Merge pull request #66 from scikit-hep/je_add_multidim_hypotest
Browse files Browse the repository at this point in the history
Upgrade to multiple dimensions and binned PDFs
  • Loading branch information
jonas-eschle authored Sep 3, 2022
2 parents c70c31f + d50fb77 commit 9f4549c
Show file tree
Hide file tree
Showing 33 changed files with 1,664 additions and 611 deletions.
9 changes: 0 additions & 9 deletions .github/workflows/auto-cancellation.yml

This file was deleted.

164 changes: 87 additions & 77 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,40 @@ on:
branches: [ "master"]
release:
types:
- "published"
- "published"

jobs:
cancel:
name: 'Cancel Previous Runs'
runs-on: ubuntu-latest
timeout-minutes: 3
steps:
- uses: styfle/[email protected]
with:
all_but_latest: true
access_token: ${{ github.token }}

pre-commit:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v4
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v4

checks:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- ubuntu-latest
python-version:
- "3.7"
- "3.8"
- "3.9"
- "3.10"
- "3.7"
- "3.8"
- "3.9"
- "3.10"
include:
- os: windows-latest
python-version: "3.7"
Expand All @@ -41,87 +51,87 @@ jobs:
python-version: "3.10"
name: Check Python ${{ matrix.python-version }} ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install package
run: python -m pip install -e .[test]

- name: Test package
run: python -m pytest --doctest-modules --cov=hepstats --cov-report=xml

- name: Upload coverage to Codecov
if: matrix.python-version == '3.10' && matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: true
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install package
run: python -m pip install -e .[test]

- name: Test package
run: python -m pytest --doctest-modules --cov=hepstats --cov-report=xml

- name: Upload coverage to Codecov
if: matrix.python-version == '3.10' && matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: true

dist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Build
run: pipx run build
- name: Build
run: pipx run build

- uses: actions/upload-artifact@v3
with:
path: dist/*
- uses: actions/upload-artifact@v3
with:
path: dist/*

- name: Check metadata
run: pipx run twine check dist/*
- name: Check metadata
run: pipx run twine check dist/*

docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install dependencies
run: |
pip install -U -q -e .[docs]
pip list
- name: build docs
run: |
sphinx-build -b html docs docs/_build/html
touch docs/_build/html/.nojekyll
- name: Deploy docs to GitHub Pages
if: success() && github.event_name == 'push' && github.ref == 'refs/heads/master'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/_build/html
force_orphan: true
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
commit_message: Deploy to GitHub pages
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install dependencies
run: |
pip install -U -q -e .[docs]
pip list
- name: build docs
run: |
sphinx-build -b html docs docs/_build/html
touch docs/_build/html/.nojekyll
- name: Deploy docs to GitHub Pages
if: success() && github.event_name == 'push' && github.ref == 'refs/heads/master'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/_build/html
force_orphan: true
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
commit_message: Deploy to GitHub pages

publish:
needs: [dist]
needs: [ dist ]
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'

steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist

- uses: pypa/[email protected]
with:
password: ${{ secrets.pypi_password }}
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist

- uses: pypa/[email protected]
with:
password: ${{ secrets.pypi_password }}
169 changes: 87 additions & 82 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,94 +1,99 @@
repos:
- repo: https://github.com/psf/black
rev: 22.8.0
hooks:
- id: black
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: check-added-large-files
args: [ '--maxkb=1000' ]
- id: mixed-line-ending
exclude: ^notebooks/
- id: trailing-whitespace
exclude: ^notebooks/
- id: check-merge-conflict
- id: check-case-conflict
- id: check-symlinks
- id: check-yaml
exclude: ^notebooks/
- id: requirements-txt-fixer
- id: debug-statements
- id: end-of-file-fixer
- repo: https://github.com/mgedmin/check-manifest
rev: "0.48"
hooks:
- id: check-manifest
args: [ --update, --no-build-isolation ]
additional_dependencies: [ setuptools-scm ]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.971
hooks:
- id: mypy
files: src
- repo: https://github.com/psf/black
rev: 22.6.0
hooks:
- id: black
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: check-added-large-files
args: ['--maxkb=1000']
- id: mixed-line-ending
exclude: ^notebooks/
- id: trailing-whitespace
exclude: ^notebooks/
- id: check-merge-conflict
- id: check-case-conflict
- id: check-symlinks
- id: check-yaml
exclude: ^notebooks/
- id: requirements-txt-fixer
- id: debug-statements
- id: end-of-file-fixer
- repo: https://github.com/mgedmin/check-manifest
rev: "0.48"
hooks:
- id: check-manifest
args: [ --update, --no-build-isolation ]
additional_dependencies: [ setuptools-scm ]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.971
hooks:
- id: mypy
files: src

- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.9.0
hooks:
- id: python-use-type-annotations
- id: python-check-mock-methods
- id: python-no-eval
- id: rst-backticks
- id: rst-directive-colons
- repo: https://github.com/roy-ht/pre-commit-jupyter
rev: v1.2.1
hooks:
- id: jupyter-notebook-cleanup

- repo: https://github.com/asottile/pyupgrade
rev: v2.37.3
hooks:
- id: pyupgrade
args: [ --py37-plus ]
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.9.0
hooks:
- id: python-use-type-annotations
- id: python-check-mock-methods
- id: python-no-eval
- id: rst-backticks
- id: rst-directive-colons

- repo: https://github.com/asottile/setup-cfg-fmt
rev: v2.0.0
hooks:
- id: setup-cfg-fmt
- repo: https://github.com/asottile/pyupgrade
rev: v2.37.3
hooks:
- id: pyupgrade
args: [ --py37-plus ]

# Notebook formatting
- repo: https://github.com/nbQA-dev/nbQA
rev: 1.4.0
hooks:
- id: nbqa-isort
additional_dependencies: [ isort==5.6.4 ]
- repo: https://github.com/asottile/setup-cfg-fmt
rev: v2.0.0
hooks:
- id: setup-cfg-fmt

- id: nbqa-pyupgrade
additional_dependencies: [ pyupgrade==2.7.4 ]
args: [ --py37-plus ]
# Notebook formatting
- repo: https://github.com/nbQA-dev/nbQA
rev: 1.4.0
hooks:
- id: nbqa-isort
additional_dependencies: [ isort==5.6.4 ]

- id: nbqa-pyupgrade
additional_dependencies: [ pyupgrade==2.7.4 ]
args: [ --py37-plus ]

- repo: https://github.com/roy-ht/pre-commit-jupyter
rev: v1.2.1
hooks:
- id: jupyter-notebook-cleanup

- repo: https://github.com/sondrelg/pep585-upgrade
rev: 'v1.0'
hooks:
- id: upgrade-type-hints
args: [ '--futures=true' ]
- repo: https://github.com/roy-ht/pre-commit-jupyter
rev: v1.2.1
hooks:
- id: jupyter-notebook-cleanup

- repo: https://github.com/shssoichiro/oxipng
rev: acdd66b4c5a5fda8b08281ad9b3216327b6847b4
hooks:
- id: oxipng
- repo: https://github.com/sondrelg/pep585-upgrade
rev: 'v1.0'
hooks:
- id: upgrade-type-hints
args: [ '--futures=true' ]

- repo: https://github.com/dannysepler/rm_unneeded_f_str
rev: v0.1.0
hooks:
- id: rm-unneeded-f-str
- repo: https://github.com/shssoichiro/oxipng
rev: acdd66b4c5a5fda8b08281ad9b3216327b6847b4
hooks:
- id: oxipng

- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.18.2
hooks:
- id: check-github-workflows
- id: check-github-actions
- id: check-dependabot
- id: check-readthedocs
- repo: https://github.com/dannysepler/rm_unneeded_f_str
rev: v0.1.0
hooks:
- id: rm-unneeded-f-str

- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.18.2
hooks:
- id: check-github-workflows
- id: check-github-actions
- id: check-dependabot
- id: check-readthedocs
Loading

0 comments on commit 9f4549c

Please sign in to comment.