latform Documentation¶
latform is a Bmad lattice parser/formatter tool for parsing, formatting, analyzing, and comparing particle accelerator lattice files.
Installation¶
pip install latform
For development:
pip install -e ".[test]"
Quick Start¶
Format a lattice file and print to stdout:
latform my_lattice.bmad
Format in-place:
latform -i my_lattice.bmad
Preview what the formatter would change:
latform --diff my_lattice.bmad
Tools¶
latform provides these CLI commands:
- latform -- Format Bmad lattice files (and
tao.initnamelists) - latform-lint -- Lint lattice files without reformatting
- latform-apply -- Apply overrides/renames to a template file
- latform-template -- Expand a template set across instances
- latform-dump -- Extract parameters and element information
- latform-diff -- Compare two lattice files
- latform-gitdiff -- Compare a lattice file across git revisions
- latform-graph -- Visualize file dependency trees
- latform-lsp -- Language server for editor integration (optional
lspextra)
Documentation¶
- CLI Reference -- Full command-line usage for all tools
- Configuration -- Project settings via latform.toml / pyproject.toml
- Python API -- Using latform as a library
- Style Guide -- The formatting rules latform applies