Skip to content
Snippets Groups Projects
Commit bb828de9 authored by Daniel CARRON's avatar Daniel CARRON :b:
Browse files

[doc] Disable docstring summary wrapping with docformatter

parent 3c726c55
No related branches found
No related tags found
1 merge request!15Update documentation
Pipeline #83880 failed
Showing
with 18 additions and 31 deletions
......@@ -18,6 +18,9 @@ repos:
rev: v1.7.5
hooks:
- id: docformatter
args: [
--wrap-summaries=0,
]
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
......
# Copyright © 2022 Idiap Research Institute <contact@idiap.ch>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Aggregated DataModule composed of Montgomery, Shenzhen and Indian
datasets."""
"""Aggregated DataModule composed of Montgomery, Shenzhen and Indian datasets."""
from ....data.datamodule import ConcatDataModule
from ..indian.datamodule import RawDataLoader as IndianLoader
......@@ -14,8 +13,7 @@ from ..shenzhen.datamodule import make_split as make_shenzhen_split
class DataModule(ConcatDataModule):
"""Aggregated DataModule composed of Montgomery, Shenzhen and Indian
datasets.
"""Aggregated DataModule composed of Montgomery, Shenzhen and Indian datasets.
Parameters
----------
......
# Copyright © 2022 Idiap Research Institute <contact@idiap.ch>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Aggregated DataModule composed of Montgomery, Shenzhen, Indian, and PadChest
datasets."""
"""Aggregated DataModule composed of Montgomery, Shenzhen, Indian, and PadChest datasets."""
from ....data.datamodule import ConcatDataModule
from ..indian.datamodule import RawDataLoader as IndianLoader
......
# Copyright © 2022 Idiap Research Institute <contact@idiap.ch>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Aggregated dataset composed of Montgomery, Shenzhen, Indian and Padchest
datasets."""
"""Aggregated dataset composed of Montgomery, Shenzhen, Indian and Padchest datasets."""
from mednet.config.data.montgomery_shenzhen_indian_padchest.datamodule import (
DataModule,
......
# Copyright © 2022 Idiap Research Institute <contact@idiap.ch>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Aggregated DataModule composed of Montgomery, Shenzhen, Indian, and TBX11k
datasets."""
"""Aggregated DataModule composed of Montgomery, Shenzhen, Indian, and TBX11k datasets."""
from ....data.datamodule import ConcatDataModule
from ..indian.datamodule import RawDataLoader as IndianLoader
......
# SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Aggregated dataset composed of NIH CXR14 relabeld and PadChest (normalized)
datasets (no-tb-idiap split)."""
"""Aggregated dataset composed of NIH CXR14 relabeld and PadChest (normalized) datasets (no-tb-idiap split)."""
from mednet.config.data.nih_cxr14_padchest.datamodule import DataModule
......
......@@ -119,8 +119,7 @@ class BoundingBoxes(collections.abc.Sequence[BoundingBox]):
# explained at:
# https://pytorch.org/docs/stable/data.html#torch.utils.data.default_collate
def _collate_boundingboxes_fn(batch, *, collate_fn_map=None):
"""Custom collate_fn() for pytorch dataloaders that ignores BoundingBoxes
objects."""
"""Custom collate_fn() for pytorch dataloaders that ignores BoundingBoxes objects."""
return batch
......
......@@ -21,8 +21,7 @@ SupportedPytorchDevice: typing.TypeAlias = typing.Literal[
def _split_int_list(s: str) -> list[int]:
"""Split a list of integers encoded in a string (e.g. "1,2,3") into a
Python list of integers (e.g. ``[1, 2, 3]``)."""
"""Split a list of integers encoded in a string (e.g. "1,2,3") into a Python list of integers (e.g. ``[1, 2, 3]``)."""
return [int(k.strip()) for k in s.split(",")]
......
......@@ -95,8 +95,7 @@ def rgb_to_grayscale(img: torch.Tensor) -> torch.Tensor:
class RGB(torch.nn.Module):
"""Wrapper class around :py:func:`.grayscale_to_rgb` to be used as a model
transform."""
"""Wrapper class around :py:func:`.grayscale_to_rgb` to be used as a model transform."""
def __init__(self):
super().__init__()
......@@ -106,8 +105,7 @@ class RGB(torch.nn.Module):
class Grayscale(torch.nn.Module):
"""Wrapper class around :py:func:`rgb_to_grayscale` to be used as a model
transform."""
"""Wrapper class around :py:func:`rgb_to_grayscale` to be used as a model transform."""
def __init__(self):
super().__init__()
......
......@@ -8,9 +8,7 @@ from clapper.click import ConfigCommand as _BaseConfigCommand
class ConfigCommand(_BaseConfigCommand):
"""A click command-class that has the properties of
:py:class:`clapper.click.ConfigCommand` and adds verbatim epilog
formatting."""
"""A click command-class that has the properties of :py:class:`clapper.click.ConfigCommand` and adds verbatim epilog formatting."""
def format_epilog(
self, _: click.core.Context, formatter: click.formatting.HelpFormatter
......
......@@ -125,8 +125,7 @@ def predict(
parallel,
**_,
) -> None:
"""Run inference (generates scores) on all input images, using a pre-
trained model."""
"""Run inference (generates scores) on all input images, using a pre-trained model."""
import json
import shutil
......
......@@ -134,8 +134,7 @@ def train_analysis(
logdir: pathlib.Path,
output: pathlib.Path,
) -> None:
"""Create a plot for each metric in the training logs and saves them in a
.pdf file."""
"""Create a plot for each metric in the training logs and saves them in a .pdf file."""
import matplotlib.pyplot as plt
......
......@@ -582,8 +582,7 @@ class ResourceMonitor:
self.data[k] = 0.0
def __exit__(self, *_) -> None:
"""Stop the monitoring process and returns the summary of
observations."""
"""Stop the monitoring process and returns the summary of observations."""
self.stop_event.set()
self.monitor.join()
......
......@@ -76,8 +76,7 @@ def temporary_basedir(tmp_path_factory):
def pytest_sessionstart(session: pytest.Session) -> None:
"""Preset the session start to ensure the Montgomery dataset is always
available."""
"""Preset the session start to ensure the Montgomery dataset is always available."""
from mednet.utils.rc import load_rc
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment