@@ -38,17 +38,15 @@ check_tf_version <- function(alert = c("none",
38
38
correct_tfp = have_tfp()
39
39
)
40
40
41
- if ((all( requirements_valid ))) {
42
-
43
- if (! greta_stash $ python_has_been_initialised ) {
41
+ py_not_init <- ! greta_stash $ python_has_been_initialised
42
+ requirements_valid_py_not_init <- all( requirements_valid ) && py_not_init
43
+ if (requirements_valid_py_not_init ) {
44
44
45
45
cli_process_done(
46
46
msg_done = " Initialising python and checking dependencies ... done!" )
47
47
cat(" \n " )
48
48
greta_stash $ python_has_been_initialised <- TRUE
49
49
50
- }
51
-
52
50
}
53
51
54
52
if (! all(requirements_valid )) {
@@ -100,7 +98,7 @@ check_dims <- function(...,
100
98
101
99
# as text, for printing
102
100
dims_paste <- vapply(dim_list , paste , " " , collapse = " x" )
103
- dims_text <- paste (dims_paste , collapse = " , " )
101
+ dims_text <- toString (dims_paste )
104
102
105
103
# which are scalars
106
104
scalars <- vapply(elem_list , is_scalar , FALSE )
@@ -734,7 +732,7 @@ check_dependencies_satisfied <- function(target,
734
732
735
733
# build the message
736
734
if (any(matches )) {
737
- names_text <- paste (unmet_names , collapse = " , " )
735
+ names_text <- toString (unmet_names )
738
736
msg <- cli :: format_error(
739
737
message = c(
740
738
" Please provide values for the following {length(names_text)} \\
@@ -1972,7 +1970,7 @@ check_is_greta_array <- function(x,
1972
1970
check_missing_infinite_values <- function (x ,
1973
1971
optional ,
1974
1972
call = rlang :: caller_env()){
1975
- contains_missing_or_inf <- ! optional & any( ! is.finite(x ))
1973
+ contains_missing_or_inf <- ! optional & ! all( is.finite(x ))
1976
1974
if (contains_missing_or_inf ) {
1977
1975
cli :: cli_abort(
1978
1976
message = c(
0 commit comments