From baec4c4d990bb60fe69d3540a799926bd957a71e Mon Sep 17 00:00:00 2001 From: Wolfgang Kerzendorf Date: Mon, 22 Jul 2019 11:32:47 -0400 Subject: [PATCH] update the development section update the quickstart update running --- .../{development_workflow.rst => index.rst} | 18 +++- docs/index.rst | 4 +- docs/quickstart/quickstart.ipynb | 3 + docs/running/commandline.rst | 34 +++++++ docs/running/configuration/index.rst | 4 +- docs/running/gui.rst | 58 ++++++++++-- docs/running/index.rst | 88 ++----------------- .../Custom_TARDIS_Model_Tutorial.ipynb | 0 docs/{ => running}/notebooks/data/abund.dat | 0 .../notebooks/data/config_init_trad.yml | 0 .../notebooks/data/config_no_init_trad.yml | 0 docs/{ => running}/notebooks/data/density.txt | 0 docs/{ => running}/notebooks/hdf_writer.ipynb | 0 .../notebooks/init_trad_bug.ipynb | 0 .../notebooks/isotope_pd_subclass.ipynb | 0 docs/{ => running}/notebooks/to_hdf.ipynb | 0 16 files changed, 114 insertions(+), 95 deletions(-) rename docs/development/{development_workflow.rst => index.rst} (73%) create mode 100644 docs/running/commandline.rst rename docs/{ => running}/notebooks/Custom_TARDIS_Model_Tutorial.ipynb (100%) rename docs/{ => running}/notebooks/data/abund.dat (100%) rename docs/{ => running}/notebooks/data/config_init_trad.yml (100%) rename docs/{ => running}/notebooks/data/config_no_init_trad.yml (100%) rename docs/{ => running}/notebooks/data/density.txt (100%) rename docs/{ => running}/notebooks/hdf_writer.ipynb (100%) rename docs/{ => running}/notebooks/init_trad_bug.ipynb (100%) rename docs/{ => running}/notebooks/isotope_pd_subclass.ipynb (100%) rename docs/{ => running}/notebooks/to_hdf.ipynb (100%) diff --git a/docs/development/development_workflow.rst b/docs/development/index.rst similarity index 73% rename from docs/development/development_workflow.rst rename to docs/development/index.rst index 99693e9e5c7..e4fe42e68e9 100644 --- a/docs/development/development_workflow.rst +++ b/docs/development/index.rst @@ -8,20 +8,32 @@ workflow is taken from `Astropy `_ 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 diff --git a/docs/index.rst b/docs/index.rst index 07a24b5af94..5c872f2816a 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -87,9 +87,7 @@ assistance. :caption: Developers Guide :hidden: - development/issues - development/development_workflow - running_tests + development/index CHANGELOG.md diff --git a/docs/quickstart/quickstart.ipynb b/docs/quickstart/quickstart.ipynb index b5ffc273cca..bbb8ff63a31 100644 --- a/docs/quickstart/quickstart.ipynb +++ b/docs/quickstart/quickstart.ipynb @@ -1189,6 +1189,9 @@ } ], "metadata": { + "nbsphinx": { + "execute": "auto" + }, "kernelspec": { "display_name": "Python 3", "language": "python", diff --git a/docs/running/commandline.rst b/docs/running/commandline.rst new file mode 100644 index 00000000000..e480552da88 --- /dev/null +++ b/docs/running/commandline.rst @@ -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 `_ and the standard +atomic data set from the `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`. \ No newline at end of file diff --git a/docs/running/configuration/index.rst b/docs/running/configuration/index.rst index 0dfbed67cfb..96a0f931659 100644 --- a/docs/running/configuration/index.rst +++ b/docs/running/configuration/index.rst @@ -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 diff --git a/docs/running/gui.rst b/docs/running/gui.rst index a9daae55fda..d23c94ba5e5 100644 --- a/docs/running/gui.rst +++ b/docs/running/gui.rst @@ -1,23 +1,69 @@ -.. _gui_explanation: +.. _gui: ************************ Graphical User Interface ************************ - TARDIS uses the `PyQt4 framework `_ for its cross-platform interface. -The GUI runs through the `IPython Interpreter `_ 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 -------------------- diff --git a/docs/running/index.rst b/docs/running/index.rst index 2c9ec259c6f..fcb17c57b3b 100644 --- a/docs/running/index.rst +++ b/docs/running/index.rst @@ -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 `_ subpackage. A quick start guide to run TARDIS can be found :ref:`here ` +.. toctree:: + :maxdepth: 2 + + commandline + gui + .. _quickstart: @@ -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 `_ and the standard -atomic data set from the `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 diff --git a/docs/notebooks/Custom_TARDIS_Model_Tutorial.ipynb b/docs/running/notebooks/Custom_TARDIS_Model_Tutorial.ipynb similarity index 100% rename from docs/notebooks/Custom_TARDIS_Model_Tutorial.ipynb rename to docs/running/notebooks/Custom_TARDIS_Model_Tutorial.ipynb diff --git a/docs/notebooks/data/abund.dat b/docs/running/notebooks/data/abund.dat similarity index 100% rename from docs/notebooks/data/abund.dat rename to docs/running/notebooks/data/abund.dat diff --git a/docs/notebooks/data/config_init_trad.yml b/docs/running/notebooks/data/config_init_trad.yml similarity index 100% rename from docs/notebooks/data/config_init_trad.yml rename to docs/running/notebooks/data/config_init_trad.yml diff --git a/docs/notebooks/data/config_no_init_trad.yml b/docs/running/notebooks/data/config_no_init_trad.yml similarity index 100% rename from docs/notebooks/data/config_no_init_trad.yml rename to docs/running/notebooks/data/config_no_init_trad.yml diff --git a/docs/notebooks/data/density.txt b/docs/running/notebooks/data/density.txt similarity index 100% rename from docs/notebooks/data/density.txt rename to docs/running/notebooks/data/density.txt diff --git a/docs/notebooks/hdf_writer.ipynb b/docs/running/notebooks/hdf_writer.ipynb similarity index 100% rename from docs/notebooks/hdf_writer.ipynb rename to docs/running/notebooks/hdf_writer.ipynb diff --git a/docs/notebooks/init_trad_bug.ipynb b/docs/running/notebooks/init_trad_bug.ipynb similarity index 100% rename from docs/notebooks/init_trad_bug.ipynb rename to docs/running/notebooks/init_trad_bug.ipynb diff --git a/docs/notebooks/isotope_pd_subclass.ipynb b/docs/running/notebooks/isotope_pd_subclass.ipynb similarity index 100% rename from docs/notebooks/isotope_pd_subclass.ipynb rename to docs/running/notebooks/isotope_pd_subclass.ipynb diff --git a/docs/notebooks/to_hdf.ipynb b/docs/running/notebooks/to_hdf.ipynb similarity index 100% rename from docs/notebooks/to_hdf.ipynb rename to docs/running/notebooks/to_hdf.ipynb