Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gui.py and running.rst edited for PyQt4 and PySide #251

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 38 additions & 2 deletions docs/running.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,42 @@ This model can then be used for inspecting the run as described
Graphical User Interface
========================

A graphical user interface is being developed for this code using QT.
We envision to have this available in the next few minor releases.
**To run the GUI(under development) follow these steps:**

The gui can use one of two python bindings for qt, namely PyQt4
and PySide. You can choose which binding is used by setting the
environment variable QT_API in your bash.

**1**. Installing required packages

.. code-block:: none

source activate tardis
conda install ipython=3.0.0 pyside=1.2.1 shiboken=1.2.1


**2**. Choosing between PySide and PyQt4 (optional)

.. code-block:: none

#To choose PySide
export QT_API=pyside

#To go back to PyQt4
unset QT_API

**3**. An example of creating a model and GUI

As of now, the GUI can be started from the ipython shell. Currently there is no way to work completely from inside the GUI.

.. code-block:: none

ipython --pylab=qt4

.. code-block:: python

>>> from tardis import run_tardis
>>> mdl = run_tardis('tardis_example.yml', 'kurucz_cd23_chianti_H_He.h5')
>>> from tardis import gui
>>> mdviewer = gui.ModelViewer()
>>> mdviewer.show_model(mdl)
7 changes: 6 additions & 1 deletion tardis/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@
from matplotlib.figure import *
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.backends.backend_qt4 import NavigationToolbar2QT as NavigationToolbar
from PySide import QtGui, QtCore
import os
if os.environ.get('QT_API', None) is None:
from PyQt4 import QtGui, QtCore
else:
from PySide import QtGui, QtCore

from astropy import units as u
from tardis import analysis, util

Expand Down