Fix test_classification.py to reflect current classification.py#279
Merged
tkswanson merged 1 commit intoMay 1, 2026
Merged
Conversation
Agent-Logs-Url: https://github.com/conservationtechlab/animl-py/sessions/ee8ba424-8a1d-4dba-bd36-fd38d37dd68f Co-authored-by: tkswanson <4371698+tkswanson@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
tkswanson
May 1, 2026 21:20
View session
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.
test_classification.pyhad three mismatches with the actualclassification.pyimplementation that caused import errors and incorrect test assertions.Changes
Remove stale import —
from animl.split import get_animalsreferences a module that no longer exists. Replaced the single usage with inline filtering:detections[detections["category_label"] == "animal"].reset_index(drop=True)Fix
test_non_dataframe_detections_raises— used"not_a_dataframe"(astr), whichclassify()accepts as a single file path, so no error was raised at input validation. Changed to adictinput to actually hit the unhandled-type branch. Updated expected exception fromValueErrortoAssertionErrorto match theraise AssertionError("Input must be a data frame of crops, single file path or vector of file paths.")in the code.Fix
test_empty_animals_with_empty_detections—single_classificationreadsempty['category_label']to populateprediction; the test'semptyDataFrame was missing this column. Replaced the pre-builtprediction/confidencecolumns withcategory_label.