Skip to content

Animl 3.2.1#111

Open
tkswanson wants to merge 23 commits into
masterfrom
dev
Open

Animl 3.2.1#111
tkswanson wants to merge 23 commits into
masterfrom
dev

Conversation

@tkswanson
Copy link
Copy Markdown
Member

No description provided.

tkswanson and others added 19 commits April 13, 2026 16:08
…-unit-tests

Add testthat unit tests for pure-R functions in animl-r
…les-skip-animl-py

# Conflicts:
#	tests/testthat/test-classification.R
#	tests/testthat/test-export.R
#	tests/testthat/test-file_management.R
#	tests/testthat/test-sequence_classification.R
#	tests/testthat/test-split.R

Co-authored-by: tkswanson <4371698+tkswanson@users.noreply.github.com>
…files-skip-animl-py

Replace animl_py skip stubs with conditional skip tests
…, sequence_classification tests; add visualization tests

Agent-Logs-Url: https://github.com/conservationtechlab/animl-r/sessions/2579ad30-7fb5-48a7-ab17-20639ce64113

Co-authored-by: tkswanson <4371698+tkswanson@users.noreply.github.com>
…e-inconsistencies

Fix test file inconsistencies across animl-r testthat suite
@tkswanson tkswanson changed the title Dev Animl 3.2.1 Apr 24, 2026
@tkswanson
Copy link
Copy Markdown
Member Author

@copilot add release notes

Agent-Logs-Url: https://github.com/conservationtechlab/animl-r/sessions/2160d223-053f-4d00-8ac4-17ce58971d81

Co-authored-by: tkswanson <4371698+tkswanson@users.noreply.github.com>
Copy link
Copy Markdown

Copilot AI commented Apr 24, 2026

@copilot add release notes

Added NEWS.md with release notes in commit 6e4c21a. It covers new functions (active_times, export_yolo, export_camptrapdp, export_camtrapR), API changes across detection, classification, visualization, file management, and export modules, the native R re-implementation of re-ID distance metrics, and other improvements like conda env handling and the new testthat suite.

Copy link
Copy Markdown
Collaborator

@matobler matobler left a comment

Choose a reason for hiding this comment

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

Added a few comments and questions. Only potential bugs are in reid.R.

Comment thread R/reid.R
Comment on lines +50 to 55
remove_diagonal <- function(A) {
if (nrow(A) != ncol(A)) stop("Input must be a square matrix")
n <- nrow(A)
A[!diag(n)] # logical index, drops diagonal
matrix(A[!diag(TRUE, n)], nrow = n, ncol = n - 1, byrow = TRUE)
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this line does not do anything.

Comment thread R/reid.R Outdated
if (nrow(A) != ncol(A)) stop("Input must be a square matrix")
n <- nrow(A)
A[!diag(n)] # logical index, drops diagonal
matrix(A[!diag(TRUE, n)], nrow = n, ncol = n - 1, byrow = TRUE)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this does transpose the matrix, is that intentional? If not then use:
matrix(A[!diag(TRUE, n)], nrow = n-1, ncol = n, byrow = F)

Comment thread R/reid.R Outdated
}


#' Computes euclidean squared distance of two sets of vectors
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

two sets of matrices.. the function does not work with vectors.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

the python versions werent working so I translated them with copilot, surprised it failed with linear algrebra

Comment thread examples/Workflow_animl.R
# Get Station
#basedepth=length(strsplit(imagedir,split="/")[[1]])
#files$Station <- sapply(files$FilePath, function(x) strsplit(x,"/")[[1]][basedepth])
files <- sequence_calculation(files, 'station')
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

What is this used for?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

nothing explicitly, just an example

Comment thread DESCRIPTION Outdated
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.

3 participants