def __init__(self): super(BoundedFloatStrategy, self).__init__() self.inner_strategy = FixedBoundedFloatStrategy(0, 1) self.parameter = params.CompositeParameter( left=params.NormalParameter(0, 1), length=params.ExponentialParameter(1), spread=self.inner_strategy.parameter, )
def __init__(self, strategies, average_length=50.0): SearchStrategy.__init__(self) self.descriptor = _unique(x.descriptor for x in strategies) self.element_strategy = one_of_strategies(strategies) self.parameter = params.CompositeParameter( average_length=params.ExponentialParameter(1.0 / average_length), child_parameter=self.element_strategy.parameter, )
def test_exponential_errors_on_negative_mean(): with pytest.raises(ValueError): params.ExponentialParameter(-1)