-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from nilanjanchatterjee/sf-changes
Bug Fixes
- Loading branch information
Showing
15 changed files
with
326 additions
and
263 deletions.
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) |