exatomic.interfaces.xyz module

XYZ File Editor

exception exatomic.interfaces.xyz.InputError[source]

Bases: Exception

class exatomic.interfaces.xyz.Meta(name, bases, clsdict)[source]

Bases: TypedMeta

atom

alias of Atom

frame

alias of Frame

class exatomic.interfaces.xyz.XYZ(path_stream_or_string, as_interned=False, nprint=30, name=None, description=None, meta=None, encoding=None, ignore=False)[source]

Bases: Editor

An editor for programmatically editing xyz files.

parse_frame()[source]

Create a minimal Frame from the (parsed) Atom object.

parse_atom(unit='Angstrom', names=('symbol', 'x', 'y', 'z'))[source]

Parse the atom table from the current xyz file.

Parameters:

unit (str) – Default xyz unit of length is the Angstrom

write(path, trajectory=True, float_format='%    .8f')[source]

Write an xyz file (or files) to disk.

Parameters:
  • path (str) – Directory or file path

  • trajectory (bool) – Write xyz trajectory file (default) or individual

Returns:

path (str) – On success, return the directory or file path written

classmethod from_universe(universe, atom_table='atom', float_format='%    .8f')[source]

Create an xyz file editor from a given universe. If the universe has more than one frame, creates an xyz trajectory format editor.

Parameters:
  • universe – The universe

  • atom_table (str) – One of ‘atom’, ‘unit’, or ‘visual’ corresponding to coordinates

  • float_format (str) – Floating point format (for writing)

property atom
property frame