-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug Fixes #26
Merged
Merged
Bug Fixes #26
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
9776b5f
cleanup a bit and add track attribute data back into return data
smthfrmn e7fc2bd
unit tests passing
smthfrmn ec6cb78
add animal id to output
smthfrmn 3e06e19
good stopping place
smthfrmn b8be855
working
smthfrmn c32d189
get rid of aux files
smthfrmn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ | |
.DS_Store | ||
data/output/** | ||
!data/output/.keep | ||
*.keep |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
Set of input data to test apps. | ||
|
||
*Content* | ||
- input1: 1 goat, median fix rate = 30mins, tracking duration 7.5 month, gps, local movement | ||
- input2: 3 storks, median fix rate = 1sec, tracking duration 2 weeks, gps, local movement | ||
- input3: 1 stork, median fix rate = 1h | 1day | 1 week, tracking duration 11.5 years, argos, includes migration | ||
- input4: 3 geese, median fix rate = 1h | 4h, tracking duration 1.5 years, gps, includes migration | ||
|
||
*I/O types* | ||
- all data sets are provided as 'move2_loc' | ||
- input1 & input2 are also provided as 'telemetry.list' | ||
|
||
*Projection* | ||
- for 'move2_loc', data are provided in "lat/long" (EPSG:4326) and projected to "Mollweide" (ESRI:54009) in order to test your app accordingly for not projected and projected data. If your app does not allow projected data or only can deal with projected data, document and either build a automatic transformation in the app or make it fail with an informative error message. The app "Change projection" can be refered to for the user to change the projection of the data acordingly previous to your app. | ||
|
||
- the 'telemetry.list' examples are in a "aeqd" projection with 0,0 in the center of the track, as this is a common projection used within the ctmm library | ||
|
||
|
||
*File names* | ||
input1_move2loc_LatLon.rds | ||
input1_move2loc_Mollweide.rds | ||
|
||
input2_move2loc_LatLon.rds | ||
input2_move2loc_Mollweide.rds | ||
|
||
input3_move2loc_LatLon.rds | ||
input3_move2loc_Mollweide.rds | ||
|
||
input4_move2loc_LatLon.rds | ||
input4_move2loc_Mollweide.rds | ||
|
||
|
||
input1_telemetrylist_aeqd.rds | ||
input2_telemetrylist_aeqd.rds | ||
|
||
|
||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
test_data <- function(test_file) { | ||
test_data_root_dir <- test_path("data") | ||
readRDS(file = file.path(test_data_root_dir, test_file)) | ||
} | ||
} | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
source(file.path("..", "..", "src", "common", "logger.R")) | ||
source(file.path("..", "..", "src", "common", "runtime_configuration.R")) | ||
source(file.path("..", "..", "src", "io", "app_files.R")) | ||
source(file.path("..", "..", "src", "io", "io_handler.R")) | ||
Sys.setenv("LOCAL_APP_FILES_DIR" = "../../data/local_app_files") | ||
Sys.setenv("USER_APP_FILE_HOME_DIR" = "../../data/auxiliary/user-files") | ||
|
||
clearRecentOutput() | ||
# the system under test (sut) | ||
source(file.path("..", "..", "./RFunction.R")) | ||
source(file.path("..", "..", "./RFunction.R")) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
source(here("tests/testthat/helper.R")) | ||
|
||
test_data <- test_data("input3_move2loc_LatLon.rds") | ||
|
||
|
||
test_that("function executes with user-passed threshold", { | ||
actual <- rFunction(data = test_data, threshold = 6, window = 756) | ||
expected_count <- 3164 | ||
expect_equal(nrow(actual), expected_count) | ||
}) | ||
|
||
|
||
test_that("function executes with default threshold", { | ||
actual <- rFunction(data = test_data, window = 756) | ||
expected_count <- 3164 | ||
expect_equal(nrow(actual), expected_count) | ||
}) | ||
|
||
|
||
test_that("function returns nothing and errors with bad window", { | ||
actual <- rFunction(data = test_data) | ||
expect_null(actual) | ||
}) | ||
|
||
|
||
test_that("function preserves input track attributes", { | ||
actual <- rFunction(data = test_data, window = 756) | ||
actual_track_data_attributes <- sort(names(mt_track_data(actual))) | ||
expected_track_data_attirbutes <- sort(names(mt_track_data(test_data))) | ||
expect_equal(actual_track_data_attributes, expected_track_data_attirbutes) | ||
}) | ||
|
||
|
||
test_that("function preserves input track id column", { | ||
actual <- rFunction(data = test_data, window = 756) | ||
actual_track_id_column <- attr(actual, "track_id") | ||
expected_track_id_column <- attr(test_data, "track_id") | ||
expect_equal(actual_track_id_column, expected_track_id_column) | ||
}) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
library(testthat) | ||
library(testthat) | ||
library(here) |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some unit tests to make sure function executes