Skip to content
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

Fix log shiny inputs@main #86

Merged
merged 15 commits into from
Sep 9, 2024
Merged

Fix log shiny inputs@main #86

merged 15 commits into from
Sep 9, 2024

Conversation

gogonzo
Copy link
Contributor

@gogonzo gogonzo commented Jul 23, 2024

This fixes:

  • logger observer doesn't trigger when anything changes (observe -> observeEvent)
  • logger observer is set only if log_level is set TRACE or higher
  • don't log NULL -> NULL anymore.

follow up:

To test:
set options(teal.log_level = "TRACE") before attaching packages and run teal.gallery apps to see the difference between main and {this} branch

@gogonzo gogonzo marked this pull request as draft July 23, 2024 14:02
Copy link
Contributor

github-actions bot commented Jul 23, 2024

✅ All contributors have signed the CLA
Posted by the CLA Assistant Lite bot.

Copy link
Contributor

github-actions bot commented Jul 23, 2024

badge

Code Coverage Summary

Filename                       Stmts    Miss  Cover    Missing
---------------------------  -------  ------  -------  ---------
R/log_formatter.R                 12       9  25.00%   11-19
R/log_shiny_input_changes.R       27      27  0.00%    43-74
R/register_handlers.R             39       0  100.00%
R/register_logger.R               56       1  98.21%   115
R/supress_logs.R                  13      13  0.00%    17-29
R/utils.R                         20       0  100.00%
TOTAL                            167      50  70.06%

Diff against main

Filename                       Stmts    Miss  Cover
---------------------------  -------  ------  --------
R/log_formatter.R                +12      +9  +25.00%
R/log_shiny_input_changes.R       +3      +3  +100.00%
TOTAL                            +15     +12  -4.94%

Results for commit: 24b01c8

Minimum allowed coverage is 80%

♻️ This comment has been updated with latest results

@gogonzo gogonzo marked this pull request as ready for review July 24, 2024 11:53
@gogonzo
Copy link
Contributor Author

gogonzo commented Jul 24, 2024

I have read the CLA Document and I hereby sign the CLA

@gogonzo gogonzo added the core label Jul 24, 2024
Copy link
Contributor

Unit Tests Summary

 1 files   3 suites   0s ⏱️
25 tests 25 ✅ 0 💤 0 ❌
37 runs  37 ✅ 0 💤 0 ❌

Results for commit 1ce985d.

Copy link
Contributor

github-actions bot commented Jul 24, 2024

Unit Tests Summary

 1 files   4 suites   0s ⏱️
33 tests 33 ✅ 0 💤 0 ❌
46 runs  46 ✅ 0 💤 0 ❌

Results for commit 24b01c8.

♻️ This comment has been updated with latest results.

R/log_shiny_input_changes.R Outdated Show resolved Hide resolved
@m7pr
Copy link
Contributor

m7pr commented Jul 29, 2024

Hey, taking a look at teal.gallery apps

@m7pr
Copy link
Contributor

m7pr commented Jul 29, 2024

I'm seeing

Warning: Error in bindingIsLocked: no binding for "shiny_input_values"

for efficacy app when I go to Demographic Table

Code

options(teal.log_level = 'TRACE')
library(teal.modules.general)
library(teal.modules.clinical)
options(shiny.useragg = FALSE)

nest_logo <- "https://raw.githubusercontent.com/insightsengineering/hex-stickers/main/PNG/nest.png"

## Data reproducible code ----
data <- teal_data()
data <- within(data, {
  library(dplyr)
  library(scda)
  library(scda.2022)
  library(nestcolor)
  # optional libraries
  library(sparkline)

  ADSL <- synthetic_cdisc_dataset("latest", "adsl")
  adsl_labels <- teal.data::col_labels(ADSL, fill = FALSE)

  char_vars_asl <- names(Filter(isTRUE, sapply(ADSL, is.character)))

  adsl_labels <- c(
    adsl_labels,
    AGEGR1 = "Age Group"
  )
  ADSL <- ADSL %>%
    mutate(
      AGEGR1 = factor(case_when(
        AGE < 45 ~ "<45",
        AGE >= 45 ~ ">=45"
      ))
    ) %>%
    mutate_at(char_vars_asl, factor)

  teal.data::col_labels(ADSL) <- adsl_labels

  ADTTE <- synthetic_cdisc_dataset("latest", "adtte")

  ADRS <- synthetic_cdisc_dataset("latest", "adrs")
  adrs_labels <- teal.data::col_labels(ADRS, fill = FALSE)
  ADRS <- filter(ADRS, PARAMCD == "BESRSPI" | AVISIT == "FOLLOW UP")
  teal.data::col_labels(ADRS) <- adrs_labels

  ADQS <- synthetic_cdisc_dataset("latest", "adqs")
  adqs_labels <- teal.data::col_labels(ADQS, fill = FALSE)
  ADQS <- ADQS %>%
    filter(ABLFL != "Y" & ABLFL2 != "Y") %>%
    filter(AVISIT %in% c("WEEK 1 DAY 8", "WEEK 2 DAY 15", "WEEK 3 DAY 22")) %>%
    mutate(
      AVISIT = as.factor(AVISIT),
      AVISITN = rank(AVISITN) %>%
        as.factor() %>%
        as.numeric() %>%
        as.factor()
    )
  teal.data::col_labels(ADQS) <- adqs_labels
})

# set datanames
datanames <- c("ADSL", "ADTTE", "ADRS", "ADQS")
datanames(data) <- datanames

# set join_keys
join_keys(data) <- default_cdisc_join_keys[datanames]

## Reusable Configuration For Modules
ADSL <- data[["ADSL"]]
ADTTE <- data[["ADTTE"]]
ADRS <- data[["ADRS"]]
ADQS <- data[["ADQS"]]
char_vars_asl <- data[["char_vars_asl"]]

arm_vars <- c("ARMCD", "ARM")
strata_vars <- c("STRATA1", "STRATA2")
facet_vars <- c("AGEGR1", "BMRKR2", "SEX", "COUNTRY")
cov_vars <- c("AGE", "SEX", "BMRKR1", "BMRKR2", "REGION1")
visit_vars <- c("AVISIT", "AVISITN")

cs_arm_var <- choices_selected(
  choices = variable_choices(ADSL, subset = arm_vars),
  selected = "ARM"
)

cs_strata_var <- choices_selected(
  choices = variable_choices(ADSL, subset = strata_vars),
  selected = "STRATA1"
)

cs_facet_var <- choices_selected(
  choices = variable_choices(ADSL, subset = facet_vars),
  selected = "AGEGR1"
)

cs_cov_var <- choices_selected(
  choices = variable_choices(ADSL, subset = cov_vars),
  selected = "AGE"
)

cs_paramcd_tte <- choices_selected(
  choices = value_choices(ADTTE, "PARAMCD", "PARAM"),
  selected = "OS"
)

cs_paramcd_rsp <- choices_selected(
  choices = value_choices(ADRS, "PARAMCD", "PARAM"),
  selected = "BESRSPI"
)

cs_paramcd_qs <- choices_selected(
  choices = value_choices(ADQS, "PARAMCD", "PARAM"),
  selected = "FKSI-FWB"
)

cs_visit_var_qs <- choices_selected(
  choices = variable_choices(ADQS, subset = visit_vars),
  selected = "AVISIT"
)

fact_vars_asl <- names(Filter(isTRUE, sapply(ADSL, is.factor)))
fact_vars_asl_orig <- fact_vars_asl[!fact_vars_asl %in% char_vars_asl]

date_vars_asl <- names(ADSL)[vapply(ADSL, function(x) inherits(x, c("Date", "POSIXct", "POSIXlt")), logical(1))]
demog_vars_asl <- names(ADSL)[!(names(ADSL) %in% c("USUBJID", "STUDYID", date_vars_asl))]

# reference & comparison arm selection when switching the arm variable
# ARMCD is given in a delayed fashion using value choices and
# ARM is given with the ref and comp levels supplied explicitly
arm_ref_comp <- list(
  ARMCD = list(
    ref = value_choices("ADSL", var_choices = "ARMCD", var_label = "ARM", subset = "ARM A"),
    comp = value_choices("ADSL", var_choices = "ARMCD", var_label = "ARM", subset = c("ARM B", "ARM C"))
  ),
  ARM = list(ref = "A: Drug X", comp = c("B: Placebo", "C: Combination"))
)

## Setup App
app <- init(
  data = data,
  filter = teal_slices(
    count_type = "all",
    teal_slice(dataname = "ADSL", varname = "ITTFL", selected = "Y"),
    teal_slice(dataname = "ADSL", varname = "SEX"),
    teal_slice(dataname = "ADSL", varname = "AGE")
  ),
  modules = modules(
    tm_front_page(
      label = "App Info",
      header_text = c(
        "Info about input data source" =
          "This app uses CDISC ADaM datasets randomly generated by `scda` & `scda.2022` R packages"
      ),
      tables = list(`NEST packages used in this demo app` = data.frame(
        Packages = c("teal.modules.general", "teal.modules.clinical", "scda", "scda.2022")
      ))
    ),
    tm_data_table("Data Table"),
    tm_variable_browser("Variable Browser"),
    tm_t_summary(
      label = "Demographic Table",
      dataname = "ADSL",
      arm_var = cs_arm_var,
      summarize_vars = choices_selected(
        choices = variable_choices(ADSL, demog_vars_asl),
        selected = c("SEX", "AGE", "RACE")
      )
    ),
    modules(
      label = "Forest Plots",
      tm_g_forest_tte(
        label = "Survival Forest Plot",
        dataname = "ADTTE",
        arm_var = cs_arm_var,
        strata_var = cs_strata_var,
        subgroup_var = cs_facet_var,
        paramcd = cs_paramcd_tte,
        plot_height = c(800L, 200L, 4000L)
      ),
      tm_g_forest_rsp(
        label = "Response Forest Plot",
        dataname = "ADRS",
        arm_var = cs_arm_var,
        strata_var = cs_strata_var,
        subgroup_var = cs_facet_var,
        paramcd = cs_paramcd_rsp,
        plot_height = c(800L, 200L, 4000L)
      )
    ),
    tm_g_km(
      label = "Kaplan Meier Plot",
      dataname = "ADTTE",
      arm_var = cs_arm_var,
      arm_ref_comp = arm_ref_comp,
      paramcd = cs_paramcd_tte,
      facet_var = cs_facet_var,
      strata_var = cs_strata_var,
      plot_height = c(1800L, 200L, 4000L)
    ),
    tm_t_binary_outcome(
      label = "Response Table",
      dataname = "ADRS",
      arm_var = cs_arm_var,
      arm_ref_comp = arm_ref_comp,
      paramcd = cs_paramcd_rsp,
      strata_var = cs_strata_var,
      rsp_table = TRUE
    ),
    tm_t_tte(
      label = "Time To Event Table",
      dataname = "ADTTE",
      arm_var = cs_arm_var,
      paramcd = cs_paramcd_tte,
      strata_var = cs_strata_var,
      time_points = choices_selected(c(182, 365, 547), 182),
      event_desc_var = choices_selected(
        choices = variable_choices("ADTTE", "EVNTDESC"),
        selected = "EVNTDESC",
        fixed = TRUE
      )
    ),
    tm_t_crosstable(
      "Cross Table",
      x = data_extract_spec(
        dataname = "ADSL",
        select = select_spec(
          choices = variable_choices(ADSL, fact_vars_asl_orig),
          selected = fact_vars_asl_orig[1]
        )
      ),
      y = data_extract_spec(
        dataname = "ADSL",
        select = select_spec(
          choices = variable_choices(ADSL, fact_vars_asl_orig),
          selected = fact_vars_asl_orig[4]
        )
      )
    ),
    tm_t_coxreg(
      label = "Cox Reg",
      dataname = "ADTTE",
      arm_var = cs_arm_var,
      arm_ref_comp = arm_ref_comp,
      paramcd = cs_paramcd_tte,
      strata_var = cs_strata_var,
      cov_var = cs_cov_var
    ),
    tm_t_logistic(
      label = "Logistic Reg",
      dataname = "ADRS",
      arm_var = cs_arm_var,
      arm_ref_comp = NULL,
      paramcd = cs_paramcd_rsp,
      cov_var = cs_cov_var
    ),
    tm_a_mmrm(
      label = "MMRM",
      dataname = "ADQS",
      aval_var = choices_selected(c("AVAL", "CHG"), "AVAL"),
      id_var = choices_selected(c("USUBJID", "SUBJID"), "USUBJID"),
      arm_var = cs_arm_var,
      visit_var = cs_visit_var_qs,
      arm_ref_comp = arm_ref_comp,
      paramcd = cs_paramcd_qs,
      cov_var = choices_selected(c("BASE", "AGE", "SEX", "BASE:AVISIT"), NULL),
      conf_level = choices_selected(c(0.95, 0.9, 0.8), 0.95)
    ),
    tm_t_binary_outcome(
      label = "Binary Response",
      dataname = "ADRS",
      arm_var = cs_arm_var,
      paramcd = cs_paramcd_rsp,
      strata_var = cs_strata_var
    ),
    tm_t_ancova(
      label = "ANCOVA",
      dataname = "ADQS",
      avisit = choices_selected(value_choices(ADQS, "AVISIT"), "WEEK 1 DAY 8"),
      arm_var = cs_arm_var,
      arm_ref_comp = arm_ref_comp,
      aval_var = choices_selected(variable_choices(ADQS, c("AVAL", "CHG", "PCHG")), "CHG"),
      cov_var = choices_selected(variable_choices(ADQS, c("BASE", "STRATA1", "SEX")), "STRATA1"),
      paramcd = cs_paramcd_qs
    )
  ),
  title = build_app_title("Efficacy Analysis Teal Demo App", nest_logo),
  header = tags$span(
    style = "display: flex; align-items: center; justify-content: space-between; margin: 10px 0 10px 0;",
    tags$span(
      style = "font-size: 30px;",
      "Example teal app focusing on efficacy analysis of clinical trial data with teal.modules.clinical"
    ),
    tags$span(
      style = "display: flex; align-items: center;",
      tags$img(src = nest_logo, alt = "NEST logo", height = "45px", style = "margin-right:10px;"),
      tags$span(style = "font-size: 24px;", "NEST @ Roche")
    )
  ),
  footer = tags$p(
    actionLink("showAboutModal", "About,"),
    tags$a(
      href = "https://github.com/insightsengineering/teal.gallery/tree/main/efficacy",
      target = "_blank",
      "Source Code,"
    ),
    tags$a(
      href = "https://github.com/insightsengineering/teal.gallery/issues",
      target = "_blank",
      "Report Issues"
    )
  )
)

body(app$server)[[length(body(app$server)) + 1]] <- quote(
  observeEvent(input$showAboutModal, {
    showModal(modalDialog(
      tags$p(
        "This teal app is brought to you by the NEST Team at Roche/Genentech.
        For more information, please visit:"
      ),
      tags$ul(
        tags$li(tags$a(
          href = "https://github.com/insightsengineering", "Insights Engineering",
          target = "blank"
        )),
        tags$li(tags$a(
          href = "https://pharmaverse.org", "Pharmaverse",
          target = "blank"
        ))
      ),
      easyClose = TRUE
    ))
  })
)

shinyApp(app$ui, app$server)

R/log_shiny_input_changes.R Outdated Show resolved Hide resolved
@m7pr
Copy link
Contributor

m7pr commented Sep 3, 2024

Hey, will investigate with teal.gallery apps

@m7pr
Copy link
Contributor

m7pr commented Sep 3, 2024

Hey, while testing on efficacy app from teal.gallery this is the amount of logs that I see when I uncheck Female in Sex variable on the filter panel. Is this the expected behavior?

Below is on Variable Browser

[TRACE] 2024-09-03 12:50:24.0627 pid:26108 token:[450bea7b] teal.modules.general teal-teal_modules-variable_browser-module Shiny input change detected in variable_browser_ADSL_rows_current: 1:10 -> NULL
[TRACE] 2024-09-03 12:50:24.0651 pid:26108 token:[450bea7b] teal.modules.general teal-teal_modules-variable_browser-module Shiny input change detected in variable_browser_ADSL_rows_all: 1:56 -> NULL
[TRACE] 2024-09-03 12:50:24.0680 pid:26108 token:[450bea7b] teal.modules.general teal-teal_modules-variable_browser-module Shiny input change detected in variable_browser_ADSL_state: list(time = 1725360614844, start = 0, length = 10, order = list(), search = list(search = "", smart = TRUE, regex = FALSE, caseInsensitive = TRUE), columns = list(list(visible = TRUE, search = list(search = "", smart = TRUE, regex = FALSE, caseInsensitive = TRUE)), list(visible = TRUE, search = list(search = "", smart = TRUE, regex = FALSE, caseInsensitive = TRUE)), list(visible = TRUE, search = list(search = "", smart = TRUE, regex = FALSE, caseInsensitive = TRUE)), list(visible = TRUE, search = list(
    search = "", smart = TRUE, regex = FALSE, caseInsensitive = TRUE)), list(visible = TRUE, search = list(search = "", smart = TRUE, regex = FALSE, caseInsensitive = TRUE)))) -> NULL
[TRACE] 2024-09-03 12:50:24.0706 pid:26108 token:[450bea7b] teal.modules.general teal-teal_modules-variable_browser-module Shiny input change detected in variable_summary_table_rows_current: 1 -> NULL
[TRACE] 2024-09-03 12:50:24.0730 pid:26108 token:[450bea7b] teal.modules.general teal-teal_modules-variable_browser-module Shiny input change detected in variable_summary_table_rows_all: 1 -> NULL
[TRACE] 2024-09-03 12:50:24.0756 pid:26108 token:[450bea7b] teal.modules.general teal-teal_modules-variable_browser-module Shiny input change detected in variable_summary_table_state: list(time = 1725360614738, start = 0, length = 10, order = list(), search = list(search = "", smart = TRUE, regex = FALSE, caseInsensitive = TRUE), columns = list(list(visible = TRUE, search = list(search = "", smart = TRUE, regex = FALSE, caseInsensitive = TRUE)), list(visible = TRUE, search = list(search = "", smart = TRUE, regex = FALSE, caseInsensitive = TRUE)))) -> NULL
[TRACE] 2024-09-03 12:50:24.1447 pid:26108 token:[450bea7b] teal.modules.general teal-teal_modules-variable_browser-module Shiny input change detected in variable_summary_table_rows_current: NULL -> 1
[TRACE] 2024-09-03 12:50:24.1474 pid:26108 token:[450bea7b] teal.modules.general teal-teal_modules-variable_browser-module Shiny input change detected in variable_summary_table_rows_all: NULL -> 1
[TRACE] 2024-09-03 12:50:24.1614 pid:26108 token:[450bea7b] teal.modules.general teal-teal_modules-variable_browser-module Shiny input change detected in variable_summary_table_state: NULL -> list(time = 1725360624073, start = 0, length = 10, order = list(), search = list(search = "", smart = TRUE, regex = FALSE, caseInsensitive = TRUE), columns = list(list(visible = TRUE, search = list(search = "", smart = TRUE, regex = FALSE, caseInsensitive = TRUE)), list(visible = TRUE, search = list(search = "", smart = TRUE, regex = FALSE, caseInsensitive = TRUE))))
[TRACE] 2024-09-03 12:50:24.2086 pid:26108 token:[450bea7b] teal.modules.general teal-teal_modules-variable_browser-module Shiny input change detected in variable_browser_ADSL_rows_current: NULL -> 1:10
[TRACE] 2024-09-03 12:50:24.2125 pid:26108 token:[450bea7b] teal.modules.general teal-teal_modules-variable_browser-module Shiny input change detected in variable_browser_ADSL_rows_all: NULL -> 1:56
[TRACE] 2024-09-03 12:50:24.2160 pid:26108 token:[450bea7b] teal.modules.general teal-teal_modules-variable_browser-module Shiny input change detected in variable_browser_ADSL_state: NULL -> list(time = 1725360624152, start = 0, length = 10, order = list(), search = list(search = "", smart = TRUE, regex = FALSE, caseInsensitive = TRUE), columns = list(list(visible = TRUE, search = list(search = "", smart = TRUE, regex = FALSE, caseInsensitive = TRUE)), list(visible = TRUE, search = list(search = "", smart = TRUE, regex = FALSE, caseInsensitive = TRUE)), list(visible = TRUE, search = list(search = "", smart = TRUE, regex = FALSE, caseInsensitive = TRUE)), list(visible = TRUE, search = list(
    search = "", smart = TRUE, regex = FALSE, caseInsensitive = TRUE)), list(visible = TRUE, search = list(search = "", smart = TRUE, regex = FALSE, caseInsensitive = TRUE))))

Looks like a lot of lines.

However, when it comes to changes on the encodings panel: 3 changes yield 3 lines which is ideal. Below is on Demographic Table.

[TRACE] 2024-09-03 12:52:09.1345 pid:26108 token:[450bea7b] teal.modules.clinical teal-teal_modules-demographic_table-module Shiny input change detected in useNA: ifany -> no
[TRACE] 2024-09-03 12:52:12.7041 pid:26108 token:[450bea7b] teal.modules.clinical teal-teal_modules-demographic_table-module Shiny input change detected in numeric_stats: c("n", "mean_sd", "mean_ci", "geom_mean", "median", "median_ci", "quantiles", "range") -> c("n", "mean_ci", "geom_mean", "median", "median_ci", "quantiles", "range")
[TRACE] 2024-09-03 12:52:14.1469 pid:26108 token:[450bea7b] teal.modules.clinical teal-teal_modules-demographic_table-module Shiny input change detected in numeric_stats: c("n", "mean_ci", "geom_mean", "median", "median_ci", "quantiles", "range") -> c("n", "mean_ci", "median", "median_ci", "quantiles", "range")

@m7pr
Copy link
Contributor

m7pr commented Sep 3, 2024

On another module Demographic Table when I change Sex filter on filter panel I do see a lot of teal.transform modules.
Maybe we should discard teal.transform changes at all?

[TRACE] 2024-09-03 12:53:43.0371 pid:26108 token:[450bea7b] teal.transform merge_datasets called with: ADSL datasets; arm_var, summarize_vars selectors; dplyr::inner_join merge function.
[TRACE] 2024-09-03 12:53:43.0419 pid:26108 token:[450bea7b] teal.transform merge_selectors called with: arm_var, summarize_vars selectors.
[TRACE] 2024-09-03 12:53:43.0446 pid:26108 token:[450bea7b] teal.transform get_dplyr_call_data called with: arm_var selectors.
[TRACE] 2024-09-03 12:53:43.0476 pid:26108 token:[450bea7b] teal.transform get_merge_key_grid called with: arm_var selectors.
[TRACE] 2024-09-03 12:53:43.0512 pid:26108 token:[450bea7b] teal.transform get_merge_key_pair called with: arm_var, arm_var selectors; STUDYID, USUBJID keys.
[TRACE] 2024-09-03 12:53:43.0538 pid:26108 token:[450bea7b] teal.transform get_dropped_filters called with arm_var selector.
[TRACE] 2024-09-03 12:53:43.0566 pid:26108 token:[450bea7b] teal.transform get_merge_key_pair returns STUDYID, USUBJID merge keys.
[TRACE] 2024-09-03 12:53:43.0595 pid:26108 token:[450bea7b] teal.transform get_dplyr_call called with: ADSL datasets; arm_var selectors.
[TRACE] 2024-09-03 12:53:43.0625 pid:26108 token:[450bea7b] teal.transform get_filter_call called with: ADSL dataset;  filters.
[TRACE] 2024-09-03 12:53:43.0666 pid:26108 token:[450bea7b] teal.transform get_select_call called with: STUDYID, USUBJID, ARM, AGE, SEX, RACE columns.
[TRACE] 2024-09-03 12:53:43.0733 pid:26108 token:[450bea7b] teal.transform get_merge_call called with: arm_var selectors; dplyr::inner_join merge function.
[TRACE] 2024-09-03 12:53:43.0777 pid:26108 token:[450bea7b] teal.transform get_relabel_cols called with: arm_var, summarize_vars columns_source.
[TRACE] 2024-09-03 12:53:43.0808 pid:26108 token:[450bea7b] teal.transform get_anl_relabel_call called with: arm_var, summarize_vars columns_source; ANL merged dataset.
[TRACE] 2024-09-03 12:53:43.4158 pid:26108 token:[450bea7b] teal.transform get_relabel_call called with: Description of Planned Arm Age Sex Race labels.
[TRACE] 2024-09-03 12:53:43.4185 pid:26108 token:[450bea7b] teal.transform merge_datasets merge code executed resulting in ANL dataset.
[TRACE] 2024-09-03 12:53:43.4314 pid:26108 token:[450bea7b] teal.transform merge_datasets called with: ADSL datasets; arm_var selectors; dplyr::full_join merge function.
[TRACE] 2024-09-03 12:53:43.4342 pid:26108 token:[450bea7b] teal.transform merge_selectors called with: arm_var selectors.
[TRACE] 2024-09-03 12:53:43.4367 pid:26108 token:[450bea7b] teal.transform get_dplyr_call_data called with: arm_var selectors.
[TRACE] 2024-09-03 12:53:43.4393 pid:26108 token:[450bea7b] teal.transform get_merge_key_grid called with: arm_var selectors.
[TRACE] 2024-09-03 12:53:43.4427 pid:26108 token:[450bea7b] teal.transform get_merge_key_pair called with: arm_var, arm_var selectors; STUDYID, USUBJID keys.
[TRACE] 2024-09-03 12:53:43.4450 pid:26108 token:[450bea7b] teal.transform get_dropped_filters called with arm_var selector.
[TRACE] 2024-09-03 12:53:43.4471 pid:26108 token:[450bea7b] teal.transform get_merge_key_pair returns STUDYID, USUBJID merge keys.
[TRACE] 2024-09-03 12:53:43.4496 pid:26108 token:[450bea7b] teal.transform get_dplyr_call called with: ADSL datasets; arm_var selectors.
[TRACE] 2024-09-03 12:53:43.4519 pid:26108 token:[450bea7b] teal.transform get_filter_call called with: ADSL dataset;  filters.
[TRACE] 2024-09-03 12:53:43.4539 pid:26108 token:[450bea7b] teal.transform get_select_call called with: STUDYID, USUBJID, ARM columns.
[TRACE] 2024-09-03 12:53:43.4560 pid:26108 token:[450bea7b] teal.transform get_merge_call called with: arm_var selectors; dplyr::full_join merge function.
[TRACE] 2024-09-03 12:53:43.4581 pid:26108 token:[450bea7b] teal.transform get_relabel_cols called with: arm_var columns_source.
[TRACE] 2024-09-03 12:53:43.4597 pid:26108 token:[450bea7b] teal.transform get_anl_relabel_call called with: arm_var columns_source; ANL_ADSL merged dataset.
[TRACE] 2024-09-03 12:53:43.4633 pid:26108 token:[450bea7b] teal.transform get_relabel_call called with: Description of Planned Arm labels.
[TRACE] 2024-09-03 12:53:43.4656 pid:26108 token:[450bea7b] teal.transform merge_datasets merge code executed resulting in ANL_ADSL dataset.

@m7pr
Copy link
Contributor

m7pr commented Sep 3, 2024

Just flagging that changes on Reporter Previewer are not registered (unsure if they should)
image

@m7pr
Copy link
Contributor

m7pr commented Sep 3, 2024

Besides the reduction of teal.transform logs we could consider reducing those that come from teal.widgets

@gogonzo
Copy link
Contributor Author

gogonzo commented Sep 3, 2024

Just flagging that changes on Reporter Previewer are not registered (unsure if they should)

Probably should if teal.reporter include log_shiny_input_changes

Besides the reduction of teal.transform logs we could consider reducing those that come from teal.widgets

I think merge should be entirely rewritten and changing logs won't change anything. I think reducing logs in transform isn't worth it now

Hey, while testing on efficacy app from teal.gallery this is the amount of logs that I see when I uncheck Female in Sex variable on the filter panel. Is this the expected behavior?

Expected but not desired. datatable has many inputs wnd they are changed every change of the data. Could be excluded where log_shiny_input_changes is called.

@gogonzo
Copy link
Contributor Author

gogonzo commented Sep 4, 2024

@pawelru any more comments?

R/log_shiny_input_changes.R Outdated Show resolved Hide resolved
Copy link
Contributor

@pawelru pawelru left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have completed the review and submitted my comments. Please request me once again if you want me to look at this again.

R/zzz.R Show resolved Hide resolved
Copy link
Contributor

github-actions bot commented Sep 6, 2024

Unit Test Performance Difference

Test Suite $Status$ Time on main $±Time$ $±Tests$ $±Skipped$ $±Failures$ $±Errors$
log_formatter 👶 $+0.09$ $+9$ $0$ $0$ $0$
Additional test case details
Test Suite $Status$ Time on main $±Time$ Test Case
log_formatter 👶 $+0.01$ teal.logger_formats_NA_asis
log_formatter 👶 $+0.01$ teal.logger_formats_NULL_asis
log_formatter 👶 $+0.04$ teal.logger_formats_character_0_asis
log_formatter 👶 $+0.01$ teal.logger_formats_list_as_a_list_literal
log_formatter 👶 $+0.00$ teal.logger_formats_nested_list_as_a_named_list_array_literal
log_formatter 👶 $+0.01$ teal.logger_formats_scalar_asis
log_formatter 👶 $+0.00$ teal.logger_formats_two_vectors_in_a_single_log
log_formatter 👶 $+0.00$ teal.logger_formats_vector_as_an_array_literal

Results for commit 1b9c449

♻️ This comment has been updated with latest results.

R/log_formatter.R Outdated Show resolved Hide resolved
R/log_formatter.R Outdated Show resolved Hide resolved
R/log_formatter.R Outdated Show resolved Hide resolved
R/log_formatter.R Outdated Show resolved Hide resolved
R/zzz.R Outdated Show resolved Hide resolved
Copy link
Contributor

@pawelru pawelru left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 👍

@pawelru pawelru self-assigned this Sep 9, 2024
Co-authored-by: Pawel Rucki <[email protected]>
Signed-off-by: Dawid Kałędkowski <[email protected]>
@gogonzo gogonzo merged commit 1a0aa01 into main Sep 9, 2024
29 checks passed
@gogonzo gogonzo deleted the fix_log_shiny_inputs@main branch September 9, 2024 10:02
@github-actions github-actions bot locked and limited conversation to collaborators Sep 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants