MultiBlock.inferred_type

MultiBlock.inferred_type#

property MultiBlock.inferred_type: str[source]#

Return the generic type of this composite inferred from its blocks.

Nested blocks of the same class at the same depth are described together, so every MultiBlock at one level shares a single MultiBlock[...]. A composite without blocks is a bare MultiBlock.

Added in version 0.50.

Examples#

Download Python source code | Download Jupyter notebook

>>> import pyvista as pv
>>> multi = pv.MultiBlock([pv.Sphere(), pv.Cube()])
>>> multi.inferred_type
'MultiBlock[PolyData]'

Nested and empty blocks are included.

>>> nested = pv.MultiBlock([multi, pv.ImageData(), None])
>>> nested.inferred_type
'MultiBlock[ImageData | MultiBlock[PolyData] | None]'

See Also#

block_types
nested_block_types