RegularBlockModel
RegularBlockModel
evo.blockmodels.typed.regular_block_model.RegularBlockModel
A typed wrapper for regular block models providing pandas DataFrame access.
This class provides a high-level interface for creating, retrieving, and updating regular block models with typed access to grid properties and cell data.
Example usage:
n_blocks
The number of blocks in each dimension.
block_size
The size of each block in each dimension.
rotations
The rotations applied to the block model.
__init__
Initialize a RegularBlockModel instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
client | BlockModelAPIClient | The BlockModelAPIClient used for API operations. | required |
metadata | BlockModel | The block model metadata. | required |
version | Version | The current version information. | required |
cell_data | DataFrame | The cell data as a pandas DataFrame. | required |
context | IContext | None | Optional IContext for report and other operations. | None |
create
Create a new regular block model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
context | IContext | The context containing environment, connector, and cache. | required |
data | RegularBlockModelData | The data defining the block model to create. | required |
path | str | None | Optional path for the block model in the workspace. | None |
fb | IFeedback | Optional feedback interface for progress reporting. | NoFeedback |
Returns:
| Type | Description |
|---|---|
RegularBlockModel | A RegularBlockModel instance representing the created block model. |
Raises:
| Type | Description |
|---|---|
ValueError | If the data is invalid. |
get
Retrieve an existing regular block model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
context | IContext | The context containing environment, connector, and cache. | required |
bm_id | UUID | The UUID of the block model to retrieve. | required |
version_id | UUID | None | Optional version UUID. Defaults to the latest version. | None |
columns | list[str] | None | Optional list of columns to retrieve. Defaults to all columns ["*"]. | None |
bbox | BBox | BBoxXYZ | None | Optional bounding box to filter the data. | None |
fb | IFeedback | Optional feedback interface for progress reporting. | NoFeedback |
Returns:
| Type | Description |
|---|---|
RegularBlockModel | A RegularBlockModel instance. |
Raises:
| Type | Description |
|---|---|
ValueError | If the block model is not a regular grid. |