"""Single point in 2D space.

Dimensional: 0D manifold in 2D space.
"""

import torch

from torchmesh.mesh import Mesh


def load(device: str = "cpu") -> Mesh:
    """Create a mesh with a single point in 2D space.

    Args:
        device: Compute device ('cpu' or 'cuda')

    Returns:
        Mesh with n_manifold_dims=0, n_spatial_dims=2, n_cells=1
    """
    points = torch.tensor([[0.5, 0.5]], dtype=torch.float32, device=device)
    cells = torch.tensor([[0]], dtype=torch.int64, device=device)
    return Mesh(points=points, cells=cells)
