httk.atomistic.models.cell.params_view

A view presenting any cell backend as cell parameters (a, b, c, alpha, beta, gamma).

Classes

CellParamsView

A view presenting an underlying cell backend as cell parameters.

Module Contents

class httk.atomistic.models.cell.params_view.CellParamsView(obj, **hints)[source]

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

A view presenting an underlying cell backend as cell parameters.

This view is a genuine flat 6-tuple (a, b, c, alpha, beta, gamma) with the angles in degrees, built eagerly and immutable, with the elements also available as the named properties a/b/c/alpha/beta/gamma. Parameters carry no orientation, so converting a cell to parameters is lossy: reconstructing a cell from this view reproduces the lengths and angles, and reproduces volume only for a fully periodic source. The reconstruction inherits the fully periodic default, so this view discards the source periodicity as well as the original cell-vector orientation.

Parameters:
property a: float[source]

The length of the first cell vector.

Returns:

The first vector length.

Return type:

float

property b: float[source]

The length of the second cell vector.

Returns:

The second vector length.

Return type:

float

property c: float[source]

The length of the third cell vector.

Returns:

The third vector length.

Return type:

float

property alpha: float[source]

The angle between the second and third cell vectors, in degrees.

Returns:

The alpha angle.

Return type:

float

property beta: float[source]

The angle between the first and third cell vectors, in degrees.

Returns:

The beta angle.

Return type:

float

property gamma: float[source]

The angle between the first and second cell vectors, in degrees.

Returns:

The gamma angle.

Return type:

float

unwrap()[source]

Return the raw object behind the backend.

Returns:

The unwrapped source object.

Return type:

Any

unview()[source]

Return the presented parameters as a plain tuple.

Returns:

The six cell parameters.

Return type:

tuple[float, Ellipsis]