Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

A single Python distribution, Anaconda with Python 3.67, 64 bits is supported across all platforms (Mac, Windows, Linux). Anaconda includes the most important packages like numpy, matplotlib, pyqt5. Additional packages can be used in virtual environments (see below). Control system bindings and various toolboxes from the HLC team have to be made accessible by setting the PYTHONPATH environment variable; look up your operating system below for information on how to find them.

  • PyDOOCS (import pydoocs): Native access to DOOCS is provided by pydoocs for Mac and Linux platforms. Additional information can be found here: Python Client Interface
  • PyTINE (import PyTine): The PyTine TINE bindings are currently the only way to access the control system from Python on Windows.
  • HLC Toolbox: Several useful Python modules created by the HLC team.
Virtual environments hlc-linux, hlc-mac

As of March 2020, the HLC team maintains the virtual Anaconda environment hlc-linux and hlc-mac for the ttflinac and xfeloper users. hlc-linux supports the Ubuntu 16/amd64 platform (xfeluser1, xfeluser2), hlc-mac is for the control room macs running MacOS/amd64. The environments currently consist of Python 3.7 with the following pre-installed modulesThe Anaconda installation on control system Linux and Mac computers contains a number of packages selected by the HLC team. On other computers, users can create a similar setup as a virtual environment with the following command:

conda create --name hlc -linux python=3.7 cx_oracle keras matplotlib numexpr numpy pandas pymongo pyqt pyqtgraph pytorch scikit-learn scipy seaborn sphinx

You can use the The following command can be used to enable the hlc-linux such a custom environment:

conda activate hlc-linux

To deactivate it again (and get back to the default Python installation):

conda deactivate hlc-linux

In the future, the hlc-linux/hlc-mac environments will also be used to launch Python tools from the main taskbar.

App Installation

Python tools reside in ${HOME}/released_software/python, where ${HOME} is either /home/xfeloper for the XFEL or /home/ttflinac for FLASH. Writing to these directories requires doocsadm privileges. Installed Python tools must be traceable via a source code repository, preferably on the DOOCS GIT server. Installation is done with the script ${HOME}/released_software/scripts/release_software_package or similar tools. There is a launch command that makes sure that all the correct paths are set; start your main.py with: ${HOME}/released_software/scripts/pylaunch main.py

...

export PYTHONPATH=/local/lib/python3.7:/local/tine/lib:/home/xfeloper/released_software/python/hlc_toolbox_common

Windows Setup

The Anaconda Python package is available via NetInstall/DSM. Alternatively, you can download Anaconda yourself under http://continuum.io/downloads.

The PyTine bindings are distributed with the usual TINE installer, available via Netinstall/DSM for some, or via http://tine.desy.de/ for all (see Downloads/Windows Installer). For Python to find the PyTine module, you still need to set a PYTHONPATH environment variable that points to the directory containing PyTine.pyd (e.g. C:\tine\Python).

Linux Setup

Anaconda is installed under /opt/anaconda3. To make Anaconda your standard Python interpreter, add its bin directory to the beginning of your PATH, e.g. in your .bash_profile:

...

The PyTine bindings are installed under /usr/share/libtine/python/python3.6m 7m on most systems. If they are not, have an admin install the Debian package for you:

...

export PYTHONPATH=/local/lib/python3.7:/usr/share/libtine/python/python3.6m7m:/home/xfeloper/released_software/python/lib

QT

...

Windows Setup

The Anaconda Python package is available via NetInstall/DSM. Alternatively, you can download Anaconda yourself under http://continuum.io/downloads.

The PyTine bindings are distributed with the usual TINE installer, available via Netinstall/DSM for some, or via http://tine.desy.de/ for all (see Downloads/Windows Installer). For Python to find the PyTine module, you still need to set a PYTHONPATH environment variable that points to the directory containing PyTine.pyd (e.g. C:\tine\Python).

Integrated Development Environments (IDEs)

...