httk.atomistic.models.cell.view

A view presenting any cell backend as a Cell (the class representation).

Classes

CellView

A view presenting an underlying cell backend as a Cell.

Module Contents

class httk.atomistic.models.cell.view.CellView(obj, **hints)[source]

Bases: httk.atomistic.models.cell.view_base.CellViewBase, httk.atomistic.models.cell.cell.Cell

A view presenting an underlying cell backend as a Cell.

This view is a genuine Cell, so it can be passed anywhere a Cell is accepted. Its state is built lazily on first access from the backend.

Parameters:
property lengths: tuple[httk.core.SurdScalar, ...][source]

Present the backend’s native cell-vector lengths without re-deriving them.

Returns:

The three exact or backend-native cell-vector lengths.

Return type:

tuple[httk.core.SurdScalar, …]

property angles: tuple[fractions.Fraction, ...][source]

Present the backend’s native crystallographic angles without re-deriving them.

Returns:

The three cell angles in degrees.

Return type:

tuple[fractions.Fraction, …]

basis_floats()[source]

Present the backend’s native float basis when it has one, else the validated exact basis as floats.

Returns:

The three lattice vectors as float rows.

Return type:

list[list[float]]

unwrap()[source]

Return the raw object behind the backend.

Returns:

The unwrapped source object.

Return type:

Any

unview()[source]

Return this presentation as a standalone cell.

The original backend remains available through unwrap(). For a parameter backend with a non-special angle, the standalone basis uses that backend’s documented deterministic rational approximation.

Returns:

The standalone basis representation.

Return type:

httk.atomistic.models.cell.cell.Cell