Skip to content

Commit 337904e

Browse files
committed
pre-commit
1 parent af60a9a commit 337904e

14 files changed

Lines changed: 73 additions & 55 deletions

docs/advanced/cardio-analysis.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Useful options:
3434

3535
<figure markdown="span">
3636
![Cardio-analysis GUI](../assets/images/analyse_GUI_advanced.png){ width="70%" }
37-
<figcaption>Main GUI for profile definition and plotting.
37+
<figcaption>Main GUI for profile definition and plotting.
3838
</figcaption>
3939
</figure>
4040

docs/advanced/slurm-launcher.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@ cardio-tensor-slurm -h
5050

5151
## Troubleshooting
5252

53-
- **`sbatch` fails**
53+
- **`sbatch` fails**
5454
Verify partition/account/time/memory policy on your cluster.
5555

56-
- **Job fails before running `cardio-tensor`**
56+
- **Job fails before running `cardio-tensor`**
5757
Check logs in `OUTPUT_PATH/slurm/log/`.
5858

59-
- **No progress in monitor**
59+
- **No progress in monitor**
6060
Confirm output folder permissions and that tasks can write outputs.
6161

62-
- **Want to debug without submitting jobs**
62+
- **Want to debug without submitting jobs**
6363
Use `--dry_run`.

docs/advanced/streamlines.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ Use this page to generate and inspect 3D streamlines with:
1616

1717
!!! note
1818

19-
It is usefull to provide a `MASK_PATH` to avoid placing seeds and tracing streamline outside the sample, even though the FA threshold should avoid this.
19+
It is useful to provide a `MASK_PATH` to avoid placing seeds and tracing streamline outside the sample, even though the FA threshold should avoid this.
2020

2121

2222
## Generate Streamlines
2323

2424
Basic example:
2525

2626
```console
27-
$ cardio-generate-streamlines ./parameters_example.conf
27+
$ cardio-generate-streamlines ./parameters_example.conf
2828
```
2929

3030
Useful options:

pyproject.toml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,23 +50,22 @@ version = "1.1.7"
5050

5151
[project.optional-dependencies]
5252
cupy = ["cupy>=8"]
53-
docs = [
54-
"mkdocs<2",
55-
"mkdocs-material",
56-
"mkdocs-autorefs",
57-
"mkdocs-section-index",
58-
"mkdocs-git-revision-date-localized-plugin",
59-
"mkdocstrings[python]",
60-
"pymdown-extensions",
61-
]
62-
6353
dev = [
6454
"black",
6555
"pre-commit",
6656
"pytest",
6757
"pytest-cov",
6858
"ruff",
6959
]
60+
docs = [
61+
"mkdocs-autorefs",
62+
"mkdocs-git-revision-date-localized-plugin",
63+
"mkdocs-material",
64+
"mkdocs-section-index",
65+
"mkdocs<2",
66+
"mkdocstrings[python]",
67+
"pymdown-extensions",
68+
]
7069
git = [
7170
"mkdocs-git-committers-plugin-2>=1.1,<3",
7271
"mkdocs-git-revision-date-localized-plugin~=1.2,>=1.2.4",
@@ -116,9 +115,9 @@ testpaths = [
116115
]
117116

118117
[tool.ruff]
119-
target-version = "py312"
120118
fix = true
121119
force-exclude = true
120+
target-version = "py312"
122121
lint.select = ["F", "I", "UP"]
123122
lint.mccabe.max-complexity = 10
124123
lint.pep8-naming.classmethod-decorators = ["classmethod", "pydantic.validator"]

src/cardiotensor/analysis/gui_analysis_tool.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
import cv2
55
import matplotlib.pyplot as plt
66
import numpy as np
7-
from PyQt5.QtCore import Qt
87
from matplotlib.colors import Colormap
8+
from PyQt5.QtCore import Qt
99
from PyQt5.QtGui import (
1010
QBrush,
1111
QColor,

src/cardiotensor/orientation/orientation_computation_functions.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@
99
from structure_tensor.multiprocessing import parallel_structure_tensor_analysis
1010
from tqdm import tqdm
1111

12-
from cardiotensor.utils.utils import convert_to_8bit
13-
1412
from cardiotensor.colormaps.helix_angle import helix_angle_cmap
13+
from cardiotensor.utils.utils import convert_to_8bit
1514

1615

1716
def interpolate_points(
@@ -578,9 +577,7 @@ def plot_images(
578577
colormap_FA = plt.cm.magma
579578

580579
if vector_field_slice is not None and vector_field_slice.shape[1:] != img.shape:
581-
raise ValueError(
582-
"vector_field_slice shape must match the source image shape"
583-
)
580+
raise ValueError("vector_field_slice shape must match the source image shape")
584581
if overlay_scalar_map is not None and overlay_scalar_map.shape != img.shape:
585582
raise ValueError("overlay_scalar_map shape must match the source image shape")
586583

@@ -635,8 +632,6 @@ def plot_images(
635632
plt.close(fig)
636633

637634

638-
639-
640635
def write_img_rgb(
641636
img: np.ndarray,
642637
out_path: str,

src/cardiotensor/scripts/compute_orientation.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,7 @@ def script() -> None:
106106
# --- Test Mode ---
107107
if is_test:
108108
if n_slice_test is None:
109-
print(
110-
"❌ Test mode requires N_SLICE_TEST in the configuration file."
111-
)
109+
print("❌ Test mode requires N_SLICE_TEST in the configuration file.")
112110
sys.exit(1)
113111
if force_test and not params.get("TEST", False):
114112
print("⚙️ TEST mode forced from CLI (--test)")

src/cardiotensor/utils/DataReader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
from typing import Any
66

77
import cv2
8-
from dask import compute, delayed
98
import glymur
109
import numpy as np
1110
import psutil
1211
import SimpleITK as sitk
1312
import tifffile as tiff
1413
from alive_progress import alive_bar
14+
from dask import compute, delayed
1515
from skimage.measure import block_reduce
1616

1717

src/cardiotensor/utils/downsampling.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,10 +341,10 @@ def downsample_volume(
341341
if not tasks:
342342
print(f"✔️ All downsampled blocks already exist for '{subfolder}'. Skipping.")
343343
return
344-
344+
345345
if sys.platform.startswith("win"):
346346
cpu_count = min(mp.cpu_count(), 59)
347-
else:
347+
else:
348348
cpu_count = mp.cpu_count()
349349

350350
with mp.Pool(processes=cpu_count) as pool:

src/cardiotensor/visualization/fury_plotting_streamlines.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,9 @@ def __init__(
169169
self.bounds = [mins[0], maxs[0], mins[1], maxs[1], mins[2], maxs[2]]
170170

171171
self._build_pipeline()
172-
172+
173173
# self._add_origin_marker()
174-
174+
175175
self._add_scalar_bar()
176176

177177
def _build_pipeline(self):
@@ -199,7 +199,6 @@ def _build_pipeline(self):
199199
self.scene.add(self.actor0)
200200
self._style_streamline_actor()
201201

202-
203202
# fast actor for interaction (cheap line rendering)
204203
self.actor_fast = actor.line(
205204
self.streamlines_xyz,
@@ -359,7 +358,6 @@ def _rebuild_unclipped_actor(self):
359358
self.scene.add(self.actor0)
360359
self._style_streamline_actor()
361360

362-
363361
self.mapper0 = self.actor0.GetMapper()
364362
if clipping_on:
365363
self.mapper0.RemoveAllClippingPlanes()
@@ -537,12 +535,11 @@ def run(self, interactive: bool, screenshot_path: str | None):
537535
self.showm.iren.AddObserver("KeyPressEvent", self._on_keypress)
538536

539537
self.scene.reset_camera()
540-
538+
541539
self.scene.azimuth(15)
542540
self.scene.elevation(10)
543541
self.scene.zoom(1.1)
544542

545-
546543
print(
547544
"Keys: O toggle plane, H hide gizmo, I flip side, R reset plane, +/- thickness, B background, S scale bar, P save PNG"
548545
)
@@ -648,7 +645,7 @@ def show_streamlines(
648645
f"{std_points_per_streamline:.1f} "
649646
"(more points usually means more detail, but heavier rendering)."
650647
)
651-
648+
652649
if not color_values:
653650
raise ValueError("No color arrays after filtering.")
654651

0 commit comments

Comments
 (0)