-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* WIP for aggregates * Extended aggregates support * Expanded tiledb_array_apply_aggregate and updated help page * Add unit tests * Raise download.file timeout limit from 60s to 180s
- Loading branch information
1 parent
19846fd
commit 20e0ca4
Showing
12 changed files
with
222 additions
and
11 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
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
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
library(tinytest) | ||
library(tiledb) | ||
|
||
if (tiledb_version(TRUE) < "2.18.0") exit_file("Needs TileDB 2.18.0 or later") | ||
if (!requireNamespace("palmerpenguins", quietly=TRUE)) exit_file("Remainder needs 'palmerpenguins'") | ||
|
||
tiledb_ctx(limitTileDBCores()) | ||
|
||
library(palmerpenguins) | ||
uri <- tempfile() | ||
expect_silent(fromDataFrame(penguins, uri, sparse=TRUE)) | ||
|
||
expect_silent(arr <- tiledb_array(uri, extended=FALSE)) | ||
|
||
expect_error(tiledb_array_apply_aggregate(uri, "body_mass_g", "Mean")) # not an array | ||
expect_error(tiledb_array_apply_aggregate(arr, "does_not_exit", "Mean")) # not an attribute | ||
expect_error(tiledb_array_apply_aggregate(arr, "body_mass_g", "UnknownFunction")) # not an operator | ||
|
||
expect_equal(tiledb_array_apply_aggregate(arr, "body_mass_g", "Count", FALSE), 344) | ||
expect_equal(tiledb_array_apply_aggregate(arr, "body_mass_g", "NullCount"), 2) | ||
expect_equal(tiledb_array_apply_aggregate(arr, "body_mass_g", "Min"), 2700) | ||
expect_equal(tiledb_array_apply_aggregate(arr, "body_mass_g", "Max"), 6300) | ||
expect_equal(tiledb_array_apply_aggregate(arr, "body_mass_g", "Sum"), 1437000) | ||
expect_equal(tiledb_array_apply_aggregate(arr, "body_mass_g", "Mean"), 4201.7543869) | ||
|
||
expect_equal(tiledb_array_apply_aggregate(arr, "year", "Count", FALSE), 344) | ||
expect_error(tiledb_array_apply_aggregate(arr, "year", "NullCount")) # no nullcount on non-nullable | ||
expect_equal(tiledb_array_apply_aggregate(arr, "year", "Min", FALSE), 2007) | ||
expect_equal(tiledb_array_apply_aggregate(arr, "year", "Max", FALSE), 2009) | ||
expect_equal(tiledb_array_apply_aggregate(arr, "year", "Sum", FALSE), 690762) | ||
expect_equal(tiledb_array_apply_aggregate(arr, "year", "Mean", FALSE), 2008.02906977) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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
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