diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fa1d912..568663a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -21,24 +21,24 @@ repos: args: [--mapping, '4', --sequence, '4', --offset, '0'] - repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks - rev: v2.15.0 + rev: v2.16.0 hooks: - id: pretty-format-toml args: [--autofix, --indent, '4'] - repo: https://github.com/asottile/pyupgrade - rev: v3.21.1 + rev: v3.21.2 hooks: - id: pyupgrade args: [--py38-plus] - repo: https://github.com/seddonym/import-linter - rev: v2.6 + rev: v2.10 hooks: - id: import-linter - repo: https://github.com/pycqa/isort - rev: 7.0.0 + rev: 8.0.0 hooks: - id: isort args: [--settings-path, pyproject.toml] @@ -51,13 +51,13 @@ repos: - black==24.2.0 - repo: https://github.com/psf/black-pre-commit-mirror - rev: 25.11.0 + rev: 26.1.0 hooks: - id: black args: [--config=pyproject.toml] - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.18.2 + rev: v1.19.1 hooks: - id: mypy additional_dependencies: [pydantic, numpy, types-Jinja2] diff --git a/bidsmreye/bidsmreye.py b/bidsmreye/bidsmreye.py index e013ccd..0690d57 100755 --- a/bidsmreye/bidsmreye.py +++ b/bidsmreye/bidsmreye.py @@ -1,5 +1,6 @@ #!/usr/bin/env python """Main script.""" + from __future__ import annotations import json diff --git a/bidsmreye/configuration.py b/bidsmreye/configuration.py index 9dee2a4..3f44ce7 100644 --- a/bidsmreye/configuration.py +++ b/bidsmreye/configuration.py @@ -35,11 +35,9 @@ def _check_input_dir(self, attribute: str, value: Path) -> None: ) if not (value / "dataset_description.json").is_file(): - raise ValueError( - f"""input_dir does not seem to be a valid BIDS dataset. + raise ValueError(f"""input_dir does not seem to be a valid BIDS dataset. No dataset_description.json found: -\t{value.absolute()}.""" - ) +\t{value.absolute()}.""") output_dir: Path = field(default=None, converter=Path) diff --git a/bidsmreye/generalize.py b/bidsmreye/generalize.py index 12bb625..0eae7e2 100644 --- a/bidsmreye/generalize.py +++ b/bidsmreye/generalize.py @@ -227,7 +227,7 @@ def process_subject(cfg: Config, layout_out: BIDSLayout, subject_label: str) -> opts = model_opts.get_opts() - (_, model_inference) = train.train_model( + _, model_inference = train.train_model( dataset="example_data", generators=generators, opts=opts, @@ -241,7 +241,7 @@ def process_subject(cfg: Config, layout_out: BIDSLayout, subject_label: str) -> elif log.isEnabledFor(logging.INFO): verbose = 1 - (_, _) = train.evaluate_model( + _, _ = train.evaluate_model( dataset="tmp", model=model_inference, generators=generators, diff --git a/bidsmreye/visualize.py b/bidsmreye/visualize.py index 6736d3e..23797ca 100644 --- a/bidsmreye/visualize.py +++ b/bidsmreye/visualize.py @@ -89,10 +89,8 @@ def collect_group_qc_data(cfg: Config) -> pd.DataFrame | None: try: qc_data = qc_data[cols] except KeyError: - log.error( - f"""Sidecar files seem to be missing the keys: {cols}. - To fix try to run the qc at the participant level first.""" - ) + log.error(f"""Sidecar files seem to be missing the keys: {cols}. + To fix try to run the qc at the participant level first.""") return None return qc_data