Grid

class compressed_kde.Grid

Bases: pybind11_object

Base class for evaluation grids.

Attributes Summary

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 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

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

Grid

static load_from_yaml(path) Grid

Load grid definition from file.

Parameters

path (string) – path to YAML file

Return type

Grid

points()

points -> array

Retrieve all grid values

Returns

array – grid values

Return type

(n, ndim) array

save_to_yaml(path) None

Save grid definition to YAML file.

Parameters

path (string) – path tho YAML file

to_yaml() str

Represent grid definition as YAML.

Return type

string