Python interface to MAD-NG running as a subprocess
Install via pip from PyPI:
pip install pymadng
Before diving into PyMAD-NG, we recommend you:
- Familiarise yourself with MAD-NG — understanding MAD-NG is essential.
- Read the Quick Start Guide to see how to control MAD-NG from Python.
- LHC Matching Example – Real-world optics matching with intermediate feedback.
- Examples Page - List of examples in an easy to read format.
- GitHub Examples Directory – List of avaliable examples on the repository
If anything seems unclear:
- Refer to the API Reference
- Check the MAD-NG Docs
- Or open an issue
Full documentation and example breakdowns are hosted at: https://pymadng.readthedocs.io/en/latest/
To build locally:
git clone https://github.com/MethodicalAcceleratorDesign/MAD-NG.py.git
cd MAD-NG.py/docs
make html
Examples are stored in the examples/
folder.
Run any script with:
python3 examples/ex-fodos.py
You can also batch-run everything using:
python3 runall.py
- High-level Python interface to MAD-NG
- Access to MAD-NG functions, sequences, optics, and tracking
- Dynamic
send()
andrecv()
communication - Python-native handling of MAD tables and expressions
- Optional integration with
pandas
andtfs-pandas
We welcome contributions! See CONTRIBUTING.md
or the Contributing Guide in the docs.
Bug reports, feature requests, and pull requests are encouraged.
PyMAD-NG is licensed under the GNU General Public License v3.0.
Built on top of MAD-NG, developed at CERN. This interface aims to bring MAD's power to the Python ecosystem with minimal friction.