at.load.reprfile#

Text representation of a python AT lattice with each element represented by its repr() string

Functions

load_repr(filename, **kwargs)

Create a Lattice from a text repr-file

save_repr(ring[, filename])

Save a Lattice as a repr-file

load_repr(filename, **kwargs)[source]#

Create a Lattice from a text repr-file

Parameters:

filename (str) – Name of a ‘.m’ file

Keyword Arguments:
  • name (str) – Name of the lattice. Default: taken from the lattice

  • energy (float) – Energy of the lattice [eV]. Default: taken from the lattice elements

  • periodicity (int) – Number of periods. Default: taken from the elements, or 1

  • * – All other keywords will be set as Lattice attributes

Returns:

lattice (Lattice) – New Lattice object

See also

load_lattice() for a generic lattice-loading function.

save_repr(ring, filename=None)[source]#

Save a Lattice as a repr-file

Parameters:
  • ring (Lattice) – Lattice description

  • filename (str | None) – Name of the ‘.repr’ file. Default: outputs on sys.stdout

See also

save_lattice() for a generic lattice-saving function.