@@ -127,6 +127,7 @@ test_that("graphlearner parameters behave as they should", {
127127 dblrn = mlr_learners $ get(" classif.debug" )
128128 dblrn $ param_set $ values $ save_tasks = TRUE
129129
130+ # Graph ParamSet
130131 dbgr = PipeOpScale $ new() %>> % PipeOpLearner $ new(dblrn )
131132
132133 expect_subset(c(" scale.center" , " scale.scale" , " classif.debug.x" ), dbgr $ param_set $ ids())
@@ -163,6 +164,7 @@ test_that("graphlearner parameters behave as they should", {
163164 expect_equal(dbgr $ pipeops $ classif.debug $ param_set $ values $ x , 0.5 )
164165 expect_equal(dbgr $ pipeops $ classif.debug $ learner $ param_set $ values $ x , 0.5 )
165166
167+ # Graph Learner ParamSet
166168 dblrn = mlr_learners $ get(" classif.debug" )
167169 dblrn $ param_set $ values $ message_train = 1
168170 dblrn $ param_set $ values $ message_predict = 1
@@ -177,6 +179,32 @@ test_that("graphlearner parameters behave as they should", {
177179
178180 expect_mapequal(gl $ param_set $ values ,
179181 list (classif.debug.message_predict = 0 , classif.debug.message_train = 1 , classif.debug.warning_predict = 0 , classif.debug.warning_train = 1 ))
182+
183+ # GraphLearner AB shortcuts
184+ gl = GraphLearner $ new(dbgr )
185+
186+ # GraphLearner AB $pipeops
187+ expect_no_error({gl $ pipeops $ classif.debug $ param_set $ values $ x = 0.5 })
188+ expect_equal(gl $ pipeops $ classif.debug $ param_set $ values $ x , 0.5 )
189+ expect_equal(gl $ graph_model $ pipeops $ classif.debug $ param_set $ values $ x , 0.5 )
190+
191+ # GraphLearner AB $pipeops_param_set
192+ expect_no_error({gl $ pipeops_param_set $ classif.debug $ values $ x = 0 })
193+ expect_equal(gl $ pipeops_param_set $ classif.debug $ values $ x , 0 )
194+ expect_equal(gl $ graph_model $ pipeops $ classif.debug $ param_set $ values $ x , 0 )
195+
196+ # GraphLearner AB $pipeops_param_set_values
197+ expect_no_error({gl $ pipeops_param_set_values $ classif.debug $ x = 1 })
198+ expect_equal(gl $ pipeops_param_set_values $ classif.debug $ x , 1 )
199+ expect_equal(gl $ graph_model $ pipeops $ classif.debug $ param_set $ values $ x , 1 )
200+
201+ # Change param_set pointer should throw error
202+ expect_error({gl $ pipeops $ scale $ param_set = ps()})
203+ expect_error({gl $ pipeops_param_set $ scale = ps()})
204+ # Lists with wrong properties should not be accepted
205+ expect_error({gl $ pipeops_param_set_values = list ()})
206+ expect_error({gl $ pipeops_param_set_values = list (x = 5 )})
207+
180208})
181209
182210test_that(" graphlearner type inference" , {
0 commit comments