evo.objects.typed.regular_masked_grid.MaskedCells
A dataset representing the cells of a masked regular 3D grid.
The order of the cells is in column-major order, i.e. for an unrotated grid: x changes fastest, then y, then z. Only active cells (where mask is True) have attribute values.
get_mask
get_mask(*, fb: IFeedback = NoFeedback) -> np.ndarray
Get the mask for the grid cells.
Returns:
| Type | Description |
|---|---|
ndarray
|
A boolean numpy array representing the mask for the grid cells. |
to_dataframe
to_dataframe(*keys: str, fb: IFeedback = NoFeedback) -> pd.DataFrame
Load a DataFrame containing the cell attribute values.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
keys
|
str
|
Optional list of attribute keys to include. If not provided, all attributes are included. |
()
|
fb
|
IFeedback
|
Optional feedback object to report download progress. |
NoFeedback
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
A DataFrame with cell attribute columns. |
from_dataframe
from_dataframe(df: DataFrame, mask: ndarray | None = None, *, fb: IFeedback = NoFeedback) -> None
Set the cell attributes from a DataFrame.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
df
|
DataFrame
|
DataFrame containing the values for the active cells. |
required |
mask
|
ndarray | None
|
Optional new mask array. If provided, the mask will be updated. |
None
|
fb
|
IFeedback
|
Optional feedback object to report progress. |
NoFeedback
|
validate
validate() -> None
Validate that all attributes have the correct length and mask is valid.