@@ -35,14 +35,14 @@ test_that("can use trajectories", {
35
35
s_arr <- array (unlist(s ), c(n_state , n_particles , n_groups , n_time ))
36
36
37
37
expect_equal(test_trajectories(time , s , reorder = TRUE ),
38
- list (time , s_arr ))
38
+ list (time , s_arr , NULL ))
39
39
expect_equal(test_trajectories(time , s , reorder = FALSE ),
40
- list (time , s_arr ))
40
+ list (time , s_arr , NULL ))
41
41
expect_equal(test_trajectories(time , s [1 : 3 ], reorder = TRUE ),
42
- list (time [1 : 3 ], s_arr [, , , 1 : 3 ]))
42
+ list (time [1 : 3 ], s_arr [, , , 1 : 3 ], NULL ))
43
43
expect_equal(test_trajectories(time , s , order = vector(" list" , length(time )),
44
44
reorder = TRUE ),
45
- list (time , s_arr ))
45
+ list (time , s_arr , NULL ))
46
46
47
47
res <- test_trajectories(time , s , select_particle = c(6 , 4 , 2 ))[[2 ]]
48
48
expect_equal(dim(res ), c(n_state , n_groups , n_time ))
@@ -94,21 +94,21 @@ test_that("can reorder trajectories with no groups", {
94
94
# # Pass in, but ignore index
95
95
expect_equal(
96
96
test_trajectories(time , state , order = order , reorder = FALSE ),
97
- list (time , state_arr ))
97
+ list (time , state_arr , NULL ))
98
98
99
99
# # Really simple, add an index that does not reorder anything:
100
100
expect_equal(
101
101
test_trajectories(time , state [1 ], order = order [1 ], reorder = TRUE ),
102
- list (time [1 ], state_arr [, , , 1 , drop = FALSE ]))
102
+ list (time [1 ], state_arr [, , , 1 , drop = FALSE ], NULL ))
103
103
expect_equal(
104
104
test_trajectories(time , state [1 : 2 ], order = list (NULL , 0 : 6 ),
105
105
reorder = TRUE ),
106
- list (time [1 : 2 ], state_arr [, , , 1 : 2 , drop = FALSE ]))
106
+ list (time [1 : 2 ], state_arr [, , , 1 : 2 , drop = FALSE ], NULL ))
107
107
108
108
# # Proper reordering with the full index:
109
109
expect_equal(
110
110
test_trajectories(time , state , order = order , reorder = TRUE ),
111
- list (time , true ))
111
+ list (time , true , NULL ))
112
112
113
113
expect_equal(
114
114
test_trajectories(time , state , order = order , reorder = FALSE ,
@@ -149,9 +149,9 @@ test_that("can reorder trajectories on the way out", {
149
149
150
150
state_arr <- array (unlist(state ), dim(true ))
151
151
expect_equal(test_trajectories(time , state , order = order , reorder = FALSE ),
152
- list (time , state_arr ))
152
+ list (time , state_arr , NULL ))
153
153
expect_equal(test_trajectories(time , state , order = order , reorder = TRUE ),
154
- list (time , true ))
154
+ list (time , true , NULL ))
155
155
})
156
156
157
157
@@ -171,14 +171,14 @@ test_that("can extract trajectories with group index, no reordering", {
171
171
s_arr <- array (unlist(s ), c(n_state , n_particles , n_groups , n_time ))
172
172
173
173
expect_equal(test_trajectories(time , s , index_group = NULL ),
174
- list (time , s_arr ))
174
+ list (time , s_arr , NULL ))
175
175
expect_equal(test_trajectories(time , s , index_group = seq_len(n_groups )),
176
- list (time , s_arr ))
176
+ list (time , s_arr , NULL ))
177
177
178
178
expect_equal(test_trajectories(time , s , index_group = 2 ),
179
- list (time , s_arr [, , 2 , , drop = FALSE ]))
179
+ list (time , s_arr [, , 2 , , drop = FALSE ], NULL ))
180
180
expect_equal(test_trajectories(time , s , index_group = c(3 , 1 )),
181
- list (time , s_arr [, , c(3 , 1 ), , drop = FALSE ]))
181
+ list (time , s_arr [, , c(3 , 1 ), , drop = FALSE ], NULL ))
182
182
183
183
m <- test_trajectories(time , s , select_particle = c(6 , 4 , 2 ))[[2 ]]
184
184
expect_equal(dim(m ), c(n_state , n_groups , n_time ))
@@ -226,34 +226,34 @@ test_that("can reorder trajectories on the way out", {
226
226
state_arr <- array (unlist(state ), dim(true ))
227
227
expect_equal(
228
228
test_trajectories(time , state , order = order , reorder = TRUE ),
229
- list (time , true ))
229
+ list (time , true , NULL ))
230
230
expect_equal(
231
231
test_trajectories(time , state , order = order , reorder = TRUE ,
232
232
index_group = 1 : 3 ),
233
- list (time , true ))
233
+ list (time , true , NULL ))
234
234
235
235
expect_equal(
236
236
test_trajectories(time , state , order = order , reorder = TRUE ,
237
237
index_group = 1 ),
238
- list (time , true [, , 1 , , drop = FALSE ]))
238
+ list (time , true [, , 1 , , drop = FALSE ], NULL ))
239
239
expect_equal(
240
240
test_trajectories(time , state , order = order , reorder = TRUE ,
241
241
index_group = 2 ),
242
- list (time , true [, , 2 , , drop = FALSE ]))
242
+ list (time , true [, , 2 , , drop = FALSE ], NULL ))
243
243
expect_equal(
244
244
test_trajectories(time , state , order = order , reorder = TRUE ,
245
245
index_group = 3 ),
246
- list (time , true [, , 3 , , drop = FALSE ]))
246
+ list (time , true [, , 3 , , drop = FALSE ], NULL ))
247
247
248
248
expect_equal(
249
249
test_trajectories(time , state , order = order , reorder = TRUE ,
250
250
index_group = 3 : 2 ),
251
- list (time , true [, , 3 : 2 , , drop = FALSE ]))
251
+ list (time , true [, , 3 : 2 , , drop = FALSE ], NULL ))
252
252
253
253
expect_equal(
254
254
test_trajectories(time , state , order = order , reorder = TRUE ,
255
255
index_group = 3 : 1 ),
256
- list (time , true [, , 3 : 1 , ]))
256
+ list (time , true [, , 3 : 1 , ], NULL ))
257
257
258
258
m <- test_trajectories(time , state , order = order , reorder = TRUE ,
259
259
select_particle = c(6 , 4 , 2 ))[[2 ]]
0 commit comments