[Yt-svn] commit/yt-doc: MatthewTurk: Adding scripting and interactive to the interacting-with-yt doc.

Bitbucket commits-noreply at bitbucket.org
Fri Aug 26 10:43:08 PDT 2011


1 new changeset in yt-doc:

http://bitbucket.org/yt_analysis/yt-doc/changeset/409fd7a990d2/
changeset:   409fd7a990d2
user:        MatthewTurk
date:        2011-08-26 19:41:56
summary:     Adding scripting and interactive to the interacting-with-yt doc.
affected #:  1 file (3.0 KB)

--- a/source/interacting_with_yt.rst	Fri Aug 26 10:18:57 2011 -0400
+++ b/source/interacting_with_yt.rst	Fri Aug 26 13:41:56 2011 -0400
@@ -3,12 +3,98 @@
 Ways of Interacting with yt
 ===========================
 
+There are several entry points to yt, and each carries its own strengths and
+weaknesses.  We cover a few of those here.
+
+.. _scripting-yt:
+
 Scripts
 -------
 
+The mechanism by which most people primarily interact with yt is by writing,
+then executing, a script.  This is covered somewhat in the :ref:`orientation`,
+but here we describe it again.  There are several advantages to scripts as
+opposed to interactivity:
+
+ * Repeatability of experiments
+ * Easier MPI-parallelism
+ * Versioned control of changes to a script
+ * Simpler declaration and usage of subroutines and loops
+
+Running scripts is pretty easy.  It's a three step process.
+
+ #. Edit script in a text editor (vim, emacs, textmate -- as long as it's not
+    pico or edlin!)
+ #. Run script, invoking it with either the python version installed with yt or
+    the alias ``pyyt``.
+ #. Edit, and repeat!
+
+To encourage easy submission to :ref:`hub`, we suggest you place your scripts
+in an isolated subdirectory and name each one individually.  For instance:
+
+.. code-block:: bash
+
+   mkdir turbulence_paper
+   cd turbulence_paper
+   vim calculate_power_spectra.py
+   pyyt calculate_power_spectra.py
+
+You will have to reference the datasets you want to analyze with either
+relative or absolute paths, but when you have completed your work, you can use
+the command (see :ref:`command-line`) ``hubsubmit`` to (if necessary) create a
+repository and submit to the `Hub <http://hub.yt-project.org/>`_.
+
+.. _interactive-prompt:
+
 Interactive Prompt
 ------------------
 
+The interactive prompt offers a number of excellent opportunities for
+exploration of data.  While there are challenges for repeatability, and some
+operations will be more challenging to operate in parallel, interactive prompts
+can be exceptionally useful for debugging, exploring, and tweaking plots.
+
+There are several different ways to get an interactive prompt for yt, the most
+easy of which is simply to type:
+
+.. code-block:: bash
+
+   pyyt
+
+This will start up the python interpreter.  You can now execute yt commands as
+normal (once you've imported yt!) and examine your data.  There are two other
+handy commands, however, which put you into the IPython interactive shell.
+
+.. warning:: IPython has changed their API substantially in recent versions.
+   yt does not support IPython versions newer than 0.10.
+
+You can start up an empty shell, with a handful of useful yt utilities (such as
+tab-completion and pre-imported modules) by executing:
+
+.. code-block:: bash
+
+   iyt
+
+The other option, which is shorthand for "iyt plus dataset loading" is to use
+the command-line tool (see :ref:`command-line`) with the ``load`` subcommand
+and to specify a parameter file.  For instance:
+
+.. code-block:: bash
+
+   yt load cosmoSim_coolhdf5_chk_0026
+
+or
+
+.. code-block:: bash
+
+   yt load DD0030/DD0030
+
+This will spawn ``iyt``, but the parameter file given on the command line will
+already be in the namespace as ``pf``.  With interactive mode, you can use the
+``pylab`` module to interactively plot, and there is also the object
+``PlotCollectionInteractive`` which can handle setting up draw mode and
+updating plots interactively.
+
 .. _command-line:
 
 Command-line Utility

Repository URL: https://bitbucket.org/yt_analysis/yt-doc/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.



More information about the yt-svn mailing list