stencil
compression_safeguards.safeguards.stencil
Implementations for the provided StencilSafeguards.
Modules:
-
abc–Abstract base class for the stencil safeguards.
-
qoi–Implementations for the provided stencil quantity of interest (QoI) safeguards.
Classes:
-
BoundaryCondition–Different types of boundary conditions that can be applied to the data
-
NeighbourhoodAxis–Specification of the shape of the data neighbourhood along a single axis.
-
NeighbourhoodBoundaryAxis–Specification of the shape of the data neighbourhood and its boundary
BoundaryCondition
Bases: Enum
Different types of boundary conditions that can be applied to the data
array domain boundaries for StencilSafeguards.
Since stencil safeguards operate over small neighbourhoods of data points, points at the boundary, where part of the neighbourhood may not exist, need to be treated specially.
valid
class-attribute
instance-attribute
valid = auto()
The boundary is not extended, instead the safeguard is only applied to and checked for points where the entire neighbourhood is valid.
- Provided safeguards Error Bounds on derived Quantities of Interest (QoIs)
- API Reference compression_safeguards
- API Reference compression_safeguards api Safeguards
constant
class-attribute
instance-attribute
constant = auto()
The boundary is extended by a constant value.
reflect
class-attribute
instance-attribute
reflect = auto()
The boundary is extended by reflecting along the edge value. The edge value itself is not repeated.
symmetric
class-attribute
instance-attribute
symmetric = auto()
The boundary is extended by reflecting after the edge value. The edge value itself is repeated as well.
wrap
class-attribute
instance-attribute
wrap = auto()
The boundary is extended by wrapping the domain around, as if the domain was on a torus (Pac-Man style).
- API Reference compression_safeguards api Safeguards
NeighbourhoodAxis
Specification of the shape of the data neighbourhood along a single axis.
| Parameters: |
|
|---|
| Raises: |
|
|---|
NeighbourhoodBoundaryAxis
NeighbourhoodBoundaryAxis(
axis: int,
before: int,
after: int,
boundary: str | BoundaryCondition,
constant_boundary: None
| int
| float
| str
| Parameter = None,
)
Specification of the shape of the data neighbourhood and its boundary condition along a single axis.
| Parameters: |
|
|---|
| Raises: |
|
|---|
Methods:
-
get_config–Returns the configuration of the data neighbourhood.
-
from_config–Instantiate the data neighbourhood from a configuration
dict.
before
property
before: int
The non-negative number of values to include before the centre of a data neighbourhood.
after
property
after: int
The non-negative number of values to include after the centre of a data neighbourhood.
boundary
property
boundary: BoundaryCondition
The boundary condition that is applied to this axis near the data array domain boundary to fill the data neighbourhood, e.g. by extending values.
constant_boundary
property
The optional value of or the late-bound parameter name for the constant value with which the data array domain is extended for a constant boundary.