httk.atomistic.numeric_unitcell_structure_view

A plain-numpy presentation of a structure backend.

Classes

NumericUnitcellStructureView

A plain-numpy presentation of a Structure.

Module Contents

class httk.atomistic.numeric_unitcell_structure_view.NumericUnitcellStructureView(obj: httk.atomistic.structure_like.StructureLike, **hints: Any)[source]

Bases: httk.atomistic.structure_view.StructureView

A plain-numpy presentation of a Structure.

Where a Structure holds its geometry exactly (a surd cell basis, rational reduced coordinates, and an exact Cartesian frame), this view mirrors that interface but returns plain numpy numbers: its cell is a NumericCell, its sites a NumericSites, and cartesian_sites() a float64 numpy array. The species/species_at_sites are passed through unchanged. It is for callers who do not need exact arithmetic and just want numpy arrays.

The presentation is numpy-backed, so constructing it requires numpy (the httk-atomistic[numpy] extra) and raises ImportError eagerly when it is unavailable. The exact object is always one hop away via exact.

This is a view, not a Structure subclass. Its exact Structure is built eagerly from the backend quartet during construction.

property cell: httk.atomistic.numeric_cell.NumericCell[source]

The cell as a NumericCell.

property sites: httk.atomistic.numeric_sites.NumericSites[source]

The sites as a NumericSites.

property species: tuple[httk.atomistic.species.Species, Ellipsis][source]

The distinct species, passed through unchanged.

property species_at_sites: tuple[str, Ellipsis][source]

The species name occupying each site, passed through unchanged.

cartesian_sites() httk.core.NumericVector[source]

The Cartesian site positions as an (N, 3) float64 numpy array.

property exact: httk.atomistic.structure.Structure[source]

The exact Structure this view presents.

unwrap() Any[source]

Return the raw object wrapped by the backend.