Update function signatures - #3458
Draft
deruyter92 wants to merge 22 commits into
Draft
deruyter92 wants to merge 22 commits into
deruyter92 wants to merge 22 commits into
Conversation
deruyter92
changed the base branch from
jaap/prepare_tf_deprecation
to
jaap/lazy-loading
August 21, 2026 08:58
deruyter92
force-pushed
the
jaap/update-function-signatures
branch
from
August 26, 2026 11:34
ced1b85 to
16312b9
Compare
deruyter92
force-pushed
the
jaap/lazy-loading
branch
from
September 3, 2026 08:55
229cfd0 to
1e0896b
Compare
deruyter92
force-pushed
the
jaap/update-function-signatures
branch
from
September 3, 2026 08:58
16312b9 to
cd3c546
Compare
deruyter92
force-pushed
the
jaap/lazy-loading
branch
from
September 4, 2026 12:14
c052876 to
62f5b33
Compare
Apply a new parameter-aliasing deprecation round (since 3.0.2) to the public API, GUI, and internals: add @renamed_parameter markers and update signatures, docstrings, and call sites for parameters that still used legacy camelCase or concatenated names (e.g. outlieralgorithm -> outlier_algorithm, filtertype -> filter_type, trainFraction -> train_fraction). Update tests for the new names.
…ideos_converth5_to_nwb Note that the default None is also expanded only ".mp4" types to all supported videos. This is a minor behavior change that alligns the current function with the rest of API.
deruyter92
force-pushed
the
jaap/update-function-signatures
branch
from
September 4, 2026 12:16
4ea3a89 to
558e2e5
Compare
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
Cross-backend routing regressions, unsupported 3D config contracts, and failing legacy call sites remain unresolved.
Pull request overview
Standardizes DeepLabCut API parameters with snake_case names, deprecated aliases, and broader ProjectConfig support.
Changes:
- Renames parameters while preserving legacy aliases.
- Migrates project APIs toward typed configuration objects.
- Updates internal callers, GUI code, examples, and routing tests.
File summaries
| File | Description |
|---|---|
| tests/api/test_pose_estimation.py | Updates routing expectations. |
| tests/api/test_create_project.py | Updates project API expectations. |
| examples/testscript_transreid.py | Uses canonical body-part parameter. |
| examples/testscript_tensorflow_single_animal.py | Uses canonical cropping parameter. |
| examples/testscript_tensorflow_multi_animal.py | Uses canonical body-part parameter. |
| deeplabcut/utils/plotting.py | Normalizes plotting parameters/config handling. |
| deeplabcut/utils/make_labeled_video.py | Normalizes video-creation API. |
| deeplabcut/utils/conversioncode.py | Normalizes conversion APIs. |
| deeplabcut/utils/auxfun_multianimal.py | Adds typed config support. |
| deeplabcut/tensorflow_compat/pose_estimation.py | Adds TensorFlow aliases. |
| deeplabcut/tensorflow_compat/create_project.py | Normalizes project parameters. |
| deeplabcut/refine_training_dataset/stitch.py | Normalizes stitching config input. |
| deeplabcut/refine_training_dataset/outlier_frames.py | Normalizes outlier APIs. |
| deeplabcut/post_processing/filtering.py | Normalizes filtering parameters. |
| deeplabcut/post_processing/analyze_skeleton.py | Adds typed config support. |
| deeplabcut/pose_estimation_pytorch/data/dlcloader.py | Validates object-based configs. |
| deeplabcut/pose_estimation_pytorch/apis/videos.py | Broadens config input and batch aliasing. |
| deeplabcut/pose_estimation_pytorch/apis/utils.py | Broadens config input. |
| deeplabcut/pose_estimation_pytorch/apis/tracklets.py | Normalizes inference config naming. |
| deeplabcut/pose_estimation_pytorch/apis/tracking_dataset.py | Adds batch-size alias. |
| deeplabcut/pose_estimation_pytorch/apis/export.py | Renames snapshot parameter. |
| deeplabcut/pose_estimation_pytorch/apis/evaluation.py | Normalizes evaluation API. |
| deeplabcut/pose_estimation_pytorch/apis/analyze_images.py | Adds typed config support. |
| deeplabcut/pose_estimation_3d/triangulation.py | Normalizes 3D API parameters. |
| deeplabcut/pose_estimation_3d/plotting3D.py | Normalizes 3D plotting parameters. |
| deeplabcut/pose_estimation_3d/camera_calibration.py | Broadens config annotations. |
| deeplabcut/gui/tabs/refine_tracklets.py | Updates filtering and merging calls. |
| deeplabcut/gui/tabs/label_frames.py | Updates label-check call. |
| deeplabcut/gui/tabs/extract_outlier_frames.py | Updates outlier API calls. |
| deeplabcut/gui/tabs/extract_frames.py | Uses typed config and canonical names. |
| deeplabcut/gui/tabs/evaluate_network.py | Updates evaluation calls. |
| deeplabcut/gui/tabs/create_videos.py | Updates video-creation calls. |
| deeplabcut/gui/tabs/create_training_dataset.py | Updates shuffle naming. |
| deeplabcut/gui/tabs/analyze_videos.py | Updates post-processing calls. |
| deeplabcut/generate_training_dataset/trainingsetmanipulation.py | Normalizes dataset APIs. |
| deeplabcut/generate_training_dataset/multiple_individuals_trainingsetmanipulation.py | Normalizes multi-animal dataset APIs. |
| deeplabcut/generate_training_dataset/frame_extraction.py | Adds typed config handling. |
| deeplabcut/create_project/modelzoo.py | Normalizes pretrained-project parameters. |
| deeplabcut/create_project/demo_data.py | Renames training-set option. |
| deeplabcut/create_project/add.py | Adds typed config handling. |
| deeplabcut/core/deprecation.py | Defines the new deprecation round. |
| deeplabcut/api/refine_training.py | Normalizes refinement facade. |
| deeplabcut/api/post_processing.py | Normalizes post-processing facade. |
| deeplabcut/api/pose_estimation.py | Normalizes pose-estimation facade. |
| deeplabcut/api/create_project.py | Normalizes project-creation facade. |
Review details
Suppressed comments (2)
deeplabcut/pose_estimation_3d/triangulation.py:278
- This second analysis branch has the same TF regression:
deviceis forwarded totensorflow_compat.analyze_videos, whose signature only acceptsgputouse. Since the keyword is supplied even for the defaultNone, TensorFlow-backed triangulation fails on every execution of this branch; translate it in the shared router or conditionally pass the backend-specific keyword.
device=device,
deeplabcut/api/pose_estimation.py:939
- The canonical name does not work on the TensorFlow fallback: the outer router forwards
snapshot_indexunchanged, whiletensorflow_compat.export_modelstill requiressnapshotindex. Thusdeeplabcut.export_model(..., snapshot_index=...)fails specifically for TF projects even though the legacy spelling succeeds. Update the TF compatibility signature with its own deprecated alias or add backend-aware translation.
snapshot_index: int | None = None,
- Files reviewed: 45/45 changed files
- Comments generated: 10
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| trainingsetindex: int = 0, | ||
| comparison_bodyparts: str | list[str] = "all", | ||
| snapshotindex: str | int | None = None, | ||
| snapshot_index: str | int | None = None, |
| destfolder: str | None = None, | ||
| ignore_bodyparts: list[str] | None = None, | ||
| inferencecfg: dict | None = None, | ||
| inference_cfg: dict | None = None, |
|
|
||
| def calibrate_cameras( | ||
| config: str | Path, | ||
| config: ProjectConfig | dict | Path | str, |
|
|
||
|
|
||
| def check_undistortion(config: str | Path, cbrow=8, cbcol=6, plot=True): | ||
| def check_undistortion(config: ProjectConfig | dict | Path | str, cbrow=8, cbcol=6, plot=True): |
| @renamed_parameter(old="videotype", new="video_extensions", deprecation_round=DeprecationRound.PARAMETER_ALIASING_302) | ||
| def create_labeled_video_3d( | ||
| config: str | Path, | ||
| config: ProjectConfig | dict | Path | str, |
| @renamed_parameter(old="gputouse", new="device", deprecation_round=DeprecationRound.PARAMETER_ALIASING_302) | ||
| def triangulate( | ||
| config: str | Path, | ||
| config: ProjectConfig | dict | Path | str, |
| filterpredictions=True, | ||
| filtertype="median", | ||
| gputouse=None, | ||
| video_extensions: str | Sequence[str] | None = "", |
| shuffle=shuffle, | ||
| trainingsetindex=trainingsetindex, | ||
| gputouse=gputouse, | ||
| device=device, |
| shuffle: int = 1, | ||
| trainingsetindex: int = 0, | ||
| snapshotindex: int | None = None, | ||
| snapshot_index: int | None = None, |
|
|
||
|
|
||
| def compute_deviations(Dataframe, dataname, p_bound, alpha, ARdegree, MAdegree, storeoutput=None): | ||
| def compute_deviations(Dataframe, dataname, p_bound, alpha, ar_degree, ma_degree, storeoutput=None): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
The DeepLabCut API was recently streamlined in #3332 and #3198, which introduced consistent paramteter names (e.g. snake case, lowercase internally consistent parameter names). However several function signatures currently still remain to be normalized.
This PR aims to further streamline all function signatures of all API to normalize
config_path: str,config: str-->config: ProjectConfig | str | Path | dictShuffles-->shufflesTrainFraction-->train_fractionetcetera.
Note
This PR is a placeholder that currently has draft status. I am still considering a smaller scope and the specific renames remain to be discussed and tested properly.