Skip to content

Commit

Permalink
Added some logging do summary
Browse files Browse the repository at this point in the history
  • Loading branch information
frankcorneliusmartin committed Jan 25, 2024
1 parent 3101257 commit 7aabbc8
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions vtg.summary/src/R/RPC_summary.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ RPC_summary <- function(data, columns, types = NULL, subset_rules = NULL,
data <- vtg.summary::common_checks_rpc(data, columns, types)
if ("error" %in% names(data)) {
# Return error message
# FIXME: this is not safe
return(data)
}

Expand Down
2 changes: 1 addition & 1 deletion vtg.summary/src/R/RPC_variance_sum.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ RPC_variance_sum <- function(data, columns, mean, types = NULL,
data <- vtg.preprocessing::factorize(data)

# execute checks that are common to all RPCs
data <- vtg.preprocessing::common_checks_rpc(data, columns, types)
data <- vtg.summary::common_checks_rpc(data, columns, types)
if ("error" %in% names(data)) {
# Return error message
return(data)
Expand Down
4 changes: 3 additions & 1 deletion vtg.summary/src/R/common_checks_rpc.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#' message if there is an error
common_checks_rpc <- function(data, columns, types) {
# check if all requested columns are in the data. If not, return error
vtg::log$debug("Performing common checks...")

columns <- unique(columns)
columns_present <- get_columns_in_data(data, columns)
if (length(columns_present) != length(columns)) {
Expand All @@ -17,7 +19,7 @@ common_checks_rpc <- function(data, columns, types) {

# Assign types
if (!is.null(types)) {
vtg.preprocessing::assign_types(data, types)
data <- vtg.preprocessing::assign_types(data, types)
}

# check if all columns are either numeric or factors. If not, return error
Expand Down
5 changes: 2 additions & 3 deletions vtg.summary/src/R/dsummary.R
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,11 @@ combine_node_statistics <- function(summary_per_node, columns) {
ranges_per_node <- lapply(summary_per_node, function(results) {
results[["column_ranges"]]
})
vtg::log$debug("ranges_per_node: {ranges_per_node}")

factor_counts_per_node <- lapply(summary_per_node, function(results) {
results[["factor_counts"]]
})
vtg::log$debug("factor_counts_per_node2: {factor_counts_per_node}")
vtg::log$debug("names: {names(factor_counts_per_node)}")


global_ranges <- list()
global_factor_counts <- list()
Expand Down

0 comments on commit 7aabbc8

Please sign in to comment.