Skip to content

Commit

Permalink
Merge pull request #564 from ggmarshall/main
Browse files Browse the repository at this point in the history
Pargen refactor
  • Loading branch information
gipert authored Apr 26, 2024
2 parents 9a30e7a + 2c79cd1 commit e6e178f
Show file tree
Hide file tree
Showing 60 changed files with 7,925 additions and 9,529 deletions.
31 changes: 15 additions & 16 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,28 @@ env:
TQDM_MININTERVAL: 100

jobs:

build-and-test:
name: Test pygama with Python
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ['3.9', '3.10', '3.11']
python-version: ["3.9", "3.10", "3.11"]
os: [ubuntu-latest, macOS-latest]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Get dependencies and install the package
run: |
python -m pip install --upgrade pip wheel setuptools
python -m pip install --upgrade .[test]
- name: Run unit tests
run: |
python -m pytest
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Get dependencies and install the package
run: |
python -m pip install --upgrade pip wheel setuptools
python -m pip install --upgrade .[test]
- name: Run unit tests
run: |
python -m pytest
test-coverage:
name: Calculate and upload test coverage
Expand All @@ -50,7 +49,7 @@ jobs:
fetch-depth: 2
- uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: "3.10"

- name: Generate Report
run: |
Expand All @@ -72,7 +71,7 @@ jobs:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: "3.10"
- name: Setup build environment
run: |
sudo apt-get install -y pandoc
Expand Down
14 changes: 6 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,18 @@ repos:
- id: isort

- repo: https://github.com/asottile/pyupgrade
rev: "v3.15.0"
rev: "v3.15.2"
hooks:
- id: pyupgrade
args: ["--py38-plus"]

- repo: https://github.com/psf/black
rev: "23.12.1"
rev: "24.3.0"
hooks:
- id: black-jupyter

- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v1.8.0"
rev: "v1.9.0"
hooks:
- id: mypy
files: src
Expand All @@ -57,14 +57,12 @@ repos:
rev: "v2.4.0"
hooks:
- id: pycln
exclude: ^src/pygama/pargen
args: [--all]

- repo: https://github.com/PyCQA/flake8
rev: "6.1.0"
rev: "7.0.0"
hooks:
- id: flake8
exclude: ^src/pygama/pargen
additional_dependencies: [
flake8-bugbear>=23.1.17,
flake8-print,
Expand All @@ -73,7 +71,7 @@ repos:
args: ["--extend-ignore", "E203,E501"]

- repo: https://github.com/kynan/nbstripout
rev: "0.6.1"
rev: "0.7.1"
hooks:
- id: nbstripout
args: ["--drop-empty-cells",
Expand All @@ -93,7 +91,7 @@ repos:
- tomli

- repo: https://github.com/shellcheck-py/shellcheck-py
rev: "v0.9.0.6"
rev: "v0.10.0.1"
hooks:
- id: shellcheck

Expand Down
1 change: 0 additions & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ cff-version: 1.2.0
title: pygama
doi: https://doi.org/10.5281/zenodo.10614246
date-released: 2024-02-03
url: https://github.com/github-linguist/linguist
message: "If you use this software, please cite it as below."
authors:
- family-names: Agostini
Expand Down
2 changes: 1 addition & 1 deletion codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ coverage:
patch: false

github_checks:
annotations: false
annotations: false

comment:
require_changes: true
Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
autodoc_default_options = {"ignore-module-all": True}
# Include __init__() docstring in class docstring
autoclass_content = "both"
autodoc_typehints = "both"
autodoc_typehints = "description"
autodoc_typehints_description_target = "documented_params"
autodoc_typehints_format = "short"

Expand Down
1 change: 1 addition & 0 deletions docs/source/extensions/numbadoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Adapted from https://github.com/numba/numba/issues/5755#issuecomment-646587651
"""

from copy import copy
from typing import Iterator, List

Expand Down
7 changes: 4 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,14 @@ dependencies = [
"dspeed>=1.3",
"h5py>=3.2",
"iminuit",
"legend-daq2lh5>=1.2",
"legend-pydataobj>=1.5",
"legend-daq2lh5>=1.2.1",
"legend-pydataobj>=1.6",
"matplotlib",
"numba!=0.53.*,!=0.54.*,!=0.57",
"numpy>=1.21",
"pandas>=1.4.4",
"pint",
"pyyaml",
"scikit-learn",
"scipy>=1.0.1",
"tables",
Expand Down Expand Up @@ -115,7 +116,7 @@ report.exclude_also = [
extend-ignore = "E203, E501"

[tool.codespell]
ignore-words-list = "hist, gaus, nd, ans, crate, nin, puls, spms, fom"
ignore-words-list = "hist, gaus, nd, ans, crate, nin, puls, spms, fom, FOM"

[tool.pytest.ini_options]
minversion = "6.0"
Expand Down
1 change: 1 addition & 0 deletions src/pygama/cli.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
pygama's command line interface utilities.
"""

import argparse
import logging
import os
Expand Down
Loading

0 comments on commit e6e178f

Please sign in to comment.