Skip to content

Commit

Permalink
update the development section
Browse files Browse the repository at this point in the history
update the quickstart
update running
  • Loading branch information
wkerzendorf committed Jul 22, 2019
1 parent 595aba5 commit baec4c4
Show file tree
Hide file tree
Showing 16 changed files with 114 additions and 95 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,32 @@ workflow is taken from `Astropy <http://docs.astropy.org
/en/stable/development/workflow/development_workflow.html>`_ and credit belongs
to the Astropy team for designing it.

.. toctree::
:maxdepth: 2

running_tests
issues



.. toctree::
:maxdepth: 2
:caption: Git and coding workflow

git_workflow
release_workflow


.. toctree::
:maxdepth: 2
:caption: TARDIS core team instructions

release_workflow
update_refdata
continuous_integration
developer_faq



.. toctree::

continuous_integration


4 changes: 1 addition & 3 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,7 @@ assistance.
:caption: Developers Guide
:hidden:

development/issues
development/development_workflow
running_tests
development/index
CHANGELOG.md


Expand Down
3 changes: 3 additions & 0 deletions docs/quickstart/quickstart.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1189,6 +1189,9 @@
}
],
"metadata": {
"nbsphinx": {
"execute": "auto"
},
"kernelspec": {
"display_name": "Python 3",
"language": "python",
Expand Down
34 changes: 34 additions & 0 deletions docs/running/commandline.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
Running TARDIS in the commandline
=================================

.. warning::

This option will be removed in the next versions of TARDIS


After installing TARDIS just download the configuration file from the
`tardis-setups <https://github.com/tardis-sn/tardis-setups>`_ and the standard
atomic data set from the `tardis-refdata
<https://github.com/tardis-sn/tardis-refdata>`_ repository and run TARDIS.
Assuming you have ``wget``, you could follow the procedure:


.. code-block:: none
mkdir tardis_example
cd tardis_example
wget https://raw.githubusercontent.com/tardis-sn/tardis-setups/master/2014/2014_kerzendorf_sim/appendix_A1/tardis_example.yml
wget https://github.com/tardis-sn/tardis-refdata/raw/master/atom_data/kurucz_cd23_chianti_H_He.h5
tardis tardis_example.yml output_spectrum.dat
Then plot the output_spectrum.dat with your favourite plotting program. Here's an example how to do this with python.
(The only thing you need to install is ipython and matplotlib - in addition to TARDIS's requirements)

.. code-block:: python
ipython --pylab
>>> tardis_spec = loadtxt('output_spectrum.dat')
>>> plot(tardis_spec[:,0], tardis_spec[:,1])
More atomic datasets can be downloaded from :ref:`atomic-data-download`.
4 changes: 2 additions & 2 deletions docs/running/configuration/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ and pages provide more details concerning the TARDIS configuration process.


.. toctree::
:maxdepth: 3
:maxdepth: 2

configuration
config_validator
read_configuration.ipynb
read_configuration
58 changes: 52 additions & 6 deletions docs/running/gui.rst
Original file line number Diff line number Diff line change
@@ -1,23 +1,69 @@
.. _gui_explanation:
.. _gui:

************************
Graphical User Interface
************************


TARDIS uses the `PyQt4 framework <http://www.riverbankcomputing.com/software/pyqt/download>`_ for its cross-platform
interface.

The GUI runs through the `IPython Interpreter <http://ipython.org/install.html>`_ which should be started with the
command ``ipython --pylab=qt4``, so that it has acess to pylab.

Creating an instance of the :class:`ModelViewer`-class requires that PyQt4/PySide has already been initialized in
IPython. The above command to start IPython accomplishes this.

gui.py contains all the classes used to create the GUI for Tardis.

This module must be imported inside IPython console started above. The console provides the event loop and the place
to create/calculate the tardis model. So the module is basically a tool to visualize results.
to create/calculate the tardis model. So the module is basically a tool to visualize results.

**To setup and 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. Currently, the TARDIS team uses PyQT4

**1**. Installing required packages

.. code-block:: shell
conda activate tardis
conda install pyqt=4.8.7
**2**. Choosing between PySide and PyQt4

.. code-block:: shell
#To choose PySide
export QT_API=pyside
#To choose PyQt - this is what the TARDIS team does
export QT_API=pyqt
**3**. An example of creating a model and GUI

To show the gui from the ipython shell use the following commands.

.. code-block:: shell
jupyter notebook
.. code-block:: python
from tardis import run_tardis
from tardis.gui import interface
sim = run_tardis('yamlconfigfile.yml', 'atomdatafile.h5')
interface.show(sim)
If you just want to run from a configuration file and show the results, you can
do that outside the jupyter notebook. Navigate to the folder where you
installed tardis and go to tardis/tardis/gui, and use the following command.

.. code-block:: none
python interface.py path-to-yaml-configuration-file path-to-atomic-data-file
Running Instructions
--------------------
Expand Down
88 changes: 7 additions & 81 deletions docs/running/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,19 @@
Running TARDIS
**************

The TARDIS code needs three components to calculate spectra: 1) an Atom Database
The TARDIS code needs three components to calculate spectra: 1) an atom database
2) a model 3) a configuration file. The Atom Database is created by the
`Carsus <https://tardis-sn.github.io/carsus/>`_ subpackage. A quick start guide
to run TARDIS can be found :ref:`here <quickstart>`



.. toctree::
:maxdepth: 2

commandline
gui

.. _quickstart:


Expand All @@ -24,86 +30,6 @@ have full access to the model properties (as described in :ref:`physical_quantit
examples/run_simple_example.ipynb


Running TARDIS in the commandline
=================================

After installing TARDIS just download the configuration file from the
`tardis-setups <https://github.com/tardis-sn/tardis-setups>`_ and the standard
atomic data set from the `tardis-refdata
<https://github.com/tardis-sn/tardis-refdata>`_ repository and run TARDIS.
Assuming you have ``wget``, you could follow the procedure:


.. code-block:: none
mkdir tardis_example
cd tardis_example
wget https://raw.githubusercontent.com/tardis-sn/tardis-setups/master/2014/2014_kerzendorf_sim/appendix_A1/tardis_example.yml
wget https://github.com/tardis-sn/tardis-refdata/raw/master/atom_data/kurucz_cd23_chianti_H_He.h5
tardis tardis_example.yml output_spectrum.dat
Then plot the output_spectrum.dat with your favourite plotting program. Here's an example how to do this with python.
(The only thing you need to install is ipython and matplotlib - in addition to TARDIS's requirements)

.. code-block:: python
ipython --pylab
>>> tardis_spec = loadtxt('output_spectrum.dat')
>>> plot(tardis_spec[:,0], tardis_spec[:,1])
More atomic datasets can be downloaded from :ref:`atomic-data-download`.


Graphical User Interface
========================

To get a detailed explanation on gui layout go to :ref:`gui_explanation` .

**To setup and 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

.. code-block:: none
#To choose PySide
export QT_API=pyside
#To choose PyQt
export QT_API=pyqt
**3**. An example of creating a model and GUI

To show the gui from the ipython shell use the following commands.

.. code-block:: none
ipython --pylab=qt4
.. code-block:: python
>>> from tardis import run_tardis
>>> mdl = run_tardis('yamlconfigfile.yml', 'atomdatafile.h5')
>>> from tardis.gui import interface
>>> interface.show(mdl)
If you just want to run from a configuration file and show the results, you can
do that outside the ipython shell.To do this navigate to the folder where you
installed tardis and go to tardis/tardis/gui, and use the following command.

.. code-block:: none

python interface.py path-to-yaml-configuration-file path-to-atomic-data-file

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit baec4c4

Please sign in to comment.