forked from open-atmos/PyPartMC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_aero_particle.py
639 lines (540 loc) · 19.5 KB
/
test_aero_particle.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
####################################################################################################
# This file is a part of PyPartMC licensed under the GNU General Public License v3 (LICENSE file) #
# Copyright (C) 2022 University of Illinois Urbana-Champaign #
# Authors: https://github.com/open-atmos/PyPartMC/graphs/contributors #
####################################################################################################
import gc
import numpy as np
import pytest
import PyPartMC as ppmc
from PyPartMC import si
from .test_aero_data import AERO_DATA_CTOR_ARG_MINIMAL
from .test_aero_dist import AERO_DIST_CTOR_ARG_MINIMAL
from .test_aero_state import AERO_STATE_CTOR_ARG_MINIMAL
from .test_env_state import ENV_STATE_CTOR_ARG_MINIMAL
class TestAeroParticle: # pylint: disable=too-many-public-methods
@staticmethod
@pytest.mark.parametrize(
"volumes",
(
[0],
# pytest.param([],marks=pytest.mark.xfail(strict=True))
),
)
def test_ctor(volumes):
# arrange
aero_data = ppmc.AeroData(AERO_DATA_CTOR_ARG_MINIMAL)
# act
sut = ppmc.AeroParticle(aero_data, volumes)
# assert
assert sut is not None
@staticmethod
def test_volumes():
# arrange
aero_data = ppmc.AeroData(AERO_DATA_CTOR_ARG_MINIMAL)
volumes = [123]
# act
sut = ppmc.AeroParticle(aero_data, volumes)
# assert
assert sut.volumes == volumes
@staticmethod
def test_volume():
# arrange
aero_data_arg = (
{"H2O": [1000 * si.kg / si.m**3, 0, 18e-3 * si.kg / si.mol, 0]},
{"Cl": [2200 * si.kg / si.m**3, 1, 35.5e-3 * si.kg / si.mol, 0]},
{"Na": [2200 * si.kg / si.m**3, 1, 23e-3 * si.kg / si.mol, 0]},
)
aero_data = ppmc.AeroData(aero_data_arg)
volumes = [1, 2, 3]
sut = ppmc.AeroParticle(aero_data, volumes)
aero_data = None
gc.collect()
# act
vol = sut.volume
# assert
assert vol == sum(volumes)
@staticmethod
def test_species_volume():
# arrange
aero_data_arg = (
{"H2O": [1000 * si.kg / si.m**3, 0, 18e-3 * si.kg / si.mol, 0]},
{"Cl": [2200 * si.kg / si.m**3, 1, 35.5e-3 * si.kg / si.mol, 0]},
{"Na": [2200 * si.kg / si.m**3, 1, 23e-3 * si.kg / si.mol, 0]},
)
aero_data = ppmc.AeroData(aero_data_arg)
volumes = [1, 2, 3]
sut = ppmc.AeroParticle(aero_data, volumes)
aero_data = None
gc.collect()
# act and assert
for i, volume in enumerate(volumes):
vol = sut.species_volume(i)
assert vol == volume
for i, volume in enumerate(volumes):
vol = sut.species_volume(list(aero_data_arg[i])[0])
assert vol == volume
@staticmethod
def test_dry_volume():
# arrange
aero_data_arg = (
{"H2O": [1000 * si.kg / si.m**3, 0, 18e-3 * si.kg / si.mol, 0]},
{"Cl": [2200 * si.kg / si.m**3, 1, 35.5e-3 * si.kg / si.mol, 0]},
{"Na": [2200 * si.kg / si.m**3, 1, 23e-3 * si.kg / si.mol, 0]},
)
aero_data = ppmc.AeroData(aero_data_arg)
volumes = [1, 2, 3]
sut = ppmc.AeroParticle(aero_data, volumes)
aero_data = None
volumes = None
gc.collect()
# act
dry_vol = sut.dry_volume
# assert
assert dry_vol == 5
@staticmethod
def test_particle_radius():
# arrange
aero_data_arg = (
{"H2O": [1000 * si.kg / si.m**3, 0, 18e-3 * si.kg / si.mol, 0]},
{"Cl": [2200 * si.kg / si.m**3, 1, 35.5e-3 * si.kg / si.mol, 0]},
{"Na": [2200 * si.kg / si.m**3, 1, 23e-3 * si.kg / si.mol, 0]},
)
aero_data = ppmc.AeroData(aero_data_arg)
aero_data.frac_dim = 3.0
aero_data.vol_fill_factor = 1.0
aero_data.prime_radius = 1e-8
volumes = [1, 2, 3]
sut = ppmc.AeroParticle(aero_data, volumes)
aero_data = None
volumes = None
gc.collect()
# act
radius = sut.radius
# assert
assert radius == ppmc.sphere_vol2rad(6)
@staticmethod
def test_dry_radius():
# arrange
aero_data_arg = (
{"H2O": [1000 * si.kg / si.m**3, 0, 18e-3 * si.kg / si.mol, 0]},
{"Cl": [2200 * si.kg / si.m**3, 1, 35.5e-3 * si.kg / si.mol, 0]},
{"Na": [2200 * si.kg / si.m**3, 1, 23e-3 * si.kg / si.mol, 0]},
)
aero_data = ppmc.AeroData(aero_data_arg)
aero_data.frac_dim = 3.0
aero_data.vol_fill_factor = 1.0
aero_data.prime_radius = 1e-8
volumes = [1, 2, 3]
sut = ppmc.AeroParticle(aero_data, volumes)
aero_data = None
volumes = None
gc.collect()
# act
dry_radius = sut.dry_radius
# assert
assert dry_radius == ppmc.sphere_vol2rad(5)
@staticmethod
def test_diameter():
# arrange
aero_data_arg = (
{"H2O": [1000 * si.kg / si.m**3, 0, 18e-3 * si.kg / si.mol, 0]},
{"Cl": [2200 * si.kg / si.m**3, 1, 35.5e-3 * si.kg / si.mol, 0]},
{"Na": [2200 * si.kg / si.m**3, 1, 23e-3 * si.kg / si.mol, 0]},
)
aero_data = ppmc.AeroData(aero_data_arg)
aero_data.frac_dim = 3.0
aero_data.vol_fill_factor = 1.0
aero_data.prime_radius = 1e-8
volumes = [1, 2, 3]
sut = ppmc.AeroParticle(aero_data, volumes)
aero_data = None
volumes = None
gc.collect()
# act
diameter = sut.diameter
# assert
assert diameter == 2 * ppmc.sphere_vol2rad(6)
@staticmethod
def test_dry_diameter():
# arrange
aero_data_arg = (
{"H2O": [1000 * si.kg / si.m**3, 0, 18e-3 * si.kg / si.mol, 0]},
{"Cl": [2200 * si.kg / si.m**3, 1, 35.5e-3 * si.kg / si.mol, 0]},
{"Na": [2200 * si.kg / si.m**3, 1, 23e-3 * si.kg / si.mol, 0]},
)
aero_data = ppmc.AeroData(aero_data_arg)
aero_data.frac_dim = 3.0
aero_data.vol_fill_factor = 1.0
aero_data.prime_radius = 1e-8
volumes = [1, 2, 3]
sut = ppmc.AeroParticle(aero_data, volumes)
aero_data = None
volumes = None
gc.collect()
# act
dry_diameter = sut.dry_diameter
# assert
assert dry_diameter == 2 * ppmc.sphere_vol2rad(5)
@staticmethod
def test_mass():
# arrange
aero_data_arg = (
{"H2O": [1000 * si.kg / si.m**3, 0, 18e-3 * si.kg / si.mol, 0]},
{"Cl": [2200 * si.kg / si.m**3, 1, 35.5e-3 * si.kg / si.mol, 0]},
{"Na": [2200 * si.kg / si.m**3, 1, 23e-3 * si.kg / si.mol, 0]},
)
aero_data = ppmc.AeroData(aero_data_arg)
volumes = [1, 2, 3]
sut = ppmc.AeroParticle(aero_data, volumes)
aero_data = None
gc.collect()
# act
mass = sut.mass
check = 0
for i, spec in enumerate(aero_data_arg):
key = list(spec)[0]
check += spec[key][0] * volumes[i]
# assert
assert mass == check
@staticmethod
def test_species_mass():
# arrange
aero_data_arg = (
{"H2O": [1000 * si.kg / si.m**3, 0, 18e-3 * si.kg / si.mol, 0]},
{"Cl": [2200 * si.kg / si.m**3, 1, 35.5e-3 * si.kg / si.mol, 0]},
{"Na": [2200 * si.kg / si.m**3, 1, 23e-3 * si.kg / si.mol, 0]},
)
aero_data = ppmc.AeroData(aero_data_arg)
volumes = [1, 2, 3]
sut = ppmc.AeroParticle(aero_data, volumes)
aero_data = None
gc.collect()
# act
sodium_mass = sut.species_mass(2)
check = aero_data_arg[2]["Na"][0] * volumes[2]
# assert
assert sodium_mass == check
sodium_mass = sut.species_mass("Na")
check = aero_data_arg[2]["Na"][0] * volumes[2]
# assert
assert sodium_mass == check
@staticmethod
def test_species_masses():
# arrange
aero_data_arg = (
{"H2O": [1000 * si.kg / si.m**3, 0, 18e-3 * si.kg / si.mol, 0]},
{"Cl": [2200 * si.kg / si.m**3, 1, 35.5e-3 * si.kg / si.mol, 0]},
{"Na": [2200 * si.kg / si.m**3, 1, 23e-3 * si.kg / si.mol, 0]},
)
aero_data = ppmc.AeroData(aero_data_arg)
volumes = [1, 2, 3]
sut = ppmc.AeroParticle(aero_data, volumes)
aero_data = None
gc.collect()
# act
masses = sut.species_masses
check = []
for i, spec in enumerate(aero_data_arg):
key = list(spec)[0]
check.append(spec[key][0] * volumes[i])
# assert
assert masses == check
@staticmethod
def test_solute_kappa():
# arrange
aero_data_arg = (
{"H2O": [1000 * si.kg / si.m**3, 0, 18e-3 * si.kg / si.mol, 0]},
{"Cl": [2200 * si.kg / si.m**3, 1, 35.5e-3 * si.kg / si.mol, 0]},
{"Na": [2200 * si.kg / si.m**3, 1, 23e-3 * si.kg / si.mol, 0]},
)
aero_data = ppmc.AeroData(aero_data_arg)
volumes = [1, 2, 3]
sut = ppmc.AeroParticle(aero_data, volumes)
aero_data = None
volumes = None
gc.collect()
# act
kappa = sut.solute_kappa
# assert
np.testing.assert_almost_equal(kappa, 1.479240661)
@staticmethod
def test_moles():
# arrange
aero_data_arg = (
{"H2O": [1000 * si.kg / si.m**3, 0, 18e-3 * si.kg / si.mol, 0]},
{"Cl": [2200 * si.kg / si.m**3, 1, 35.5e-3 * si.kg / si.mol, 0]},
{"Na": [2200 * si.kg / si.m**3, 1, 23e-3 * si.kg / si.mol, 0]},
)
aero_data = ppmc.AeroData(aero_data_arg)
volumes = [1, 2, 3]
sut = ppmc.AeroParticle(aero_data, volumes)
aero_data = None
volumes = None
gc.collect()
# act
moles = sut.moles
check = 1000 / 18e-3 + 4400 / 35.5e-3 + 6600 / 23e-3
# assert
np.testing.assert_almost_equal(moles, check)
@staticmethod
def test_mobility_diameter():
# arrange
aero_data_arg = (
{"H2O": [1000 * si.kg / si.m**3, 0, 18e-3 * si.kg / si.mol, 0]},
{"Cl": [2200 * si.kg / si.m**3, 1, 35.5e-3 * si.kg / si.mol, 0]},
{"Na": [2200 * si.kg / si.m**3, 1, 23e-3 * si.kg / si.mol, 0]},
)
aero_data = ppmc.AeroData(aero_data_arg)
volumes = [1, 2, 3]
sut = ppmc.AeroParticle(aero_data, volumes)
env_state = ppmc.EnvState(ENV_STATE_CTOR_ARG_MINIMAL)
aero_data = None
volumes = None
# act
mobility_diameter = sut.mobility_diameter(env_state)
env_state = None
gc.collect()
# assert
assert mobility_diameter is not None
@staticmethod
def test_density():
# arrange
aero_data_arg = (
{"H2O": [1000 * si.kg / si.m**3, 0, 18e-3 * si.kg / si.mol, 0]},
{"Cl": [2200 * si.kg / si.m**3, 1, 35.5e-3 * si.kg / si.mol, 0]},
{"Na": [2200 * si.kg / si.m**3, 1, 23e-3 * si.kg / si.mol, 0]},
)
aero_data = ppmc.AeroData(aero_data_arg)
volumes = [1, 2, 3]
sut = ppmc.AeroParticle(aero_data, volumes)
aero_data = None
volumes = None
gc.collect()
# act
density = sut.density
# assert
assert density == (1000 * 1 + 2200 * 2 + 2200 * 3) / 6
@staticmethod
def test_approx_crit_rel_humid():
# arrange
aero_data_arg = (
{"H2O": [1000 * si.kg / si.m**3, 0, 18e-3 * si.kg / si.mol, 0]},
{"Cl": [2200 * si.kg / si.m**3, 1, 35.5e-3 * si.kg / si.mol, 0]},
{"Na": [2200 * si.kg / si.m**3, 1, 23e-3 * si.kg / si.mol, 0]},
)
aero_data = ppmc.AeroData(aero_data_arg)
volumes = [1, 2, 3]
sut = ppmc.AeroParticle(aero_data, volumes)
env_state = ppmc.EnvState(ENV_STATE_CTOR_ARG_MINIMAL)
env_state.set_temperature(288)
aero_data = None
volumes = None
# act
approx_crit_rel_humid = sut.approx_crit_rel_humid(env_state)
env_state = None
gc.collect()
# assert
assert approx_crit_rel_humid is not None
@staticmethod
def test_crit_rel_humid():
# arrange
aero_data_arg = (
{"H2O": [1000 * si.kg / si.m**3, 0, 18e-3 * si.kg / si.mol, 0]},
{"Cl": [2200 * si.kg / si.m**3, 1, 35.5e-3 * si.kg / si.mol, 0]},
{"Na": [2200 * si.kg / si.m**3, 1, 23e-3 * si.kg / si.mol, 0]},
)
aero_data = ppmc.AeroData(aero_data_arg)
volumes = [1, 2, 3]
sut = ppmc.AeroParticle(aero_data, volumes)
env_state = ppmc.EnvState(ENV_STATE_CTOR_ARG_MINIMAL)
env_state.set_temperature(288)
aero_data = None
volumes = None
# act
crit_rel_humid = sut.crit_rel_humid(env_state)
env_state = None
gc.collect()
# assert
assert crit_rel_humid is not None
@staticmethod
def test_crit_diameter():
# arrange
aero_data_arg = (
{"H2O": [1000 * si.kg / si.m**3, 0, 18e-3 * si.kg / si.mol, 0]},
{"Cl": [2200 * si.kg / si.m**3, 1, 35.5e-3 * si.kg / si.mol, 0]},
{"Na": [2200 * si.kg / si.m**3, 1, 23e-3 * si.kg / si.mol, 0]},
)
aero_data = ppmc.AeroData(aero_data_arg)
volumes = [1, 2, 3]
sut = ppmc.AeroParticle(aero_data, volumes)
env_state = ppmc.EnvState(ENV_STATE_CTOR_ARG_MINIMAL)
env_state.set_temperature(288)
aero_data = None
volumes = None
# act
crit_diameter = sut.crit_diameter(env_state)
env_state = None
gc.collect()
# assert
assert crit_diameter is not None
@staticmethod
def test_coagulate():
# arrange
aero_data_arg = (
{"H2O": [1000 * si.kg / si.m**3, 0, 18e-3 * si.kg / si.mol, 0]},
{"Cl": [2200 * si.kg / si.m**3, 1, 35.5e-3 * si.kg / si.mol, 0]},
{"Na": [2200 * si.kg / si.m**3, 1, 23e-3 * si.kg / si.mol, 0]},
)
aero_data = ppmc.AeroData(aero_data_arg)
volumes_1 = [1, 2, 3]
volumes_2 = [3, 2, 1]
sut = ppmc.AeroParticle(aero_data, volumes_1)
aero_particle_2 = ppmc.AeroParticle(aero_data, volumes_2)
aero_data = None
volumes_1 = None
volumes_2 = None
gc.collect()
# act
coagulated = sut.coagulate(aero_particle_2)
# assert
assert coagulated.volumes == [4, 4, 4]
@staticmethod
def test_zero():
# arrange
aero_data_arg = (
{"H2O": [1000 * si.kg / si.m**3, 0, 18e-3 * si.kg / si.mol, 0]},
{"Cl": [2200 * si.kg / si.m**3, 1, 35.5e-3 * si.kg / si.mol, 0]},
{"Na": [2200 * si.kg / si.m**3, 1, 23e-3 * si.kg / si.mol, 0]},
)
aero_data = ppmc.AeroData(aero_data_arg)
volumes = [1, 2, 3]
sut = ppmc.AeroParticle(aero_data, volumes)
aero_data = None
volumes = None
gc.collect()
# act
sut.zero()
# assert
assert sut.volumes == [0, 0, 0]
@staticmethod
def test_set_vols():
# arrange
aero_data_arg = (
{"H2O": [1000 * si.kg / si.m**3, 0, 18e-3 * si.kg / si.mol, 0]},
{"Cl": [2200 * si.kg / si.m**3, 1, 35.5e-3 * si.kg / si.mol, 0]},
{"Na": [2200 * si.kg / si.m**3, 1, 23e-3 * si.kg / si.mol, 0]},
)
aero_data = ppmc.AeroData(aero_data_arg)
volumes = [1, 2, 3]
sut = ppmc.AeroParticle(aero_data, volumes)
aero_data = None
volumes = None
gc.collect()
# act
sut.set_vols([3, 2, 1])
# assert
assert sut.volumes == [3, 2, 1]
@staticmethod
def test_absorb_cross_sect():
# arrange
sut = ppmc.AeroParticle(ppmc.AeroData(AERO_DATA_CTOR_ARG_MINIMAL), [44])
# act
value = sut.absorb_cross_sect
# assert
assert value == 0
assert isinstance(value, float)
@staticmethod
def test_scatter_cross_sect():
# arrange
sut = ppmc.AeroParticle(ppmc.AeroData(AERO_DATA_CTOR_ARG_MINIMAL), [44])
# act
value = sut.scatter_cross_sect
# assert
assert value == 0
assert isinstance(value, float)
@staticmethod
def test_asymmetry():
# arrange
sut = ppmc.AeroParticle(ppmc.AeroData(AERO_DATA_CTOR_ARG_MINIMAL), [44])
# act
value = sut.asymmetry
# assert
assert value == 0
assert isinstance(value, float)
@staticmethod
def test_refract_shell():
# arrange
sut = ppmc.AeroParticle(ppmc.AeroData(AERO_DATA_CTOR_ARG_MINIMAL), [44])
# act
value = sut.refract_shell
# assert
assert value == 0 + 0j
assert isinstance(value, complex)
@staticmethod
def test_refract_core():
# arrange
sut = ppmc.AeroParticle(ppmc.AeroData(AERO_DATA_CTOR_ARG_MINIMAL), [44])
# act
value = sut.refract_core
# assert
assert value == 0 + 0j
assert isinstance(value, complex)
@staticmethod
def test_sources():
# arrange
aero_data = ppmc.AeroData(AERO_DATA_CTOR_ARG_MINIMAL)
aero_dist = ppmc.AeroDist(aero_data, AERO_DIST_CTOR_ARG_MINIMAL)
aero_state = ppmc.AeroState(aero_data, *AERO_STATE_CTOR_ARG_MINIMAL)
_ = aero_state.dist_sample(aero_dist, 1.0, 0.0)
sut = aero_state.particle(0)
# act
sources = sut.sources
# assert
assert len(sources) == aero_dist.n_mode
assert isinstance(sources[0], int)
@staticmethod
def test_least_create_time():
# arrange
create_time = 44.0
aero_data = ppmc.AeroData(AERO_DATA_CTOR_ARG_MINIMAL)
aero_dist = ppmc.AeroDist(aero_data, AERO_DIST_CTOR_ARG_MINIMAL)
aero_state = ppmc.AeroState(aero_data, *AERO_STATE_CTOR_ARG_MINIMAL)
_ = aero_state.dist_sample(aero_dist, 1.0, create_time)
# act
time = []
for i_part in range(len(aero_state)):
time.append(aero_state.particle(i_part).least_create_time)
# assert
assert np.all(np.isclose(time, create_time))
assert isinstance(time[0], float)
@staticmethod
def test_greatest_create_time():
# arrange
create_time = 44.0
aero_data = ppmc.AeroData(AERO_DATA_CTOR_ARG_MINIMAL)
aero_dist = ppmc.AeroDist(aero_data, AERO_DIST_CTOR_ARG_MINIMAL)
aero_state = ppmc.AeroState(aero_data, *AERO_STATE_CTOR_ARG_MINIMAL)
_ = aero_state.dist_sample(aero_dist, 1.0, create_time)
# act
time = []
for i_part in range(len(aero_state)):
time.append(aero_state.particle(i_part).greatest_create_time)
# assert
assert np.all(np.isclose(time, create_time))
assert isinstance(time[0], float)
@staticmethod
def test_id():
# arrange
aero_data = ppmc.AeroData(AERO_DATA_CTOR_ARG_MINIMAL)
aero_dist = ppmc.AeroDist(aero_data, AERO_DIST_CTOR_ARG_MINIMAL)
aero_state = ppmc.AeroState(aero_data, *AERO_STATE_CTOR_ARG_MINIMAL)
_ = aero_state.dist_sample(aero_dist, 1.0, 0.0)
# act
ids = []
for i_part in range(len(aero_state)):
ids.append(aero_state.particle(i_part).id)
# assert
assert isinstance(ids[0], int)
assert min(ids) > 0
assert len(np.unique(ids)) == len(aero_state)