- AlmaLinux 8.9
- python: 3.11.6
- numpy (install by
conda
) - pyyaml (install by
conda
) - pyside2 (install by
conda
) - qt5-qtbase-devel (install by
yum
) - xorg-x11-server-Xvfb (optional, install by
yum
) - qasync (install by
conda -c conda-forge
) - black (optional)
- flake8 (optional)
- isort (optional)
- mypy (optional)
- documenteer (optional)
- pytest (optional, install by
conda
) - pytest-flake8 (optional, install by
conda -c conda-forge
) - pytest-qt (optional, install by
conda -c conda-forge
) - pytest-xvfb (optional, install by
conda -c conda-forge
)
This code is automatically formatted by black
using a git pre-commit hook (see .pre-commit-config.yaml
).
To enable this, see pre-commit.
To build project documentation, run package-docs build
to build the documentation.
To clean the built documents, use package-docs clean
.
See Building single-package documentation locally for further details.
You need to set the QT environment variables:
export QT_API="PySide2"
export PYTEST_QT_API="PySide2"
Forward GUI by:
xhost local:root
docker run -it --rm -e DISPLAY -v ${path_to_this_package}:${path_of_package_in_container} -v /tmp/.X11-unix:/tmp/.X11-unix ${docker_image}:${image_tag}
-
Setup the x11 by following: x11_docker_mac.
-
Forward GUI by:
xhost +
IP=$(ifconfig en0 | grep inet | awk '$1=="inet" {print $2}')
docker run -it --rm -e DISPLAY=${IP}:0 -v ${path_to_this_package}:${path_of_package_in_container} -v /tmp/.X11-unix:/tmp/.X11-unix ${docker_image}:${image_tag}
You need to setup the QT environment with:
export QT_MAC_WANTS_LAYER=1
export QT_MAC_USE_NSWINDOW=1
You may need to setup the PYTHONPATH to point to python/
directory as well.
The executable (run_m2gui
) is under the bin/
directory.
Use the argument of -h
to know the available options.
The logged message will be under the log/
directory.
The environment variable TS_CONFIG_MTTCS_DIR specifies ts_config_mttcs directory for GUI started in the simulation mode.
You can run the unit tests by:
pytest tests/
If you have the Xvfb and pytest-xvfb installed, you will not see the prompted windows when running the unit tests.
Note: If the variable of PYTEST_QT_API
is not set, you might get the core dump error in the test.
The class diagrams are in here.
You can use the PlantUML to read them.
QT is an event-based framework and the signal plays an important role among classes.
The emit()
and connect()
in the class diagrams mean the class emits a specific siganl or connects it to a specific callback function.
The environment variable PATH_PLANTUML is required to indicate the position of plantuml.jar.
Otherwise, the default position will be used.