Skip to content

Commit f9264af

Browse files
dkueglerm-reuter
authored andcommitted
Minor fixes to the documentation and formatting.
Renaming api files and directory to be consistently using dots as submodule separators (instead of somethimes dots sometimes underscores). Fix Errors due to bad escape sequences.
1 parent 663c6df commit f9264af

File tree

12 files changed

+19
-20
lines changed

12 files changed

+19
-20
lines changed

CerebNet/data_loader/augmentation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ def __init__(
206206
AUGMENTATION.BIAS_FIELD_COEFFICIENTS
207207
Magnitude :math:`n` of polynomial coefficients.
208208
If a tuple :math:`(a, b)` is specified, then
209-
:math:`n \sim \mathcal{U}(a, b)`.
209+
:math:`n \\sim \\mathcal{U}(a, b)`.
210210
AUGMENTATION.BIAS_FIELD_ORDER
211211
Order of the basis polynomial functions.
212212
AUGMENTATION.PROB

CerebNet/datasets/utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -362,10 +362,10 @@ def read_lta(file: Path | str) -> LTADict:
362362
from functools import partial
363363

364364
import numpy as np
365-
parameter_pattern = re.compile("^\s*([^=]+)\s*=\s*([^#]*)\s*(#.*)")
365+
parameter_pattern = re.compile("^\\s*([^=]+)\\s*=\\s*([^#]*)\\s*(#.*)")
366366
vol_info_pattern = re.compile("^(.*) volume info$")
367-
shape_pattern = re.compile("^(\s*\d+)+$")
368-
matrix_pattern = re.compile("^(-?\d+\.\S+\s+)+$")
367+
shape_pattern = re.compile("^(\\s*\\d+)+$")
368+
matrix_pattern = re.compile("^(-?\\d+\\.\\S+\\s+)+$")
369369

370370
_Type = TypeVar("_Type", bound=type)
371371

FastSurferCNN/segstats.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ def make_arguments(helpformatter: bool = False) -> argparse.ArgumentParser:
316316
help="Keep ids for the table that do not exist in the segmentation "
317317
"(default: drop).",
318318
)
319-
advanced = add_arguments(advanced, ["device", "sid", "sd"])
319+
add_arguments(advanced, ["device", "sid", "sd"])
320320
advanced.add_argument(
321321
"--lut",
322322
type=Path,
@@ -538,7 +538,7 @@ def _check_arg_path(
538538
------
539539
ValueError
540540
If attribute does not exist, is not a Path (or convertible to a Path), or if
541-
the file does not exist, but reuire_exist is True.
541+
the file does not exist, but `require_exist` is True.
542542
"""
543543
if (_attr_val := getattr(__args, __attr), None) is None:
544544
raise ValueError(f"No {__attr} passed.")
@@ -601,8 +601,7 @@ def check_shape_affine(
601601
"""
602602
if img1.shape != img2.shape or not np.allclose(img1.affine, img2.affine):
603603
raise RuntimeError(
604-
f"The shapes or affines of the {name1} and the {name2} image are not "
605-
f"similar, both must be the same!"
604+
f"The shapes or affines of the {name1} and the {name2} image are not similar, both must be the same!"
606605
)
607606

608607

@@ -689,8 +688,7 @@ def infer_labels_excludeid(
689688
data: "npt.NDArray[int]",
690689
) -> tuple["npt.NDArray[int]", list[int]]:
691690
"""
692-
Infer the labels and excluded ids from command line arguments, the lookup table, or
693-
the segmentation image.
691+
Infer the labels and excluded ids from command line arguments, the lookup table, or the segmentation image.
694692
695693
Parameters
696694
----------
@@ -1385,7 +1383,7 @@ def _table_body(file: IO, _dataframe: pd.DataFrame) -> None:
13851383

13861384
def read_statsfile(path: Path) -> tuple[dict[str, MeasureTuple | str], pd.DataFrame]:
13871385
"""
1388-
Read the stats table of a stats file. The file must have columns (')
1386+
Read the stats table of a stats file.
13891387
13901388
Parameters
13911389
----------

FastSurferCNN/utils/parser_defaults.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@
4343
from FastSurferCNN.utils.dataclasses import field, get_field
4444
from FastSurferCNN.utils.parallel import get_num_threads, set_num_threads
4545

46+
T_AddArgs = TypeVar("T_AddArgs", bound="CanAddArguments")
47+
48+
4649
FASTSURFER_ROOT = Path(__file__).parents[2]
4750
PLANE_SHORT = {"checkpoint": "ckpt", "config": "cfg"}
4851
PLANE_HELP = {
@@ -353,8 +356,6 @@ class SubjectDirectoryConfig:
353356
),
354357
}
355358

356-
T_AddArgs = TypeVar("T_AddArgs", bound=CanAddArguments)
357-
358359

359360
def add_arguments(parser: T_AddArgs, flags: Iterable[str]) -> T_AddArgs:
360361
"""
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)