Coder Social home page Coder Social logo

ts_m2gui's Introduction

docs

M2 Graphical User Interface (GUI) in Python

Platform

  • AlmaLinux 8.9
  • python: 3.11.6

Needed Package

  • 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)

Code Format

This code is automatically formatted by black using a git pre-commit hook (see .pre-commit-config.yaml). To enable this, see pre-commit.

Build the Document

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.

Run GUI in Docker Container

You need to set the QT environment variables:

export QT_API="PySide2"
export PYTEST_QT_API="PySide2"

AlmaLinux

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}

MacOS

  1. Setup the x11 by following: x11_docker_mac.

  2. 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}

Run GUI without the LSST Docker Image on MacOS

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.

Executable

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.

Unit Tests

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.

Class Diagrams

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.

ts_m2gui's People

Contributors

pkubanek avatar teweitsai avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.