Conversation
98 sequence calculation
Agent-Logs-Url: https://github.com/conservationtechlab/animl-r/sessions/9c6cf7f4-f418-4ca2-9bfd-9d99a676f074 Co-authored-by: tkswanson <4371698+tkswanson@users.noreply.github.com>
Agent-Logs-Url: https://github.com/conservationtechlab/animl-r/sessions/77480154-d967-492c-86cd-fea757f7f12c Co-authored-by: tkswanson <4371698+tkswanson@users.noreply.github.com>
…-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
align with 3.2.1 api changes
…, 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
|
@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>
Added |
matobler
left a comment
There was a problem hiding this comment.
Added a few comments and questions. Only potential bugs are in reid.R.
| 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) | ||
| } |
There was a problem hiding this comment.
this line does not do anything.
| 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) |
There was a problem hiding this comment.
this does transpose the matrix, is that intentional? If not then use:
matrix(A[!diag(TRUE, n)], nrow = n-1, ncol = n, byrow = F)
| } | ||
|
|
||
|
|
||
| #' Computes euclidean squared distance of two sets of vectors |
There was a problem hiding this comment.
two sets of matrices.. the function does not work with vectors.
There was a problem hiding this comment.
the python versions werent working so I translated them with copilot, surprised it failed with linear algrebra
| # Get Station | ||
| #basedepth=length(strsplit(imagedir,split="/")[[1]]) | ||
| #files$Station <- sapply(files$FilePath, function(x) strsplit(x,"/")[[1]][basedepth]) | ||
| files <- sequence_calculation(files, 'station') |
There was a problem hiding this comment.
nothing explicitly, just an example
No description provided.