at.load.json#
Handling of JSON files
Functions
|
Save a |
|
Create a |
- load_json(filename, **kwargs)[source]#
Create a
Lattice
from a JSON file- Parameters:
filename (str) – Name of a JSON file
- Keyword Arguments:
* – All keywords update the lattice properties
- Returns:
lattice (Lattice) – New
Lattice
object
See also
Lattice.load()
for a generic lattice-loading method.
- save_json(ring, filename=None, compact=False)[source]#
Save a
Lattice
as a JSON file- Parameters:
ring (Lattice) – Lattice description
filename (str | None) – Name of the JSON file. Default: outputs on
sys.stdout
compact (bool) – If
False
(default), the JSON file is pretty-printed with line feeds and indentation. Otherwise, the output is a single line.
See also
save_lattice()
for a generic lattice-saving function.Lattice.save()
for a generic lattice-saving method.