| 16 | |
| 17 | |
| 18 | def test_lnorm(): |
| 19 | G = scope |
| 20 | choice = G.choice |
| 21 | uniform = G.uniform |
| 22 | quantized_uniform = G.quniform |
| 23 | |
| 24 | inker_size = quantized_uniform(low=0, high=7.99, q=2) + 3 |
| 25 | # -- test that it runs |
| 26 | lnorm = as_apply( |
| 27 | { |
| 28 | "kwargs": { |
| 29 | "inker_shape": (inker_size, inker_size), |
| 30 | "outker_shape": (inker_size, inker_size), |
| 31 | "remove_mean": choice([0, 1]), |
| 32 | "stretch": uniform(low=0, high=10), |
| 33 | "threshold": uniform( |
| 34 | low=old_div(0.1, np.sqrt(10.0)), high=10 * np.sqrt(10) |
| 35 | ), |
| 36 | } |
| 37 | } |
| 38 | ) |
| 39 | print(lnorm) |
| 40 | print(("len", len(str(lnorm)))) |
| 41 | # not sure what to assert |
| 42 | # ... this is too fragile |
| 43 | # assert len(str(lnorm)) == 980 |
| 44 | |
| 45 | |
| 46 | def test_sample_deterministic(): |