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