Skip to content

Commit

Permalink
Merge pull request #74 from legend-exp/meta_refactor
Browse files Browse the repository at this point in the history
Refactor for post-unblinding data taking
  • Loading branch information
gipert authored Feb 7, 2025
2 parents ced1987 + cbb29c8 commit 9d76030
Show file tree
Hide file tree
Showing 133 changed files with 8,382 additions and 7,541 deletions.
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
updates:
# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
59 changes: 59 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: lgdo

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

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

env:
FORCE_COLOR: 3

jobs:
build-and-test:
name: Test lgdo with Python
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12"]
os: [ubuntu-latest, macos-13]

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 legend-dataflow
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
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Generate Report
run: |
python -m pip install --upgrade pip wheel setuptools
python -m pip install --upgrade .[test]
python -m pytest --cov=legenddataflow --cov-report=xml
- name: Upload Coverage to codecov.io
uses: codecov/codecov-action@v5
14 changes: 13 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
.snakemake
workflow/src/legenddataflow/_version.py

# New additions go at the top!
*.c
.DS_Store
Expand All @@ -10,6 +13,13 @@
*~
*.csv

# uv
uv.lock

#prodenv_stuff
inputs
software
generated

# -------------------- github-generated stuff -------------------
# Byte-compiled / optimized / DLL files
Expand Down Expand Up @@ -77,7 +87,7 @@ instance/
.scrapy

# Sphinx documentation
/docs/build/
/docs/_build/
/docs/source/generated

# PyBuilder
Expand Down Expand Up @@ -113,3 +123,5 @@ venv.bak/

# mypy
.mypy_cache/

docs/source/api
164 changes: 89 additions & 75 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,89 +4,103 @@ ci:
autofix_commit_msg: "style: pre-commit fixes"

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v5.0.0"
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-merge-conflict
- id: check-symlinks
- id: check-yaml
- id: check-json
- id: check-toml
- id: check-docstring-first
- id: debug-statements
- id: end-of-file-fixer
- id: forbid-new-submodules
- id: mixed-line-ending
- id: name-tests-test
args: ["--pytest-test-first"]
- id: requirements-txt-fixer
- id: trailing-whitespace
- repo: https://github.com/adamchainz/blacken-docs
rev: "1.19.1"
hooks:
- id: blacken-docs
additional_dependencies: [black==24.*]

- repo: https://github.com/psf/black
rev: "24.10.0"
hooks:
- id: black-jupyter
args: ["--line-length", "99"]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v5.0.0"
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-merge-conflict
- id: check-symlinks
- id: check-yaml
- id: check-json
- id: check-toml
- id: check-docstring-first
- id: debug-statements
- id: end-of-file-fixer
- id: forbid-new-submodules
- id: mixed-line-ending
- id: name-tests-test
args: ["--pytest-test-first"]
- id: requirements-txt-fixer
- id: trailing-whitespace

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.8.6"
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.8.6"
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]
- id: ruff-format

- repo: https://github.com/asottile/setup-cfg-fmt
rev: "v2.7.0"
hooks:
- id: setup-cfg-fmt
- repo: https://github.com/abravalheri/validate-pyproject
rev: "v0.23"
hooks:
- id: validate-pyproject
additional_dependencies: ["validate-pyproject-schema-store[all]"]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v1.14.1"
hooks:
- id: mypy
files: src
stages: [manual]
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: "0.30.0"
hooks:
- id: check-dependabot
- id: check-github-workflows
- id: check-readthedocs

- repo: https://github.com/kynan/nbstripout
rev: "0.8.1"
hooks:
- id: nbstripout
args: ["--drop-empty-cells",
"--extra-keys", "metadata.kernelspec metadata.language_info"]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v1.14.1"
hooks:
- id: mypy
files: src
stages: [manual]

- repo: https://github.com/mgedmin/check-manifest
rev: "0.50"
hooks:
- id: check-manifest
stages: [manual]
- repo: https://github.com/kynan/nbstripout
rev: "0.8.1"
hooks:
- id: nbstripout
args:
[
"--drop-empty-cells",
"--extra-keys",
"metadata.kernelspec metadata.language_info",
]

- repo: https://github.com/codespell-project/codespell
rev: "v2.3.0"
hooks:
- id: codespell
args: ["-L", "nd,unparseable,compiletime,livetime,fom,puls"]
- repo: https://github.com/mgedmin/check-manifest
rev: "0.50"
hooks:
- id: check-manifest
stages: [manual]

- repo: https://github.com/shellcheck-py/shellcheck-py
rev: "v0.10.0.1"
hooks:
- id: shellcheck
- repo: https://github.com/codespell-project/codespell
rev: "v2.3.0"
hooks:
- id: codespell
args: ["-L", "nd,unparseable,compiletime,livetime,fom,puls"]

- repo: https://github.com/pre-commit/pygrep-hooks
rev: "v1.10.0"
hooks:
- id: rst-backticks
- id: rst-directive-colons
- id: rst-inline-touching-normal
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: "v0.10.0.1"
hooks:
- id: shellcheck

- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v4.0.0-alpha.8"
hooks:
- id: prettier
types_or: [json]
- repo: https://github.com/pre-commit/pygrep-hooks
rev: "v1.10.0"
hooks:
- id: rst-backticks
- id: rst-directive-colons
- id: rst-inline-touching-normal

- repo: https://github.com/snakemake/snakefmt
rev: v0.10.2
hooks:
- id: snakefmt
files: Snakefile*|\.smk
- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v4.0.0-alpha.8"
hooks:
- id: prettier
types_or: [yaml, markdown, json, toml]

- repo: https://github.com/snakemake/snakefmt
rev: v0.10.2
hooks:
- id: snakefmt
files: Snakefile*|\.smk
exclude: channel_merge.smk
23 changes: 23 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
version: 2

build:
os: "ubuntu-22.04"
tools:
python: "3.12"
commands:
# FIXME: dependencies should not be explicitly listed here!
- asdf plugin add uv
- asdf install uv latest
- asdf global uv latest
- uv venv
- uv pip install .[docs]
- rm -rf docs/source/api
- .venv/bin/python -m sphinx.ext.apidoc
--private
--module-first
--force
--output-dir docs/source/api
workflow/src
workflow/rules
- .venv/bin/python -m sphinx -T -b html -d docs/_build/doctrees -D
language=en docs/source $READTHEDOCS_OUTPUT/html
3 changes: 1 addition & 2 deletions .ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ lint.select = [
"PIE", # flake8-pie
"PL", # pylint
"PT", # flake8-pytest-style
# "PTH", # flake8-use-pathlib
"PTH", # flake8-use-pathlib
"RET", # flake8-return
"RUF", # Ruff-specific
"SIM", # flake8-simplify
Expand All @@ -29,7 +29,6 @@ lint.extend-ignore = [
"G004", # Logging statement uses f-string
"PLR", # Design related pylint codes
"E501", # Line too long
"PT004", # Use underscore for non-returning fixture (use usefixture instead)
"RET505", # Unnecessary `else` after `return` statement
"E402", # Module level imports at top of file need disable for numba default imports
"NPY201", # Numpy 2 warnings ignore for the moment
Expand Down
9 changes: 5 additions & 4 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
The legend-dataflow-hades package is licensed under the MIT "Expat" License:
The legend-dataflow package is licensed under the MIT "Expat" License:

> Copyright (c) 2021:
>
> Matteo Agostini <[email protected]>
> Oliver Schulz <[email protected]>
> Matteo Agostini <[email protected]>
> Oliver Schulz <[email protected]>
> George Marshall <[email protected]>
> Luigi Pertoldi <[email protected]>
>
> Permission is hereby granted, free of charge, to any person obtaining a copy
> of this software and associated documentation files (the "Software"), to deal
Expand All @@ -22,4 +24,3 @@ The legend-dataflow-hades package is licensed under the MIT "Expat" License:
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
> SOFTWARE.
>
Loading

0 comments on commit 9d76030

Please sign in to comment.