Skip to content

Commit

Permalink
fix R cmd ceheck Note
Browse files Browse the repository at this point in the history
restore translation test on CI
  • Loading branch information
cregouby committed Dec 2, 2023
1 parent a0443dc commit c96423e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,5 @@ Suggests:
yardstick
VignetteBuilder: knitr
Config/testthat/edition: 3
Config/testthat/parallel: false
Config/testthat/start-first: interface, explain, params
2 changes: 2 additions & 0 deletions R/explain.R
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ explain_impl <- function(network, x, x_na_mask) {
network$to(device = curr_device)
})
network$to(device=x$device)
# NULLing values to avoid a R-CMD Check Note "No visible binding for global variable"
M_explain_emb_dim <- masks_emb_dim <- NULL
c(M_explain_emb_dim, masks_emb_dim) %<-% network$forward_masks(x, x_na_mask)

# summarize the categorical embeddedings into 1 column
Expand Down
4 changes: 4 additions & 0 deletions R/model.R
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,8 @@ resolve_early_stop_monitor <- function(early_stopping_monitor, valid_split) {
}

train_batch <- function(network, optimizer, batch, config) {
# NULLing values to avoid a R-CMD Check Note "No visible binding for global variable"
out <- M_loss <- NULL
# forward pass
c(out, M_loss) %<-% network(batch$x, batch$x_na_mask)
# if target is multi-outcome, loss has to be applied to each label-group
Expand Down Expand Up @@ -308,6 +310,8 @@ train_batch <- function(network, optimizer, batch, config) {
}

valid_batch <- function(network, batch, config) {
# NULLing values to avoid a R-CMD Check Note "No visible binding for global variable"
out <- M_loss <- NULL
# forward pass
c(out, M_loss) %<-% network(batch$x, batch$x_na_mask)
# loss has to be applied to each label-group when output_dim is a vector
Expand Down
2 changes: 0 additions & 2 deletions tests/testthat/test_translations.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
test_that("early stopping message get translated in french", {
testthat::skip_on_ci()
testthat::skip_on_cran()
withr::with_language(lang = "fr",
expect_error(
Expand All @@ -12,7 +11,6 @@ test_that("early stopping message get translated in french", {
})

test_that("scheduler message translated in french", {
testthat::skip_on_ci()
testthat::skip_on_cran()
withr::with_language(lang = "fr",
expect_error(
Expand Down

0 comments on commit c96423e

Please sign in to comment.