Skip to content

fix: get_animals and get_empty remove nans (fixes #243)#246

Open
abishop1990 wants to merge 2 commits intoconservationtechlab:devfrom
abishop1990:issue-243-nans-fix
Open

fix: get_animals and get_empty remove nans (fixes #243)#246
abishop1990 wants to merge 2 commits intoconservationtechlab:devfrom
abishop1990:issue-243-nans-fix

Conversation

@abishop1990
Copy link
Copy Markdown

Summary

This PR fixes the NaN handling in the get_animals and get_empty functions in the split module.

Changes Made

  • Modified get_animals() to remove rows with NaN in the 'category' column before filtering for animal detections
  • Modified get_empty() to remove rows with NaN in the 'category' column before filtering for non-animal detections
  • Added comprehensive test suite (tests/split_test.py) with 16 test cases covering various NaN scenarios:
    • No NaN values
    • With NaN values
    • All NaN values
    • Mixed scenarios
    • Prediction mapping verification
    • Confidence value handling

Testing

  • All 16 tests pass
  • Code passes flake8 linting
  • Changes limited to 3 files as per guidelines

Related Issues

Fixes #243

tkswanson and others added 2 commits February 2, 2026 14:17
- update device handlers
- add sequence_calculation()
- add best arg to single_classification
- update args in export_timelapse()
- ensure pandas < 3.0.0
…#243)

- Modified get_animals() to remove rows with NaN in category column
- Modified get_empty() to remove rows with NaN in category column
- Added comprehensive test suite with 16 test cases covering NaN scenarios
- All tests pass and code passes flake8 linting

Fixes conservationtechlab#243
@tkswanson tkswanson changed the base branch from main to dev April 6, 2026 22:36
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.

get_animals and get_empty remove nans

2 participants