at.load.json#
Handling of JSON files
Functions
|
Save a |
|
Create a |
- load_json(filename, **kwargs)[source]#
Create a
Latticefrom a JSON file- Parameters:
filename (str) – Name of a JSON file
- Keyword Arguments:
* – All keywords update the lattice properties
- Returns:
lattice (Lattice) – New
Latticeobject
See also
Lattice.load()for a generic lattice-loading method.
- save_json(ring, filename=None, compact=False)[source]#
Save a
Latticeas a JSON file- Parameters:
ring (Lattice) – Lattice description
filename (str | None) – Name of the JSON file. Default: outputs on
sys.stdoutcompact (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.