magnet.mesh.MeshDataset#
- class magnet.mesh.MeshDataset(list_of_meshes: list[Mesh], name: str | None = None)#
Bases:
Sequence
Dataset of mesh graphs.
List-like object that contains meshes.
- Parameters:
list_of_meshes (list of Mesh) – Meshes that form the dataset.
name (str, optional) – Name of the dataset (default is None).
- Variables:
meshes (list of Mesh) – The meshes that form the dataset.
name (str, optional) – Name of the dataset.
Notes
The implementation assumes that the dataset is always homogeneous (i.e. all meshes are either 2D or 3D, they are all homogeneous or heterogeneous), but there are no checks on this.
Constructor
Methods
__init__
(list_of_meshes[, name])add_mesh
(mesh)Add a mesh to the dataset.
merge
(other_dataset)Merge two datasets.
- add_mesh(mesh: Mesh) None #
Add a mesh to the dataset.
- Parameters:
mesh (Mesh) – The mesh to be added.
- Return type:
None
- merge(other_dataset: MeshDataset) None #
Merge two datasets.
- Parameters:
other_dataset (MeshDataset) – The dataset to be merged with this one.
- Return type:
None
Inherited Methods
count
(value)index
(value, [start, [stop]])Raises ValueError if the value is not present.