Skip to content

typing

Module for type hints.

This module provides type hints for various data structures used throughout the quansino package. These type hints help ensure type safety and improve code readability by clearly defining the expected data types and structures.

Examples:

from quansino.typing import Positions, Forces, Cell

positions: Positions = np.zeros((100, 3))
forces: Forces = np.random.random((100, 3))
cell: Cell = np.eye(3) * 10.0

AtomicNumbers module-attribute

AtomicNumbers = ndarray[tuple[int], dtype[integer]]

Type hint for an array of atomic numbers.

Cell module-attribute

Cell = ndarray[tuple[3, 3], dtype[floating]]

Type hint for a 3x3 array of floating point numbers representing a cell.

Center module-attribute

Center = list[float] | tuple[float] | ndarray[tuple[3], dtype[floating]]

Type hint for a 3D center point.

Connectivity module-attribute

Connectivity = ndarray[tuple[int, int], dtype[integer]]

Type hint for an array of integer pairs representing atom connectivity.

Displacement module-attribute

Displacement = ndarray[tuple[3], dtype[floating]]

Type hint for a 3D displacement vector.

Forces module-attribute

Forces = ndarray[tuple[int, 3], dtype[floating]]

Type hint for an array of 3D force vectors.

IntegerArray module-attribute

IntegerArray = list[int] | tuple[int] | ndarray[tuple[int], dtype[integer]]

Type hint for an array of integers.

Masses module-attribute

Masses = ndarray[tuple[int], dtype[floating]] | ndarray[tuple[int, 3], dtype[floating]]

Type hint for an array of masses.

Positions module-attribute

Positions = ndarray[tuple[int, 3], dtype[floating]]

Type hint for an array of 3D positions.

Strain module-attribute

Strain = ndarray[tuple[6], dtype[floating]]

Type hint for a 6-element array of floating point numbers representing a strain tensor.

Stress module-attribute

Stress = ndarray[tuple[6], dtype[floating]]

Type hint for a 6-element array of floating point numbers representing a stress tensor.

Velocities module-attribute

Velocities = ndarray[tuple[int, 3], dtype[floating]]

Type hint for an array of 3D velocities.