-
Notifications
You must be signed in to change notification settings - Fork 46
Recipes
(this recipe was "stolen" from an internal doc from Sergi Rubio)
Warning: this uses an experimental API and may break some widgets
GUI's subscribing to hundred of events may have an slow startup It has been partially solved in Tango > 9.2.6, anyway you may try this recipe to start the GUI in polling mode and subscribe events later.
At the beginning of your __main__
method:
from taurus.qt.qtcore.util.emitter import DelayedSubscriber
print('Disabling events '+'<'*40)
print(type(options.no_tango_events),options.no_tango_events)
taurus.Manager().changeDefaultPollingPeriod(9000)
taurus.Factory('tango').set_tango_subscribe_enabled(0)
To reenable events and start Delayed subscription
print('Reenabling events '+'<'*40)
subscriber = DelayedSubscriber('tango',parent=app,
sleep=10e3,pause=5)
It is possible to create a CONDA environment from YML file. This can be useful to create environments with Taurus dependencies in order to test Taurus.
Recipe for creating Conda environment for installing Taurus dependencies for python2 PyQt4. Create YML file (py2_qt4_env.yml) with the following content:
name: py2-qt4
channels:
- anaconda
- conda-forge
- tango-controls
dependencies:
- python=2.7
- numpy
- pint
- future
- lxml
- ply
- pyqt=4
- cython
- guidata
- pytango
Create the environment from a terminal:
conda env create -f py2_qt4_env.yml
Activate the environment:
conda activate py2-qt4
Install guiqwt from inside the environment:
pip install guiqwt
Finally, install Taurus from the folder where the code is checked out
pip install --no-deps -e .