bounds - Bounds handling¶
make_bounds_handler |
Return a bounds object which can update the bounds. |
ReflectBounds |
Reflect parameter values into bounded region |
ClipBounds |
Clip values to bounded region |
FoldBounds |
Wrap values into the bounded region |
RandomBounds |
Randomize values into the bounded region |
IgnoreBounds |
Leave values outside the bounded region |
Bounds handling.
Use bounds(low, high, style) to create a bounds handling object. This function operates on a point x, transforming it so that all dimensions are within the bounds. Options are available, including reflecting, wrapping, clipping or randomizing the point, or ignoring the bounds.
The returned bounds object should have an apply(x) method which transforms the point x.
-
bumps.dream.bounds.
make_bounds_handler
(bounds, style='reflect')[source]¶ Return a bounds object which can update the bounds.
Bounds handling style name is one of:
reflect: reflect off the boundary clip: stop at the boundary fold: wrap values to the other side of the boundary randomize: move to a random point in the bounds none: ignore the bounds
With semi-infinite intervals folding and randomizing aren’t well defined, and reflection is used instead.
With finite intervals the the reflected or folded point may still be outside the bounds (which can happen if the step size is too large), and a random uniform value is used instead.
-
class
bumps.dream.bounds.
ReflectBounds
(low, high)[source]¶ Bases:
bumps.dream.bounds.Bounds
Reflect parameter values into bounded region
-
apply
(y)[source]¶ Update x so all values lie within bounds
Returns x for convenience. E.g., y = bounds.apply(x+0)
-
c_interface
= None¶
-
high
= None¶
-
low
= None¶
-
-
class
bumps.dream.bounds.
ClipBounds
(low, high)[source]¶ Bases:
bumps.dream.bounds.Bounds
Clip values to bounded region
-
c_interface
= None¶
-
high
= None¶
-
low
= None¶
-
-
class
bumps.dream.bounds.
FoldBounds
(low, high)[source]¶ Bases:
bumps.dream.bounds.Bounds
Wrap values into the bounded region
-
c_interface
= None¶
-
high
= None¶
-
low
= None¶
-