1
1
# ' @rawNamespace import(data.table, except = transpose)
2
2
# ' @importFrom R6 R6Class
3
- # ' @import mlr3
3
+ # ' @importFrom mlr3 TaskClassif TaskRegr Resampling as_data_backend assert_task rsmp tsk rsmps
4
4
# ' @import mlr3misc
5
5
# ' @import checkmate
6
6
# ' @import paradox
@@ -60,15 +60,15 @@ register_mlr3 = function() { # nocov start
60
60
61
61
# tasks --------------------------------------------------------------------
62
62
63
- x = utils :: getFromNamespace(" mlr_tasks" , ns = " mlr3" )
63
+ mlr_tasks = utils :: getFromNamespace(" mlr_tasks" , ns = " mlr3" )
64
64
65
65
mlr_tasks $ add(" ecuador" , load_task_ecuador )
66
66
mlr_tasks $ add(" diplodia" , load_task_diplodia )
67
67
mlr_tasks $ add(" cookfarm" , load_task_cookfarm )
68
68
69
69
# resampling methods ---------------------------------------------------------
70
70
71
- x = utils :: getFromNamespace(" mlr_resamplings" , ns = " mlr3" )
71
+ mlr_resamplings = utils :: getFromNamespace(" mlr_resamplings" , ns = " mlr3" )
72
72
mlr_resamplings $ add(" spcv_block" , ResamplingSpCVBlock )
73
73
mlr_resamplings $ add(" spcv_buffer" , ResamplingSpCVBuffer )
74
74
mlr_resamplings $ add(" sptcv_cstf" , ResamplingSptCVCstf )
@@ -85,7 +85,7 @@ register_mlr3 = function() { # nocov start
85
85
86
86
utils :: globalVariables(c(
87
87
" row_id" , " cookfarm_sample" , " ecuador" , " diplodia" ,
88
- " resampling" , " task" , " indicator" , " fold" ))
88
+ " resampling" , " task" , " indicator" , " fold" , " id " , " type " ))
89
89
90
90
}
91
91
@@ -94,3 +94,12 @@ register_mlr3 = function() { # nocov start
94
94
setHook(packageEvent(" mlr3" , " onLoad" ), function (... ) register_mlr3(),
95
95
action = " append" )
96
96
} # nocov end
97
+
98
+ .onUnload = function (libpath ) { # nolint
99
+ event = packageEvent(" mlr3" , " onLoad" )
100
+ hooks = getHook(event )
101
+ pkgname = vapply(hooks , function (x ) environment(x )$ pkgname , NA_character_ )
102
+ setHook(event , hooks [pkgname != " mlr3spatiotempcv" ], action = " replace" )
103
+ } # nocov end
104
+
105
+ leanify_package()
0 commit comments