Visitar URL original
Documentation: format docstrings for dev docs by C-Achard · Pull Request #3353 · DeepLabCut/DeepLabCut · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
867de4c
Add mdformat hook and update docs scan/exclude
C-Achard Jun 1, 2026
0937706
Use NumPy docstring style and widen line length
C-Achard Jun 1, 2026
1a8d3cf
Format all docstrings
C-Achard Jun 1, 2026
c99aa9d
Format all docs
C-Achard Jun 1, 2026
6125126
Add dev-docs to mdformat
C-Achard Jun 1, 2026
4f32679
Disable mdformat pre-commit hook (broken)
C-Achard Jun 1, 2026
84466b0
Revert "Format all docs"
C-Achard Jun 1, 2026
794619b
use google-style docstrings + remove numpydoc
deruyter92 Jun 2, 2026
640deb2
apply ruff safe fixes all docstrings
deruyter92 Jun 2, 2026
2078850
docs: convert docstrings to Google style (batch A1)
deruyter92 Jun 3, 2026
d59328d
docs: convert docstrings to Google style (batch A2)
deruyter92 Jun 3, 2026
00425f4
docs: convert docstrings to Google style (batch A3)
deruyter92 Jun 3, 2026
0998f8e
docs: convert docstrings to Google style (batch A4)
deruyter92 Jun 3, 2026
944a561
docs: convert docstrings to Google style (batch A5)
deruyter92 Jun 3, 2026
1e33ab0
docs: convert docstrings to Google style (batch B1)
deruyter92 Jun 3, 2026
aede4c4
docs: convert docstrings to Google style (batch B2)
deruyter92 Jun 3, 2026
fd68cb0
docs: convert docstrings to Google style (batch B3)
deruyter92 Jun 3, 2026
741eb42
docs: convert docstrings to Google style (batch B4)
deruyter92 Jun 3, 2026
c046c73
docs: convert docstrings to Google style (batch B5)
deruyter92 Jun 3, 2026
1a50d1c
docs: convert docstrings to Google style (batch B6)
deruyter92 Jun 3, 2026
75046ae
docs: fix existing malformed Google style docstrings (batch C)
deruyter92 Jun 3, 2026
e589365
docs: fix existing outdated Google style docstrings (batch D)
deruyter92 Jun 3, 2026
2580c8b
doc: google docstyle fixes (audit)
deruyter92 Jun 3, 2026
c6d0a46
docs: fix examples in docstrings
deruyter92 Jun 4, 2026
dd04239
Docs: fix cli Args (was Options)
deruyter92 Jun 4, 2026
47a7485
docs: fix docstring exceptions (Raises) prose -> structured
deruyter92 Jun 4, 2026
30a2e36
docs: fix missing function descriptions in docstrings
deruyter92 Jun 4, 2026
4cbef89
docs: fix DLCLoader to_coco docstring
deruyter92 Jun 4, 2026
c949ffc
docs: manually fix incorrect args in docstrings (using griffe)
deruyter92 Jun 4, 2026
0c74661
apply suggestion: adjust comment in modelzoo.py
deruyter92 Jun 5, 2026
4fe31c5
Normalize parameter names in docstrings
C-Achard Jun 9, 2026
3b7e671
Convert doctest examples to plain code
C-Achard Jun 10, 2026
de886e7
Rename videotype to video_extensions and fix docs
C-Achard Jun 10, 2026
583170a
Update analyze_skeleton.py
C-Achard Jun 10, 2026
4eba8c3
Merge remote-tracking branch 'origin/arash/dev_docs' into cy/dev-docs…
C-Achard Jun 10, 2026
7ea3890
Fix pre-commit failures
C-Achard Jun 10, 2026
10f9644
Update uv.lock
C-Achard Jun 10, 2026
2e69e69
auto-detect URLs
deruyter92 Jun 11, 2026
a3871b6
Fix docstrings (examples) in core and create_project
deruyter92 Jun 11, 2026
9887acd
fix docstrings (mostly examples)
deruyter92 Jun 11, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
docs: fix missing function descriptions in docstrings
  • Loading branch information
deruyter92 committed Jun 4, 2026
commit 30a2e3668bf67a2d2c5bb6a7a70af68bad6b46f2
6 changes: 4 additions & 2 deletions deeplabcut/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@


def get_project_engine(cfg: dict) -> Engine:
"""
"""Get the project engine.

Args:
cfg: the project configuration file

Expand All @@ -40,7 +41,8 @@ def get_project_engine(cfg: dict) -> Engine:


def get_available_aug_methods(engine: Engine) -> tuple[str, ...]:
"""
"""Get the available aug methods.

Args:
engine: the engine for which augmentation methods should be returned

Expand Down
3 changes: 2 additions & 1 deletion deeplabcut/core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@


def read_config_as_dict(config_path: str | Path) -> dict:
"""
"""Read config as dict.

Args:
config_path: the path to the configuration file to load

Expand Down
3 changes: 2 additions & 1 deletion deeplabcut/generate_training_dataset/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,8 @@ def get_shuffle_engine(
shuffle: int,
modelprefix: str = "",
) -> Engine:
"""
"""Get the shuffle engine.

Args:
cfg: the config for the DeepLabCut project
trainingsetindex: the training set index used
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1338,7 +1338,8 @@ def get_existing_shuffle_indices(
train_fraction: float | None = None,
engine: Engine | None = None,
) -> list[int]:
"""
"""Get the existing shuffle indices.

Args:
cfg: The content of a project configuration file, or the path to the project
configuration file.
Expand Down
3 changes: 2 additions & 1 deletion deeplabcut/modelzoo/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ def get_super_animal_scorer(
detector_snapshot_path: Path | str | None,
torchvision_detector_name: str | None = None,
) -> str:
"""
"""Get the super animal scorer.

Args:
super_animal: The SuperAnimal dataset on which the models were trained
model_snapshot_path: The path for the SuperAnimal pose model snapshot
Expand Down
6 changes: 4 additions & 2 deletions deeplabcut/pose_estimation_pytorch/apis/evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ def evaluate(
pcutoff: float | list[float] = 0.6,
force_multi_animal: bool = False,
) -> tuple[dict[str, float], dict[str, dict[str, np.ndarray]]]:
"""
"""Evaluate.

Args:
pose_runner: The runner for pose estimation
loader: The loader containing the data to evaluate
Expand Down Expand Up @@ -815,7 +816,8 @@ def evaluate_network(


def image_to_dlc_df_index(image: str) -> tuple[str, ...]:
"""
"""Image to dlc df index.

Args:
image: the path of the image to map to a DLC index

Expand Down
6 changes: 4 additions & 2 deletions deeplabcut/pose_estimation_pytorch/apis/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ def export_model(


def get_export_folder_name(loader: dlc3_data.DLCLoader) -> str:
"""
"""Get the export folder name.

Args:
loader: The loader for the shuffle for which we want to export models.

Expand All @@ -158,7 +159,8 @@ def get_export_filename(
snapshot: Snapshot,
detector_snapshot: Snapshot | None = None,
) -> str:
"""
"""Get the export filename.

Args:
loader: The loader for the shuffle for which we want to export models.
snapshot: The pose model snapshot to export.
Expand Down
9 changes: 6 additions & 3 deletions deeplabcut/pose_estimation_pytorch/apis/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ def parse_snapshot_index_for_analysis(
def return_train_network_path(
config: str, shuffle: int = 1, trainingsetindex: int = 0, modelprefix: str = ""
) -> tuple[Path, Path, Path]:
"""
"""Return the train network path.

Args:
config: Full path of the config.yaml file as a string.
shuffle: The shuffle index to select for training
Expand Down Expand Up @@ -160,7 +161,8 @@ def get_model_snapshots(
task: Task,
snapshot_filter: list[str] | None = None,
) -> list[Snapshot]:
"""
"""Get the model snapshots.

Args:
index: Passing an index returns the snapshot with that index (where snapshots
based on their number of training epochs, and the last snapshot is the
Expand Down Expand Up @@ -216,7 +218,8 @@ def get_model_snapshots(


def get_scorer_uid(snapshot: Snapshot, detector_snapshot: Snapshot | None) -> str:
"""
"""Get the scorer uid.

Args:
snapshot: the snapshot for which to get the scorer UID
detector_snapshot: if a top-down model is used with a detector, the detector
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,8 @@ def make_pytorch_pose_config(


def _add_ctd_conditions(model_cfg: dict, ctd_conditions: int | str | Path | tuple[int, str] | tuple[int, int]):
"""
"""Add ctd conditions.

Args:
model_cfg: dict, contents of pytorch_config.yaml
ctd_conditions: Only for using conditional-top-down (CTD) models. It defines
Expand Down
6 changes: 4 additions & 2 deletions deeplabcut/pose_estimation_pytorch/config/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,8 @@ def load_base_config(config_folder_path: Path) -> dict:


def load_backbones(configs_dir: Path) -> list[str]:
"""
"""Load backbones.

Args:
configs_dir: the Path to the folder containing the "configs" for PyTorch
DeepLabCut
Expand All @@ -215,7 +216,8 @@ def load_backbones(configs_dir: Path) -> list[str]:


def load_detectors(configs_dir: Path) -> list[str]:
"""
"""Load detectors.

Args:
configs_dir: the Path to the folder containing the "configs" for PyTorch
DeepLabCut
Expand Down
3 changes: 2 additions & 1 deletion deeplabcut/pose_estimation_pytorch/data/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,8 @@ def _extract_keypoints_and_bboxes(
num_joints: int,
num_unique_bodyparts: int,
) -> tuple[np.ndarray, np.ndarray, np.ndarray, dict[str, np.ndarray]]:
"""
"""Extract keypoints and bboxes.

Args:
anns: COCO-style annotations
image_shape: the (h, w, c) shape of the image for which to get annotations
Expand Down
15 changes: 8 additions & 7 deletions deeplabcut/pose_estimation_pytorch/models/heads/dekr.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,13 +225,14 @@ def __init__(
final_conv_kernel: int,
block: type(BaseBlock) = AdaptBlock,
) -> None:
"""Args:
channels: tuple containing the number of input, offset, and output channels.
num_offset_per_kpt: number of offset values per keypoint.
num_blocks: number of blocks in the head.
dilation_rate: dilation rate for convolutional layers.
final_conv_kernel: kernel size for the final convolution.
block: type of block to use in the head. Defaults to AdaptBlock.
"""
Args:
channels: tuple containing the number of input, offset, and output channels.
num_offset_per_kpt: number of offset values per keypoint.
num_blocks: number of blocks in the head.
dilation_rate: dilation rate for convolutional layers.
final_conv_kernel: kernel size for the final convolution.
block: type of block to use in the head. Defaults to AdaptBlock.
"""
super().__init__()
self.inp_channels = channels[0]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@


def assign_identity(predictions: np.ndarray, identity_scores: np.ndarray) -> np.ndarray:
"""
"""Assign identity.

Args:
predictions: Pose predictions for an image, with shape (num_individuals,
num_bodyparts, 3)
Expand Down
3 changes: 2 additions & 1 deletion deeplabcut/pose_estimation_pytorch/runners/schedulers.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ def load_scheduler_state(
scheduler: torch.optim.lr_scheduler.LRScheduler,
state_dict: dict,
) -> None:
"""
"""Load scheduler state.

Args:
scheduler: The scheduler for which to load the state dict.
state_dict: The state dict to load
Expand Down
12 changes: 8 additions & 4 deletions deeplabcut/utils/auxiliaryfunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,8 @@ def edit_config(configname, edits, output_name=""):


def get_bodyparts(cfg: dict) -> list[str]:
"""
"""Get the bodyparts.

Args:
cfg: a project configuration file

Expand All @@ -313,7 +314,8 @@ def get_bodyparts(cfg: dict) -> list[str]:


def get_unique_bodyparts(cfg: dict) -> list[str]:
"""
"""Get the unique bodyparts.

Args:
cfg: a project configuration file

Expand Down Expand Up @@ -537,7 +539,8 @@ def get_model_folder(
modelprefix: str = "",
engine: Engine = Engine.TF,
) -> Path:
"""
"""Get the model folder.

Args:
trainFraction: the training fraction (as defined in the project configuration)
for which to get the model folder
Expand Down Expand Up @@ -567,7 +570,8 @@ def get_evaluation_folder(
engine: Engine | None = None,
modelprefix: str = "",
) -> Path:
"""
"""Get the evaluation folder.

Args:
trainFraction: the training fraction (as defined in the project configuration)
for which to get the evaluation folder
Expand Down
3 changes: 2 additions & 1 deletion deeplabcut/utils/visualization.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@


def get_cmap(n: int, name: str = "hsv") -> Colormap:
"""
"""Get the cmap.

Args:
n: number of distinct colors
name: name of matplotlib colormap
Expand Down