httk.atomistic.models.structure.numeric_view ============================================ .. py:module:: httk.atomistic.models.structure.numeric_view .. autoapi-nested-parse:: A plain-numpy presentation of a structure backend. Classes ------- .. autoapisummary:: httk.atomistic.models.structure.numeric_view.NumericUnitcellStructureView Module Contents --------------- .. py:class:: NumericUnitcellStructureView(obj, **hints) Bases: :py:obj:`httk.atomistic.models.structure.semantics.StructureSemanticsMixin`, :py:obj:`httk.atomistic.models.structure.view.StructureView` A plain-numpy presentation of a :class:`~httk.atomistic.UnitcellStructure`. Where a ``UnitcellStructure`` 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 :attr:`cell` is a :class:`~httk.atomistic.models.cell.numeric.NumericCell`, its :attr:`sites` a :class:`~httk.atomistic.models.sites.numeric.NumericSites`, and :meth:`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 :class:`ImportError` eagerly when it is unavailable. The exact object is always one hop away via :attr:`exact`. This is a view, not a ``UnitcellStructure`` subclass. Its exact ``UnitcellStructure`` is built lazily on first access to exact geometry. :param obj: The structure backend or source to present. :param \*\*hints: Backend-selection hints passed to structure coercion. .. py:property:: cell :type: httk.atomistic.models.cell.numeric.NumericCell The cell as a :class:`~httk.atomistic.models.cell.numeric.NumericCell`. .. py:property:: sites :type: httk.atomistic.models.sites.numeric.NumericSites The sites as a :class:`~httk.atomistic.models.sites.numeric.NumericSites`. .. py:property:: species :type: tuple[httk.atomistic.models.species.species.Species, Ellipsis] The distinct species, passed through unchanged. .. py:property:: species_at_sites :type: tuple[str, Ellipsis] The species name occupying each site, passed through unchanged. .. py:property:: charge :type: float | None Expose the explicitly assigned charge as a floating-point value. .. py:property:: site_moments :type: httk.core.NumericVector | None Expose Cartesian site moments as numeric values. .. py:property:: assemblies :type: tuple[httk.atomistic.composition.Assembly, Ellipsis] | None Expose site correlations. .. py:method:: cartesian_sites() The Cartesian site positions as an ``(N, 3)`` ``float64`` numpy array. .. py:property:: periodicity :type: tuple[bool, bool, bool] Expose the cell's periodic directions. .. py:property:: nperiodic_dimensions :type: int Expose the number of periodic directions. .. py:property:: site_coordinate_span :type: str Expose the presented structure's coordinate span. .. py:property:: lattice_vectors :type: list[list[float]] Expose the cell vectors as numeric coordinates. .. py:property:: fractional_site_positions :type: list[list[float]] Expose reduced site positions as numeric coordinates. .. py:property:: cartesian_site_positions :type: list[list[float]] Expose Cartesian site positions as numeric coordinates. .. py:property:: exact :type: httk.atomistic.models.structure.unitcell.UnitcellStructure The exact :class:`~httk.atomistic.UnitcellStructure` this view presents. .. py:method:: unwrap() Return the raw object wrapped by the backend. .. py:method:: unview() Reject conversion to a standalone plain numeric value. :return: Never; this view has no standalone plain value. :raises TypeError: Always, because this view has no standalone plain value.