Assert error on n_in_dv in spectral sampling
Depending on the parameter values of the aerosol distribution, sometimes I need to lower significant to 5 or even 4. I haven't noticed a pattern for which values cause an error (e.g. sometimes N_a = 50 is fine sometimes it leads to error).
https://github.com/claresinger/PySDM/blob/e7840a3d3e18cd26df04f361504096769051fae2/examples/PySDM_examples/Singer_Ward/parcel.py#L58
https://github.com/claresinger/PySDM/blob/e7840a3d3e18cd26df04f361504096769051fae2/examples/PySDM_examples/Singer_Ward/aerosol.py#L53
I get errors like
AssertionError:
Items are not equal to 5 significant digits:
ACTUAL: 49998999.99999998
DESIRED: 49999999.99999999
So, the assert tells us that after performing sampling, the total aerosol number concentration differs from the analytical one by ca. 0.002%, which is clearly a small difference given that we only sample within a finite cdf range:
https://github.com/open-atmos/PySDM/blob/163b6d9b805cacfd9adc02023d776bff8f42dae9/PySDM/initialisation/sampling/spectral_sampling.py#L11
Increasing the number of super-droplets or altering the above range could help here (via the optional size_range argument to ConstantMultiplicity ctor)
closing as this is rather a feature than a bug, and both the assert and the error make sense