DataSetAttributes.valid_array_len

DataSetAttributes.valid_array_len#

property DataSetAttributes.valid_array_len: int | None[source]#

Return the length data should be when added to the dataset.

If there are no restrictions, returns None.

Returns:
Optional[int]

Length data should be when added to the dataset.

Examples#

Download Python source code | Download Jupyter notebook

Show that valid array lengths match the number of points and cells for point and cell arrays, and there is no length limit for field data.

>>> import pyvista as pv
>>> mesh = pv.Cube()
>>> mesh.n_points, mesh.n_cells
(8, 6)
>>> mesh.point_data.valid_array_len
8
>>> mesh.cell_data.valid_array_len
6
>>> mesh.field_data.valid_array_len is None
True