Skip to content

Commit

Permalink
Merge pull request #563 from SamuelBorden/refactor
Browse files Browse the repository at this point in the history
Merged in main to refactor, fixed merge conflicts
  • Loading branch information
gipert authored Mar 8, 2024
2 parents 4de5fd4 + 2da52fc commit c37ed84
Show file tree
Hide file tree
Showing 58 changed files with 6,664 additions and 1,018 deletions.
2 changes: 0 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,3 @@ updates:
directory: "/"
schedule:
interval: "monthly"
ignore:
- dependency-name: "actions/*"
Binary file added .github/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
49 changes: 27 additions & 22 deletions .github/workflows/distribution.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,47 @@ name: distribute

on:
workflow_dispatch:
pull_request:
push:
tags: "v*"
branches:
- main
release:
types:
- published

jobs:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
FORCE_COLOR: 3

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

- name: Build SDist and wheel
run: pipx run build

- uses: actions/upload-artifact@v3
with:
path: dist/*
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Check metadata
run: pipx run twine check dist/*
- uses: hynek/build-and-inspect-python-package@v2

publish:
needs: [dist]
name: Publish to PyPI
environment: pypi
permissions:
id-token: write
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@v4
with:
name: Packages
path: dist

- uses: pypa/gh-action-pypi-publish@release/v1
if: github.event_name == 'release' && github.event.action == 'published'
26 changes: 15 additions & 11 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
name: pygama

on:
workflow_dispatch:
pull_request:
push:
branches:
- main
- 'releases/**'
pull_request:
release:
- "releases/**"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
FORCE_COLOR: 3
TQDM_MININTERVAL: 100

jobs:

build-and-test:
Expand All @@ -24,9 +28,9 @@ jobs:
os: [ubuntu-latest, macOS-latest]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Get dependencies and install the package
Expand All @@ -35,16 +39,16 @@ jobs:
python -m pip install --upgrade .[test]
- name: Run unit tests
run: |
pytest
python -m pytest
test-coverage:
name: Calculate and upload test coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 2
- uses: actions/setup-python@v2
- uses: actions/setup-python@v5
with:
python-version: '3.10'

Expand All @@ -54,7 +58,7 @@ jobs:
python -m pip install --upgrade .[test]
python -m pytest --cov=pygama --cov-report=xml
- name: Upload Coverage to codecov.io
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
Expand All @@ -63,10 +67,10 @@ jobs:
name: Build documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v2
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Setup build environment
Expand Down
21 changes: 12 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ci:
exclude: ^(attic|tutorials|src/pygama/math|src/pygama/flow/datagroup.py)
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v4.4.0"
rev: "v4.5.0"
hooks:
- id: check-added-large-files
- id: check-case-conflict
Expand All @@ -26,35 +26,35 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/asottile/setup-cfg-fmt
rev: "v2.4.0"
rev: "v2.5.0"
hooks:
- id: setup-cfg-fmt

- repo: https://github.com/PyCQA/isort
rev: "5.12.0"
rev: "5.13.2"
hooks:
- id: isort

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

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

- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v1.5.1"
rev: "v1.8.0"
hooks:
- id: mypy
files: src
stages: [manual]

- repo: https://github.com/hadialqattan/pycln
rev: "v2.2.2"
rev: "v2.4.0"
hooks:
- id: pycln
exclude: ^src/pygama/pargen
Expand All @@ -70,6 +70,7 @@ repos:
flake8-print,
pep8-naming
]
args: ["--extend-ignore", "E203,E501"]

- repo: https://github.com/kynan/nbstripout
rev: "0.6.1"
Expand All @@ -85,9 +86,11 @@ repos:
stages: [manual]

- repo: https://github.com/codespell-project/codespell
rev: "v2.2.5"
rev: "v2.2.6"
hooks:
- id: codespell
additional_dependencies:
- tomli

- repo: https://github.com/shellcheck-py/shellcheck-py
rev: "v0.9.0.6"
Expand All @@ -103,7 +106,7 @@ repos:
- id: rst-inline-touching-normal

- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v3.0.3"
rev: "v4.0.0-alpha.8"
hooks:
- id: prettier
types_or: [json]
58 changes: 58 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
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
given-names: Matteo
orcid: https://orcid.org/0000-0003-1151-5301
- family-names: Detwiler
given-names: Jason
orcid: https://orcid.org/0000-0002-9050-4610
- family-names: Pertoldi
given-names: Luigi
orcid: https://orcid.org/0000-0002-0467-2571
- family-names: Guinn
given-names: Ian
orcid: https://orcid.org/0000-0002-2424-3272
- family-names: Marshall
given-names: George
orcid: https://orcid.org/0000-0002-5470-5132
- family-names: D'Andrea
given-names: Valerio
orcid: https://orcid.org/0000-0003-2037-4133
- family-names: Krause
given-names: Patrick
orcid: https://orcid.org/0000-0002-9603-7865
- family-names: Song
given-names: Grace
email: [email protected]
- family-names: Engelhardt
given-names: Erin
email: [email protected]
- family-names: Borden
given-names: Sam
orcid: https://orcid.org/0009-0003-2539-4333
- family-names: Deckert
given-names: Rosanna
orcid: https://orcid.org/0009-0006-0431-341X
- family-names: Sweigart
given-names: David
email: [email protected]
- family-names: Zschocke
given-names: Andreas
email: [email protected]
- family-names: Wiseman
given-names: Clint
orcid: https://orcid.org/0000-0002-4232-1326
- family-names: Mathew
given-names: Tim
email: [email protected]
- family-names: Kermaïdic
given-names: Yoann
orcid: https://orcid.org/0000-0001-8007-8016
- family-names: Shanks
given-names: Ben
email: [email protected]
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<img src=".github/logo.png" alt="pygama logo" align="left" height="150">

# pygama

[![PyPI](https://img.shields.io/pypi/v/pygama?logo=pypi)](https://pypi.org/project/pygama/)
Expand All @@ -10,6 +12,7 @@
[![GitHub pull requests](https://img.shields.io/github/issues-pr/legend-exp/pygama?logo=github)](https://github.com/legend-exp/pygama/pulls)
[![License](https://img.shields.io/github/license/legend-exp/pygama)](https://github.com/legend-exp/pygama/blob/main/LICENSE)
[![Read the Docs](https://img.shields.io/readthedocs/pygama?logo=readthedocs)](https://pygama.readthedocs.io)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.10614246.svg)](https://zenodo.org/doi/10.5281/zenodo.10614246)

*pygama* is a Python package for:

Expand All @@ -25,3 +28,15 @@
- generating and selecting high-level event data for further analysis

Check out the [online documentation](https://pygama.readthedocs.io).

If you are using this software, consider
[citing](https://zenodo.org/doi/10.5281/zenodo.10614246)!

## Related repositories

- [legend-exp/legend-pydataobj](https://github.com/legend-exp/legend-pydataobj)
→ LEGEND Python Data Objects
- [legend-exp/legend-daq2lh5](https://github.com/legend-exp/legend-daq2lh5)
→ Convert digitizer data to LEGEND HDF5
- [legend-exp/dspeed](https://github.com/legend-exp/dspeed)
→ Fast Digital Signal Processing for particle detector signals in Python
5 changes: 4 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"source_directory": "docs/source",
}
html_title = f"{project} {version}"
html_logo = "../../.github/logo.png"

# sphinx-napoleon
# enforce consistent usage of NumPy-style docstrings
Expand All @@ -57,9 +58,11 @@
"scipy": ("https://docs.scipy.org/doc/scipy", None),
"pandas": ("https://pandas.pydata.org/docs", None),
"matplotlib": ("https://matplotlib.org/stable", None),
"iminuit": ("https://iminuit.readthedocs.io/en/stable", None),
"h5py": ("https://docs.h5py.org/en/stable", None),
"pint": ("https://pint.readthedocs.io/en/stable", None),
"lgdo": ("https://legend-pydataobj.readthedocs.io/en/stable", None),
"dspeed": ("https://dspeed.readthedocs.io/en/stable", None),
"daq2lh5": ("https://legend-daq2lh5.readthedocs.io/en/stable", None),
}

suppress_warnings = [
Expand Down
Loading

0 comments on commit c37ed84

Please sign in to comment.