Skip to content

Latest commit

 

History

History
49 lines (38 loc) · 1.59 KB

grids.rst

File metadata and controls

49 lines (38 loc) · 1.59 KB

Grids

A "Grid" in spexxy is anything that provides any kind of data in a regularly spaced parameter space. The base class for all Grids is :class:`spexxy.grid.Grid`, which also defines some convenience methods.

The usual way of getting data from a grid is by calling it with the requested parameters:

grid = Grid()
data = grid((3.14, 42.))

A class inheriting from :class:`Grid <spexxy.grid.Grid>` must call Grid's constructor with a list of :class:`GridAxis <spexxy.grid.GridAxis>` objects that describe the axes of the grid, i.e. their names and possbile values. Furthermore it must overwrite all necessary methods, in particular :meth:`__call__() <spexxy.grid.Grid.__call__>`, :meth:`__contains__() <spexxy.grid.Grid.__contains__>`, and :meth:`all() <spexxy.grid.Grid.all>`. See the implementation of :class:`ValuesGrid <spexxy.grid.ValuesGrid>` for a simple example.

spexxy comes with two pre-defined grids:

Grid

.. autoclass:: spexxy.grid.Grid
    :members:

GridAxis

.. autoclass:: spexxy.grid.GridAxis
    :members:

ValuesGrid

.. autoclass:: spexxy.grid.ValuesGrid
    :members:

FilesGrid

.. autoclass:: spexxy.grid.FilesGrid
    :members:

SynspecGrid

.. autoclass:: spexxy.grid.SynspecGrid
    :members: