Skip to content

Add automatic source_software inference to load_dataset #919

@M0hammed-Reda

Description

@M0hammed-Reda

Is your feature request related to a problem? Please describe.
Users currently need to pass source_software explicitly to load_dataset(), even when the file format is distinctive enough for movement to infer it automatically. This makes simple loading workflows more verbose than necessary and can lead to trial-and-error when users are unsure which source label to use. DLC-style CSV files are especially tricky because DeepLabCut and LightningPose share a similar structure, so ambiguous cases should not be guessed silently.

Describe the solution you'd like
Add automatic source_software inference to load_dataset() and expose a helper such as infer_source_software(file). load_dataset() should support source_software="auto" and infer the source from the registered validators. When a DLC-style CSV file is genuinely ambiguous between DeepLabCut and LightningPose, the function should raise a clear ValueError asking the user to specify source_software explicitly.

Describe alternatives you've considered
One alternative is to keep requiring source_software for every call. That is simpler, but it keeps unnecessary boilerplate in common workflows. Another alternative is to default ambiguous DLC-style CSV files to DeepLabCut, but that is fragile and can label LightningPose data incorrectly.

Additional context
The feature should remain small and reuse the existing loader and validator registry rather than introducing a separate detection system. Tests should cover clear positive cases across supported formats and at least one ambiguous DLC-style CSV case. Documentation should also explain when source_software="auto" works and when users still need to pass the source explicitly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    ✅ Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions