MadQt is a python GUI for interactive accelerator simulations using MAD-X or Bmad/tao.
Needs to be built manually:
- cpymad (for MAD-X models, see installation instructions)
- pytao (for Bmad/tao models)
- minrpc (common dependency of both cpymad and pytao)
These are likely to be available in your system repositories:
These can easily be installed via PyPI (pip install ...
) if unavailable
in your repositories:
After installing the dependencies, open a terminal in the project folder and type:
python setup.py install
Now, you should be able to start MadQt with the command:
madqt
or:
python -m madqt
MadQt can be run with PyQt4 or PyQt5. To select either backend, set the
environment variable PYQT_API
:
export PYQT_API=pyqt # require PyQt4
export PYQT_API=pyqt5,pyqt # prefer PyQt5, fallback to PyQt4
Coding:
- Try to be consistent with PEP8 and PEP257.
- Add unit tests for all non-trivial functionality.
- Dependency injection is a great pattern to keep modules testable.
- Prefer composition over inheritance
- Add sphinx style docstrings for all modules, classes, functions
Naming:
- Stick to
names_with_underscores
for methods and variable names as mandated by PEP8 (I admit that the code base is currently very inconsistent in this regard) - class names are in
CamelCase
- only PyQt class method overrides and their parameters shall be written in
lowerCamelCase
Version control:
Commits should be reversible, independent units if possible. Use descriptive titles and also add an explaining commit message unless the modification is trivial. See also: A Note About Git Commit Messages.