From 6970fc2868dd1e72e4432d9b79ab411227c48961 Mon Sep 17 00:00:00 2001 From: Chen Zhang Date: Fri, 31 Jan 2025 12:42:17 -0500 Subject: [PATCH 1/4] enable checks from v2.0 --- .github/workflows/unittest.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/unittest.yaml b/.github/workflows/unittest.yaml index 42c7775..694ada9 100644 --- a/.github/workflows/unittest.yaml +++ b/.github/workflows/unittest.yaml @@ -4,9 +4,11 @@ on: pull_request: branches: - main + - v2.0 push: branches: - main + - v2.0 jobs: test: From b5d3fc2cfacd6e00a2f1a289c8df61dabcecf370 Mon Sep 17 00:00:00 2001 From: Chen Zhang Date: Fri, 31 Jan 2025 13:00:22 -0500 Subject: [PATCH 2/4] add place holder modules for card not used now --- src/pleiades/sammy/parameters/background.py | 5 +++++ src/pleiades/sammy/parameters/det_efficiency.py | 5 +++++ src/pleiades/sammy/parameters/resolution.py | 5 +++++ .../unit/pleiades/sammy/parameters/test_background.py | 10 ++++++++++ .../pleiades/sammy/parameters/test_det_efficiency.py | 11 +++++++++++ .../unit/pleiades/sammy/parameters/test_resolution.py | 10 ++++++++++ 6 files changed, 46 insertions(+) create mode 100644 src/pleiades/sammy/parameters/background.py create mode 100644 src/pleiades/sammy/parameters/det_efficiency.py create mode 100644 src/pleiades/sammy/parameters/resolution.py create mode 100644 tests/unit/pleiades/sammy/parameters/test_background.py create mode 100644 tests/unit/pleiades/sammy/parameters/test_det_efficiency.py create mode 100644 tests/unit/pleiades/sammy/parameters/test_resolution.py diff --git a/src/pleiades/sammy/parameters/background.py b/src/pleiades/sammy/parameters/background.py new file mode 100644 index 0000000..3603cfa --- /dev/null +++ b/src/pleiades/sammy/parameters/background.py @@ -0,0 +1,5 @@ +#!/usr/bin/env python +"""Background function card for SAMMY. + +TODO: This card will be implemented in the future. +""" diff --git a/src/pleiades/sammy/parameters/det_efficiency.py b/src/pleiades/sammy/parameters/det_efficiency.py new file mode 100644 index 0000000..340a22f --- /dev/null +++ b/src/pleiades/sammy/parameters/det_efficiency.py @@ -0,0 +1,5 @@ +#!/usr/bin/env python +"""Detector efficiency function card for SAMMY. + +TODO: This card will be implemented in the future. +""" diff --git a/src/pleiades/sammy/parameters/resolution.py b/src/pleiades/sammy/parameters/resolution.py new file mode 100644 index 0000000..f5ae240 --- /dev/null +++ b/src/pleiades/sammy/parameters/resolution.py @@ -0,0 +1,5 @@ +#!/usr/bin/env python +"""Resolution function card for SAMMY. + +TODO: This module will be implemented in the future. +""" diff --git a/tests/unit/pleiades/sammy/parameters/test_background.py b/tests/unit/pleiades/sammy/parameters/test_background.py new file mode 100644 index 0000000..87ce152 --- /dev/null +++ b/tests/unit/pleiades/sammy/parameters/test_background.py @@ -0,0 +1,10 @@ +#!/usr/bin/env python +"""Tests for the background function card. + +TODO: This test will be implemented in the future when the card is implemented. +""" + +import pytest + +if __name__ == "__main__": + pytest.main(["-v", __file__]) diff --git a/tests/unit/pleiades/sammy/parameters/test_det_efficiency.py b/tests/unit/pleiades/sammy/parameters/test_det_efficiency.py new file mode 100644 index 0000000..169df0a --- /dev/null +++ b/tests/unit/pleiades/sammy/parameters/test_det_efficiency.py @@ -0,0 +1,11 @@ +#!/usr/bin/env python +"""Tests for the detector efficiency function card. + + +TODO: This test will be implemented in the future when the card is implemented. +""" + +import pytest + +if __name__ == "__main__": + pytest.main(["-v", __file__]) diff --git a/tests/unit/pleiades/sammy/parameters/test_resolution.py b/tests/unit/pleiades/sammy/parameters/test_resolution.py new file mode 100644 index 0000000..5ab40e9 --- /dev/null +++ b/tests/unit/pleiades/sammy/parameters/test_resolution.py @@ -0,0 +1,10 @@ +#!/usr/bin/env python +"""Tests for the resolution function card. + +TODO: This test will be implemented in the future when the card is implemented. +""" + +import pytest + +if __name__ == "__main__": + pytest.main(["-v", __file__]) From 8fe392e96955558a661eae22258beaaaa50a8df1 Mon Sep 17 00:00:00 2001 From: Chen Zhang Date: Fri, 31 Jan 2025 13:04:21 -0500 Subject: [PATCH 3/4] enable pre-commit --- .pre-commit-config.yaml | 2 +- README.rst | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e084f3e..4717b7f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,5 +24,5 @@ repos: rev: v2.3.0 hooks: - id: codespell - exclude: "(tests/data/.*|.*\\.ipynb)|poetry.lock" + exclude: "(tests/data/.*|.*\\.ipynb)|poetry.lock|src/pleiades/data/.*" args: ["--ignore-words-list=DELTE"] diff --git a/README.rst b/README.rst index 499672e..ff20585 100644 --- a/README.rst +++ b/README.rst @@ -1,9 +1,8 @@ -.. image:: ./docs/images/PLEIADES.jpg - :alt: **PLEIADES:** Python Libraries Extensions for Isotopic Analysis via Detailed Examination of SAMMY. - :align: center - PLEIADES ======== +.. image:: https://results.pre-commit.ci/badge/github/lanl/PLEIADES/main.svg + :target: https://results.pre-commit.ci/latest/github/lanl/PLEIADES/main + :alt: pre-commit.ci status .. image:: https://readthedocs.org/projects/example-sphinx-basic/badge/?version=latest :target: https://pleiades-sammy.readthedocs.io/en/latest/ From 2bda518033de9b4363a3e9dea9411fe5c6cb50ea Mon Sep 17 00:00:00 2001 From: Chen Zhang Date: Fri, 31 Jan 2025 14:41:14 -0500 Subject: [PATCH 4/4] adjust exclude pattern --- .pre-commit-config.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4717b7f..100b4f8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,20 +9,20 @@ repos: args: [--allow-multiple-documents] exclude: "conda.recipe/meta.yaml" - id: end-of-file-fixer - exclude: "tests/data/.*" + exclude: "(tests/data/.*|src/pleiades/data/.*)" - id: trailing-whitespace - exclude: "tests/data/.*" + exclude: "(tests/data/.*|src/pleiades/data/.*)" - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.7.3 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] - exclude: "(tests/data/.*|legacy/.*)" + exclude: "(tests/data/.*|legacy/.*|src/pleiades/data/.*)" - id: ruff-format - exclude: "(tests/data/.*|legacy/.*)" + exclude: "(tests/data/.*|legacy/.*|src/pleiades/data/.*)" - repo: https://github.com/codespell-project/codespell rev: v2.3.0 hooks: - id: codespell - exclude: "(tests/data/.*|.*\\.ipynb)|poetry.lock|src/pleiades/data/.*" + exclude: "(tests/data/.*|.*\\.ipynb|poetry.lock|src/pleiades/data/.*)" args: ["--ignore-words-list=DELTE"]