httk.analyse.crysviz

Open httk structures in the CrysViz viewer.

Functions

to_payload(structure, *[, name, format])

Serialize an httk structure as an in-memory CrysViz payload.

show(*structures, **viewer_kwargs)

Open structures in CrysViz and return when its window is ready.

Module Contents

httk.analyse.crysviz.to_payload(structure, *, name=None, format='vasp-poscar')

Serialize an httk structure as an in-memory CrysViz payload.

Parameters:
  • structure (Any) – Structure to serialize.

  • name (str | None) – Optional filename for the payload, without a path.

  • format (str) – Serialization format, either "vasp-poscar" or "cif".

Returns:

A CrysViz payload containing the serialized structure.

Raises:
Return type:

Any

httk.analyse.crysviz.show(*structures, **viewer_kwargs)

Open structures in CrysViz and return when its window is ready.

Parameters:
  • *structures (Any) – CrysViz payloads, source paths, or httk structures to display.

  • **viewer_kwargs (Any) – Keyword arguments forwarded to crysviz.show.

Returns:

The ready CrysViz viewer, which also supports the context-manager protocol.

Raises:

ImportError – If CrysViz is not installed.

Return type:

Any

The call is non-blocking after the window is ready. Call viewer.wait() to block until the window closes.