EasyVVUQ icon indicating copy to clipboard operation
EasyVVUQ copied to clipboard

add test case showing problems with discrete distributions

Open fjansson opened this issue 5 years ago • 1 comments

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:

  1. non-integer points are generated (bug in chaospy, when generating quadratures for joint distributions, based on our slack discussions)
  2. the sample validator rejects already the first point where seed is an integer

fjansson avatar Jan 23 '20 13:01 fjansson

Could you please explicitly test for type using assert(isinstance(something, int)) in the test.

orbitfold avatar Jan 27 '20 10:01 orbitfold

This will be fixed with https://github.com/UCL-CCS/EasyVVUQ/issues/401

wedeling avatar Sep 27 '23 12:09 wedeling