Grid¶
- class compressed_kde.Grid¶
Bases:
pybind11_objectBase class for evaluation grids.
Attributes Summary
Grid type.
Dimensionality of grid.
Grid shape (number of grid points for each dimension.)
Grid size (total number of points in grid).
Validity of grid points.
Methods Summary
at_index(index)Retrieve grid values at index
from_yaml(str)Construct grid definition from YAML
load_from_yaml(path)Load grid definition from file.
points -> array
save_to_yaml(path)Save grid definition to YAML file.
to_yaml()Represent grid definition as YAML.
Attributes Documentation
- klass¶
Grid type.
- ndim¶
Dimensionality of grid.
- shape¶
Grid shape (number of grid points for each dimension.)
- size¶
Grid size (total number of points in grid).
- valid¶
Validity of grid points.
Methods Documentation
- at_index(index) array¶
Retrieve grid values at index
- Parameters
index ((ndim,) or (n,ndim) array) – Array of indices
- Returns
grid values at index
- Return type
array
- static from_yaml(str) Grid¶
Construct grid definition from YAML
- Parameters
string (string) – YAML string grid representation
- Return type
- static load_from_yaml(path) Grid¶
Load grid definition from file.
- Parameters
path (string) – path to YAML file
- Return type
- points()¶
points -> array
Retrieve all grid values
- Returns
array – grid values
- Return type
(n, ndim) array