Partitioned Datasets#
The pyvista.PartitionedDataSet
class is a partitioned dataset that encapsulates
a dataset consisting of partitions. PartitionedDataSet
behaves mostly like a list.
List-like Features#
Create an empty partitioned dataset
import pyvista as pv
from pyvista import examples
partitions = pv.PartitionedDataSet()
partitions
Information | Partitions | ||||||
---|---|---|---|---|---|---|---|
|
|
Add some data to the collection.
partitions.append(pv.Sphere())
partitions.append(pv.Cube(center=(0, 0, -1)))
PartitionedDataSet
is List-like so that individual partitions can be accessed via
indices.
partitions[0] # Sphere
Header | Data Arrays | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
The length of the partition can be accessed through len()
len(partitions)
2
or through the n_partitions
attribute
partitions.n_partitions
2
More specifically, PartitionedDataSet
is a collections.abc.MutableSequence
and supports operations such as append, insert, etc.
partitions.append(pv.Cone())
partitions.reverse()
Warning
pop is not supported in PartitionedDataSet
class.
PartitionedDataSet
also supports slicing to get or set partitions.
partitions[0:2] # The Sphere and Cube objects in a new ``PartitionedDataSet``
Information | Partitions | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
|
|
PartitionedDataSet API Reference#
The pyvista.PartitionedDataSet
class holds attributes that
are common to all spatially referenced datasets in PyVista. This
base class is analogous to VTK’s vtk.vtkPartitionedDataSetDataSet class.
|
Wrapper for the |