Skip to content

Refactor DeepLabCut CSV read and validation#715

Merged
niksirbi merged 1 commit into
mainfrom
refactor-dlc-csv
Dec 5, 2025
Merged

Refactor DeepLabCut CSV read and validation#715
niksirbi merged 1 commit into
mainfrom
refactor-dlc-csv

Conversation

@lochhh

@lochhh lochhh commented Dec 4, 2025

Copy link
Copy Markdown
Member

Description

What is this PR

  • Bug fix
  • Addition of a new feature
  • Other

Why is this PR needed?
Closes #716

What does this PR do?

  • updates the logic to compare only the non-numeric levels in ValidDeepLabCutCSV
  • stores the read column levels in the ValidDeepLabCutCSV object for use in _df_from_dlc_csv
  • simplifies read_csv call (note that there is a much simpler way to do this for typical cases as mentioned in Simplify DeepLabCut CSV read #716, but this approach is one that "works-for-all"; the other alternative would be to have two pathways: use read_csv with index_col=0 if the first row is not empty, otherwise use read_csv without index_col and set/reset the MultiIndex/index names after).

References

#716

How has this PR been tested?

Existing tests passing

Is this a breaking change?

No

Does this PR require an update to the documentation?

No

Checklist:

  • The code has been tested locally
  • Tests have been added to cover all new functionality
  • The documentation has been updated to reflect any changes
  • The code has been formatted with pre-commit

@sonarqubecloud

sonarqubecloud Bot commented Dec 4, 2025

Copy link
Copy Markdown

@codecov

codecov Bot commented Dec 4, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (d5544d9) to head (cfb141a).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #715   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           34        34           
  Lines         2070      2068    -2     
=========================================
- Hits          2070      2068    -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@lochhh lochhh marked this pull request as ready for review December 4, 2025 16:03
@lochhh lochhh requested a review from a team December 4, 2025 16:03

@niksirbi niksirbi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @lochhh! It's nice to avoid parsing the CSV header twice. This is good-to-go!

Comment thread movement/io/load_poses.py
@niksirbi niksirbi added this pull request to the merge queue Dec 5, 2025
Merged via the queue into main with commit 5c7110f Dec 5, 2025
27 checks passed
@niksirbi niksirbi deleted the refactor-dlc-csv branch December 5, 2025 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Simplify DeepLabCut CSV read

2 participants