MeshLike

Contents

MeshLike#

MeshLike#

Type alias for any accepted mesh specification, including an existing Mesh.

This is a superset of MeshCodeType; it additionally accepts a Mesh instance, which is passed through unchanged.

See also

MeshCodeType

Accepted forms that do not include Mesh itself.

Mesh.parse

Normalizes any MeshLike value into a Mesh.

Examples

>>> from psi_io.mesh import Mesh
>>> m = Mesh.parse(0b101, ndim=3)
>>> Mesh.parse(m, ndim=3) is m   # Mesh passthrough
True
>>> str(Mesh.parse('half', ndim=2))
'HALF, HALF'

alias of Mesh | bool | int | Literal[‘main’, ‘half’] | Sequence[Any]