EasyVVUQ
EasyVVUQ copied to clipboard
add test case showing problems with discrete distributions
This case varies a single variable, with a DiscreteUniform distribution.
vary = {
"seed": cp.DiscreteUniform(1, 2000),
}
Currently this test case fails:
{'seed': 1.0, 'Nc_0': 70000000.0, 'cf': 2.5, 'cn': 0.76, 'Rigc': 0.25, 'Prandtl': 0.3333333333333333, 'z0': 0.00016, 'l_sb': 1, 'Nh': 10, 'extent': 1000, 'nprocx': 1, 'nprocy': 1}
Identified errors were:
{'seed': ['must be of integer type']}
for a point in parameter space where seed is 1.0 - an integer but represented as float.
However - chaospy also generates non-integer points in this case. To see them, uncomment the line
# my_campaign.verify_all_runs = False
and run. The script prints all samples. The second point is
{'seed': 500.7500000000002, ...}
Two issues:
- non-integer points are generated (bug in chaospy, when generating quadratures for joint distributions, based on our slack discussions)
- the sample validator rejects already the first point where seed is an integer
Could you please explicitly test for type using assert(isinstance(something, int)) in the test.
This will be fixed with https://github.com/UCL-CCS/EasyVVUQ/issues/401