From 4d6b35417b4ef8deadfb444bad05e9dc5badd876 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Thu, 14 Dec 2023 01:31:41 +0100 Subject: [PATCH 1/6] follow several recommendations from https://learn.scientific-python.org/development/guides/repo-review --- .pre-commit-config.yaml | 2 +- .readthedocs.yaml | 2 +- pyproject.toml | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 37543f0..7dc6fbf 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,7 +8,7 @@ repos: - id: end-of-file-fixer - id: check-yaml - id: check-added-large-files -- repo: https://github.com/psf/black +- repo: https://github.com/psf/black-pre-commit-mirror rev: 22.12.0 hooks: - id: black diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 308400c..6ed1243 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -1,4 +1,4 @@ -version: "2" +version: 2 build: os: "ubuntu-22.04" diff --git a/pyproject.toml b/pyproject.toml index 7a4b674..c83a79a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -74,6 +74,12 @@ exclude = "giga_connectome/_version.py" line_length = 79 [tool.pytest.ini_options] +minversion = "7" +testpaths = ["giga_connectome/tests"] +log_cli_level = "INFO" +xfail_strict = true +addopts = ["-ra", "--strict-config", "--strict-markers"] markers = [ "smoke: smoke tests that will run on a downsampled real dataset (deselect with '-m \"not smoke\"')", ] +filterwarnings = ["error"] From 24d26eaf042da8c0dc883fa36cf8267d98f65967 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Thu, 14 Dec 2023 02:15:06 +0100 Subject: [PATCH 2/6] fix --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index c83a79a..4b7a692 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -75,7 +75,6 @@ line_length = 79 [tool.pytest.ini_options] minversion = "7" -testpaths = ["giga_connectome/tests"] log_cli_level = "INFO" xfail_strict = true addopts = ["-ra", "--strict-config", "--strict-markers"] From 7caa2b75148bca091782b87ae65dd4f8070de01d Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Fri, 15 Dec 2023 14:04:48 +0100 Subject: [PATCH 3/6] fix --- .github/workflows/test.yml | 4 ++-- pyproject.toml | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 89127bc..3e48ba8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -158,11 +158,11 @@ jobs: - name: Test with pytest - ignore smoke test. if: ${{ !contains(needs.check_skip_flags.outputs.head-commit-message, 'full_test') }} run: | - pytest -m "not smoke" --cov=giga_connectome --cov-report=xml --doctest-modules -v --pyargs giga_connectome + pytest -m "not smoke" --cov=giga_connectome --cov-report=xml --pyargs giga_connectome - name: Full test - run all the test to generate accurate coverage report. if: ${{ contains(needs.check_skip_flags.outputs.head-commit-message, 'full_test') }} || ${{ github.event.pull_request.merged }} - run: pytest --cov=giga_connectome --cov-report=xml --doctest-modules -v --pyargs giga_connectome + run: pytest --cov=giga_connectome --cov-report=xml --pyargs giga_connectome - uses: codecov/codecov-action@v3 if: ${{ always() }} diff --git a/pyproject.toml b/pyproject.toml index 4b7a692..94a8213 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -77,8 +77,9 @@ line_length = 79 minversion = "7" log_cli_level = "INFO" xfail_strict = true -addopts = ["-ra", "--strict-config", "--strict-markers"] +testpaths = ["giga_connectome/tests"] +addopts = ["-ra", "--strict-config", "--strict-markers", "--doctest-modules", "-v"] markers = [ "smoke: smoke tests that will run on a downsampled real dataset (deselect with '-m \"not smoke\"')", ] -filterwarnings = ["error"] +# filterwarnings = ["error"] From 31d2f670c78eee94eb0a016636930588b21106c4 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Fri, 15 Dec 2023 14:06:32 +0100 Subject: [PATCH 4/6] pre-commit --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4c178b5..7b9c9b4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,7 +8,7 @@ repos: - id: end-of-file-fixer - id: check-yaml - id: check-added-large-files -- repo: https://github.com/psf/black-pre-commit-mirror +- repo: https://github.com/psf/black-pre-commit-mirror rev: 22.12.0 hooks: - id: black From 0ff8534c8d15014b1d7cefa8eb4c426e9d96ca8d Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Fri, 15 Dec 2023 14:12:28 +0100 Subject: [PATCH 5/6] do not index deivatives --- giga_connectome/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/giga_connectome/utils.py b/giga_connectome/utils.py index e439172..04250d5 100644 --- a/giga_connectome/utils.py +++ b/giga_connectome/utils.py @@ -26,7 +26,7 @@ def get_bids_images( root=bids_dir, database_path=bids_dir, validate=False, - derivatives=True, + derivatives=False, reset_database=reindex_bids, ) From 934e503c9f6cee9acfd4d83eddb24d0b53172f4c Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Mon, 8 Jan 2024 18:34:25 +0100 Subject: [PATCH 6/6] lint --- giga_connectome/methods.py | 1 - 1 file changed, 1 deletion(-) diff --git a/giga_connectome/methods.py b/giga_connectome/methods.py index 10cf984..85150fc 100644 --- a/giga_connectome/methods.py +++ b/giga_connectome/methods.py @@ -20,7 +20,6 @@ def generate_method_section( average_correlation: bool, analysis_level: bool, ) -> None: - env = Environment( loader=FileSystemLoader(Path(__file__).parent), autoescape=select_autoescape(),