Skip to main content

MaskedCells

GitHub source

MaskedCells

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:

TypeDescription
ndarrayA 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:

NameTypeDescriptionDefault
keysstrOptional list of attribute keys to include. If not provided, all attributes are included.()
fbIFeedbackOptional feedback object to report download progress.NoFeedback

Returns:

TypeDescription
DataFrameA 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:

NameTypeDescriptionDefault
dfDataFrameDataFrame containing the values for the active cells.required
maskndarray | NoneOptional new mask array. If provided, the mask will be updated.None
fbIFeedbackOptional feedback object to report progress.NoFeedback

validate

validate() -> None

Validate that all attributes have the correct length and mask is valid.

What is the reason for your feedback?