@@ -35,6 +35,8 @@ def test_reordering_slice_mask(self, sg, particle_name, before_load):
35
35
ids_before = getattr (sg , particle_name ).particle_ids
36
36
if before_load :
37
37
getattr (sg , particle_name )._particle_dataset ._particle_ids = None
38
+ del getattr (sg ._extra_mask , particle_name )._mask
39
+ getattr (sg ._extra_mask , particle_name )._evaluated = False
38
40
sg .mask_particles (MaskCollection (** {particle_name : mask }))
39
41
ids = getattr (sg , particle_name ).particle_ids
40
42
assert_allclose_units (ids_before [mask ], ids , rtol = 0 , atol = 0 )
@@ -54,6 +56,8 @@ def test_reordering_int_mask(self, sg, particle_name, before_load):
54
56
mask = mask [: mask .size // 2 ]
55
57
if before_load :
56
58
getattr (sg , particle_name )._particle_dataset ._particle_ids = None
59
+ del getattr (sg ._extra_mask , particle_name )._mask
60
+ getattr (sg ._extra_mask , particle_name )._evaluated = False
57
61
sg .mask_particles (MaskCollection (** {particle_name : mask }))
58
62
ids = getattr (sg , particle_name ).particle_ids
59
63
assert_allclose_units (ids_before [mask ], ids , rtol = 0 , atol = 0 )
@@ -69,6 +73,8 @@ def test_bool_mask(self, sg, particle_name, before_load):
69
73
mask = np .random .rand (ids_before .size ) > 0.5
70
74
if before_load :
71
75
getattr (sg , particle_name )._particle_dataset ._particle_ids = None
76
+ del getattr (sg ._extra_mask , particle_name )._mask
77
+ getattr (sg ._extra_mask , particle_name )._evaluated = False
72
78
sg .mask_particles (MaskCollection (** {particle_name : mask }))
73
79
ids = getattr (sg , particle_name ).particle_ids
74
80
assert_allclose_units (ids_before [mask ], ids , rtol = 0 , atol = 0 )
@@ -82,6 +88,8 @@ def test_namedcolumn_masked(self, sg, before_load):
82
88
mask = np .random .rand (neutral_before .size ) > 0.5
83
89
if before_load :
84
90
sg .gas .hydrogen_ionization_fractions ._named_column_dataset ._neutral = None
91
+ del sg ._extra_mask .gas ._mask
92
+ sg ._extra_mask .gas ._evaluated = False
85
93
sg .mask_particles (MaskCollection (** {"gas" : mask }))
86
94
neutral = sg .gas .hydrogen_ionization_fractions .neutral
87
95
assert_allclose_units (
@@ -135,6 +143,8 @@ def test_reordering_slice_mask(self, sg, particle_name, before_load):
135
143
ids_before = getattr (sg , particle_name ).particle_ids
136
144
if before_load :
137
145
getattr (sg , particle_name )._particle_dataset ._particle_ids = None
146
+ del getattr (sg ._extra_mask , particle_name )._mask
147
+ getattr (sg ._extra_mask , particle_name )._evaluated = False
138
148
masked_dataset = getattr (sg , particle_name )[mask ]
139
149
ids = masked_dataset .particle_ids
140
150
assert_allclose_units (ids_before [mask ], ids , rtol = 0 , atol = 0 )
@@ -154,6 +164,8 @@ def test_reordering_int_mask(self, sg, particle_name, before_load):
154
164
mask = mask [: mask .size // 2 ]
155
165
if before_load :
156
166
getattr (sg , particle_name )._particle_dataset ._particle_ids = None
167
+ del getattr (sg ._extra_mask , particle_name )._mask
168
+ getattr (sg ._extra_mask , particle_name )._evaluated = False
157
169
masked_dataset = getattr (sg , particle_name )[mask ]
158
170
ids = masked_dataset .particle_ids
159
171
assert_allclose_units (ids_before [mask ], ids , rtol = 0 , atol = 0 )
@@ -169,6 +181,8 @@ def test_bool_mask(self, sg, particle_name, before_load):
169
181
mask = np .random .rand (ids_before .size ) > 0.5
170
182
if before_load :
171
183
getattr (sg , particle_name )._particle_dataset ._particle_ids = None
184
+ del getattr (sg ._extra_mask , particle_name )._mask
185
+ getattr (sg ._extra_mask , particle_name )._evaluated = False
172
186
masked_dataset = getattr (sg , particle_name )[mask ]
173
187
ids = masked_dataset .particle_ids
174
188
assert_allclose_units (ids_before [mask ], ids , rtol = 0 , atol = 0 )
@@ -184,6 +198,8 @@ def test_reordering_slice_mask(self, sg, before_load):
184
198
fractions_before = sg .gas .hydrogen_ionization_fractions .neutral
185
199
if before_load :
186
200
sg .gas .hydrogen_ionization_fractions ._neutral = None
201
+ del sg ._extra_mask .gas ._mask
202
+ sg ._extra_mask .gas ._evaluated = False
187
203
masked_namedcolumnsdataset = sg .gas .hydrogen_ionization_fractions [mask ]
188
204
fractions = masked_namedcolumnsdataset .neutral
189
205
assert_allclose_units (
@@ -204,6 +220,8 @@ def test_reordering_int_mask(self, sg, before_load):
204
220
mask = mask [: mask .size // 2 ]
205
221
if before_load :
206
222
sg .gas .hydrogen_ionization_fractions ._neutral = None
223
+ del sg ._extra_mask .gas ._mask
224
+ sg ._extra_mask .gas ._mask = False
207
225
masked_namedcolumnsdataset = sg .gas .hydrogen_ionization_fractions [mask ]
208
226
fractions = masked_namedcolumnsdataset .neutral
209
227
assert_allclose_units (
@@ -220,6 +238,8 @@ def test_bool_mask(self, sg, before_load):
220
238
mask = np .random .rand (fractions_before .size ) > 0.5
221
239
if before_load :
222
240
sg .gas .hydrogen_ionization_fractions ._neutral = None
241
+ del sg ._extra_mask .gas ._mask
242
+ sg ._extra_mask .gas ._evaluated = False
223
243
masked_namedcolumnsdataset = sg .gas .hydrogen_ionization_fractions [mask ]
224
244
fractions = masked_namedcolumnsdataset .neutral
225
245
assert_allclose_units (
0 commit comments