odatse.domain.meshgrid module#
- class odatse.domain.meshgrid.MeshGrid(info: Info = None, *, param: dict[str, Any] = None)[source]#
Bases:
DomainBaseMeshGrid class for handling grid data for the data analysis framework.
Initialize the MeshGrid object.
- Parameters:
info (Info, optional) – Information object containing algorithm parameters.
param (dict, optional) – Dictionary containing parameters for setting up the grid.
- __init__(info: Info = None, *, param: dict[str, Any] = None)[source]#
Initialize the MeshGrid object.
- Parameters:
info (Info, optional) – Information object containing algorithm parameters.
param (dict, optional) – Dictionary containing parameters for setting up the grid.
- _setup(info_param)[source]#
Setup the grid based on provided parameters.
- Parameters:
info_param – Dictionary containing parameters for setting up the grid.
- _setup_from_file(info_param)[source]#
Setup the grid from a file.
- Parameters:
info_param – Dictionary containing parameters for setting up the grid.
- _setup_grid(info_param)[source]#
Setup the grid based on min, max, and num lists.
- Parameters:
info_param – Dictionary containing parameters for setting up the grid.
- classmethod from_dict(param)[source]#
Create a MeshGrid object from a dictionary of parameters.
- Parameters:
param – Dictionary containing parameters for setting up the grid.
- Returns:
a MeshGrid object.
- Return type:
- odatse.domain.meshgrid.load_mesh_file(root_dir, info_param: dict, *, root_only: bool = False)[source]#
Read a mesh file on algorithm rank 0 and validate it on every algorithm rank.
This is the single mesh-file reader, shared by
MeshGrid(used bybayes,exchangeandpamc) and bymapper. It must be called on every rank of the algorithm layer (it is collective overalgcomm), and only there.- Parameters:
root_dir (Path) – Directory that a relative
mesh_pathis resolved against.info_param (dict) –
mesh_path(required) and the optionalcomments,delimiterandskiprowspassed tonumpy.loadtxt.root_only (bool) – If True, the rows are returned on algorithm rank 0 only (
Noneelsewhere); otherwise they are broadcast to every algorithm rank.
- Returns:
2-D array of rows
index x1 ... xD.- Return type:
np.ndarray or None
- Raises:
odatse.exception.InputError – on every algorithm rank, when the file cannot be read, has no data rows, or has no coordinate columns (fewer than two columns). The number of coordinates is not compared with the
dimensionof the algorithm: a mesh may hold the points in the solver’s coordinates (seetests/transform), and the solver dimension is checked when a point is evaluated.