[Yt-svn] commit/yt: 8 new changesets

Bitbucket commits-noreply at bitbucket.org
Tue May 24 21:39:05 PDT 2011


8 new changesets in yt:

http://bitbucket.org/yt_analysis/yt/changeset/997453a58e95/
changeset:   r4281:997453a58e95
branch:      yt
user:        caseywstark
date:        2011-05-24 08:25:57
summary:     First pass at adding support for a virtualenv-inspired activate script
affected #:  3 files (5.0 KB)

--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/activate	Mon May 23 23:25:57 2011 -0700
@@ -0,0 +1,110 @@
+### Adapted from virtualenv's activate script
+
+# This file must be used with "source bin/activate" *from bash*
+# you cannot run it directly
+
+deactivate () {
+    # reset old environment variables
+    if [ -n "$_OLD_VIRTUAL_PATH" ] ; then
+        PATH="$_OLD_VIRTUAL_PATH"
+        export PATH
+        unset _OLD_VIRTUAL_PATH
+    fi
+    if [ -n "$_OLD_VIRTUAL_PYTHONHOME" ] ; then
+        PYTHONHOME="$_OLD_VIRTUAL_PYTHONHOME"
+        export PYTHONHOME
+        unset _OLD_VIRTUAL_PYTHONHOME
+    fi
+
+    ### Begin extra yt vars
+    if [ -n "$_OLD_VIRTUAL_YT_DEST" ] ; then
+        YT_DEST="$_OLD_VIRTUAL_YT_DEST"
+        export YT_DEST
+        unset _OLD_VIRTUAL_PYTHONHOME
+    fi
+    if [ -n "$_OLD_VIRTUAL_PYTHONPATH" ] ; then
+        PYTHONPATH="$_OLD_VIRTUAL_PYTHONPATH"
+        export PYTHONPATH
+        unset _OLD_VIRTUAL_PYTHONPATH
+    fi
+    if [ -n "$_OLD_VIRTUAL_LD_LIBRARY_PATH" ] ; then
+        LD_LIBRARY_PATH="$_OLD_VIRTUAL_LD_LIBRARY_PATH"
+        export LD_LIBRARY_PATH
+        unset _OLD_VIRTUAL_LD_LIBRARY_PATH
+    fi
+    ### End extra yt vars
+
+    # This should detect bash and zsh, which have a hash command that must
+    # be called to get it to forget past commands.  Without forgetting
+    # past commands the $PATH changes we made may not be respected
+    if [ -n "$BASH" -o -n "$ZSH_VERSION" ] ; then
+        hash -r
+    fi
+
+    if [ -n "$_OLD_VIRTUAL_PS1" ] ; then
+        PS1="$_OLD_VIRTUAL_PS1"
+        export PS1
+        unset _OLD_VIRTUAL_PS1
+    fi
+
+    unset VIRTUAL_ENV
+    if [ ! "$1" = "nondestructive" ] ; then
+    # Self destruct!
+        unset -f deactivate
+    fi
+}
+
+# unset irrelavent variables
+deactivate nondestructive
+
+VIRTUAL_ENV="__YT_DIR__"
+export VIRTUAL_ENV
+
+_OLD_VIRTUAL_PATH="$PATH"
+PATH="$VIRTUAL_ENV/bin:$PATH"
+export PATH
+
+### Begin extra env vars for yt
+_OLD_VIRTUAL_YT_DEST="$YT_DEST"
+YT_DEST="$VIRTUAL_ENV"
+export YT_DEST
+
+_OLD_VIRTUAL_PYTHONPATH="$PYTHONPATH"
+PYTHONPATH="$VIRTUAL_ENV/lib/python2.7/site-packages"
+export PYTHONPATH
+
+_OLD_VIRTUAL_LD_LIBRARY_PATH="$LD_LIBRARY_PATH"
+LD_LIBRARY_PATH="$VIRTUAL_ENV/lib"
+export LD_LIBRARY_PATH
+### End extra env vars for yt
+
+# unset PYTHONHOME if set
+# this will fail if PYTHONHOME is set to the empty string (which is bad anyway)
+# could use `if (set -u; : $PYTHONHOME) ;` in bash
+if [ -n "$PYTHONHOME" ] ; then
+    _OLD_VIRTUAL_PYTHONHOME="$PYTHONHOME"
+    unset PYTHONHOME
+fi
+
+if [ -z "$VIRTUAL_ENV_DISABLE_PROMPT" ] ; then
+    _OLD_VIRTUAL_PS1="$PS1"
+    if [ "x" != x ] ; then
+	PS1="$PS1"
+    else
+    if [ "`basename \"$VIRTUAL_ENV\"`" = "__" ] ; then
+        # special case for Aspen magic directories
+        # see http://www.zetadev.com/software/aspen/
+        PS1="[`basename \`dirname \"$VIRTUAL_ENV\"\``] $PS1"
+    else
+        PS1="(`basename \"$VIRTUAL_ENV\"`)$PS1"
+    fi
+    fi
+    export PS1
+fi
+
+# This should detect bash and zsh, which have a hash command that must
+# be called to get it to forget past commands.  Without forgetting
+# past commands the $PATH changes we made may not be respected
+if [ -n "$BASH" -o -n "$ZSH_VERSION" ] ; then
+    hash -r
+fi


--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/activate.csh	Mon May 23 23:25:57 2011 -0700
@@ -0,0 +1,43 @@
+# This file must be used with "source bin/activate.csh" *from csh*.
+# You cannot run it directly.
+# Created by Davide Di Blasi <davidedb at gmail.com>.
+
+alias deactivate 'test $?_OLD_VIRTUAL_PATH != 0 && setenv PATH "$_OLD_VIRTUAL_PATH" && unset _OLD_VIRTUAL_PATH; test $?_OLD_VIRTUAL_YT_DEST != 0 && setenv YT_DEST "$_OLD_VIRTUAL_YT_DEST" && unset _OLD_VIRTUAL_YT_DEST; test $?_OLD_VIRTUAL_PYTHONPATH != 0 && setenv PYTHONPATH "$_OLD_VIRTUAL_PYTHONPATH" && unset _OLD_VIRTUAL_PYTHONPATH; test $?_OLD_VIRTUAL_LD_LIBRARY_PATH != 0 && setenv LD_LIBRARY_PATH "$_OLD_VIRTUAL_LD_LIBRARY_PATH" && unset _OLD_VIRTUAL_LD_LIBRARY_PATH; rehash; test $?_OLD_VIRTUAL_PROMPT != 0 && set prompt="$_OLD_VIRTUAL_PROMPT" && unset _OLD_VIRTUAL_PROMPT; unsetenv VIRTUAL_ENV; test "\!:*" != "nondestructive" && unalias deactivate'
+
+# Unset irrelavent variables.
+deactivate nondestructive
+
+setenv VIRTUAL_ENV "__YT_DIR__"
+
+set _OLD_VIRTUAL_PATH="$PATH"
+setenv PATH "$VIRTUAL_ENV/bin:$PATH"
+
+### Begin extra yt vars
+set _OLD_VIRTUAL_YT_DEST="$YT_DEST"
+setenv YT_DEST "$VIRTUAL_ENV:$YT_DEST"
+
+set _OLD_VIRTUAL_PYTHONPATH="$PYTHONPATH"
+setenv PYTHONPATH "$VIRTUAL_ENV/lib/python2.7/site-packages:$PYTHONPATH"
+
+set _OLD_VIRTUAL_LD_LIBRARY_PATH="$LD_LIBRARY_PATH"
+setenv LD_LIBRARY_PATH "$VIRTUAL_ENV/lib:$LD_LIBRARY_PATH"
+### End extra yt vars
+
+set _OLD_VIRTUAL_PROMPT="$prompt"
+
+if ("" != "") then
+    set env_name = ""
+else
+    if (`basename "$VIRTUAL_ENV"` == "__") then
+        # special case for Aspen magic directories
+        # see http://www.zetadev.com/software/aspen/
+        set env_name = `basename \`dirname "$VIRTUAL_ENV"\``
+    else
+        set env_name = `basename "$VIRTUAL_ENV"`
+    endif
+endif
+set prompt = "[$env_name] $prompt"
+unset env_name
+
+rehash
+


--- a/doc/install_script.sh	Sat May 21 01:05:31 2011 -0400
+++ b/doc/install_script.sh	Mon May 23 23:25:57 2011 -0700
@@ -588,6 +588,10 @@
     echo "*******************************************************"
 fi
 
+# Add the environment scripts
+( ln -sf ${YT_DIR}/doc/activate ${DEST_DIR}/bin/activate 2>&1 ) 1>> ${LOG_FILE}
+( ln -sf ${YT_DIR}/doc/activate.csh ${DEST_DIR}/bin/activate.csh 2>&1 ) 1>> ${LOG_FILE}
+
 function print_afterword
 {
     echo
@@ -595,26 +599,30 @@
     echo "========================================================================"
     echo
     echo "yt is now installed in $DEST_DIR ."
-    echo "To run from this new installation, the a few variables need to be"
-    echo "prepended with the following information:"
     echo
-    echo "YT_DEST         => $DEST_DIR"
-    echo "PATH            => $DEST_DIR/bin/"
-    echo "PYTHONPATH      => $DEST_DIR/lib/python2.7/site-packages/"
-    echo "LD_LIBRARY_PATH => $DEST_DIR/lib/"
+    echo "To run from this new installation, use the activate script for this "
+    echo "environment."
+    echo
+    echo "    $ source $DEST_DIR/bin/activate"
+    echo "    (yt)$ "
+    echo
+    echo "This modifies the environment variables YT_DEST, PATH, PYTHONPATH, and"
+    echo "LD_LIBRARY_PATH to match your new yt install. But don't worry - as soon"
+    echo "as you are done you can run `deactivate` to return to your previous"
+    echo "shell environment."
     echo
     echo "For interactive data analysis and visualization, we recommend running"
     echo "the IPython interface, which will become more fully featured with time:"
     echo
-    echo "$DEST_DIR/bin/iyt"
+    echo "    $DEST_DIR/bin/iyt"
     echo
     echo "For command line analysis run:"
     echo
-    echo "$DEST_DIR/bin/yt"
+    echo "    $DEST_DIR/bin/yt"
     echo
     echo "To bootstrap a development environment for yt, run:"
     echo 
-    echo "$DEST_DIR/bin/yt bootstrap_dev"
+    echo "    $DEST_DIR/bin/yt bootstrap_dev"
     echo
     echo "Note of interest: this installation will use the directory:"
     echo "    $YT_DIR"


http://bitbucket.org/yt_analysis/yt/changeset/c51c7a7caca5/
changeset:   r4282:c51c7a7caca5
branch:      yt
user:        caseywstark
date:        2011-05-24 08:36:15
summary:     Pulling the yt_analysis changes. The bitbucket guide doesn't show this step, so I hope I'm not doing something wrong
affected #:  3 files (5.3 KB)

--- a/yt/data_objects/universal_fields.py	Mon May 23 23:25:57 2011 -0700
+++ b/yt/data_objects/universal_fields.py	Mon May 23 23:36:15 2011 -0700
@@ -415,8 +415,8 @@
 def _Baryon_Overdensity(field, data):
     return data['Density']
 def _Convert_Baryon_Overdensity(data):
-    if data.pf.parameters.has_key('omega_baryon_now'):
-        omega_baryon_now = data.pf.parameters['omega_baryon_now']
+    if data.pf.has_key('omega_baryon_now'):
+        omega_baryon_now = data.pf['omega_baryon_now']
     else:
         omega_baryon_now = 0.0441
     return 1 / (omega_baryon_now * rho_crit_now * 


--- a/yt/gui/reason/extdirect_repl.py	Mon May 23 23:25:57 2011 -0700
+++ b/yt/gui/reason/extdirect_repl.py	Mon May 23 23:36:15 2011 -0700
@@ -39,6 +39,7 @@
 import base64
 import imp
 import threading
+import Queue
 
 from yt.funcs import *
 from yt.utilities.logger import ytLogger, ufstring
@@ -87,14 +88,59 @@
             self.locks[str(func)] = threading.Lock()
         @wraps(func)
         def locker(*args, **kwargs):
+            print "Acquiring lock on %s" % (str(func))
             with self.locks[str(func)]:
                 rv = func(*args, **kwargs)
-            print "Regained lock:", rv
+            print "Regained lock on %s" % (str(func))
             return rv
         return locker
 
 lockit = MethodLock()
 
+class ExecutionThread(threading.Thread):
+    def __init__(self, repl):
+        self.repl = repl
+        self.queue = Queue.Queue()
+        threading.Thread.__init__(self)
+        self.daemon = True
+
+    def run(self):
+        while 1:
+            print "Checking for a queue ..."
+            try:
+                task = self.queue.get(True, 10)
+            except (Queue.Full, Queue.Empty):
+                if self.repl.stopped: return
+                continue
+            print "Received the task", task
+            if task['type'] == 'code':
+                self.execute_one(task['code'], task['hide'])
+                self.queue.task_done()
+            elif task['type'] == 'add_widget':
+                print "Adding new widget"
+                self.queue.task_done()
+                new_code = self.repl._add_widget(
+                    task['name'], task['widget_data_name'])
+                print "Got this command:", new_code
+                self.repl.execute(new_code, hide=True)
+                print "Executed!"
+
+    def execute_one(self, code, hide):
+        self.repl.executed_cell_texts.append(code)
+
+        result = ProgrammaticREPL.execute(self.repl, code)
+        if self.repl.debug:
+            print "==================== Cell Execution ===================="
+            print code
+            print "====================                ===================="
+            print result
+            print "========================================================"
+        if hide: return
+        self.repl.payload_handler.add_payload(
+            {'type': 'cell_results',
+             'output': result,
+             'input': highlighter(code)})
+
 def deliver_image(im):
     if hasattr(im, 'read'):
         img_data = base64.b64encode(im.read())
@@ -150,6 +196,7 @@
     server = None
     stopped = False
     debug = False
+    _heartbeat_timer = None
 
     def __init__(self, base_extjs_path, locals=None):
         # First we do the standard initialization
@@ -181,6 +228,7 @@
         self.pflist = ExtDirectParameterFileList()
         self.executed_cell_texts = []
         self.payload_handler = PayloadHandler()
+        self.execution_thread = ExecutionThread(self)
         # Now we load up all the yt.mods stuff, but only after we've finished
         # setting up.
         reason_pylab()
@@ -194,6 +242,8 @@
         # Setup our heartbeat
         self.last_heartbeat = time.time()
         self._check_heartbeat()
+        self.execution_thread.start()
+        if self.debug: time.sleep(3)
 
     def exception_handler(self, exc):
         result = {'type': 'cell_results',
@@ -207,6 +257,7 @@
         handler.setFormatter(formatter)
         ytLogger.addHandler(handler)
 
+
     def index(self):
         """Return an HTTP-based Read-Eval-Print-Loop terminal."""
         # For now this doesn't work!  We will need to move to a better method
@@ -216,13 +267,13 @@
 
     def heartbeat(self):
         self.last_heartbeat = time.time()
-        if self.debug: print "### Heartbeat ... started"
-        for i in range(30): # The total time to wait
+        if self.debug: print "### Heartbeat ... started: %s" % (time.ctime())
+        for i in range(30):
             # Check for stop
-            if self.stopped: return {'type':'shutdown'}# No race condition
+            if self.stopped: return {'type':'shutdown'} # No race condition
             if self.payload_handler.event.wait(1): # One second timeout
                 return self.payload_handler.deliver_payloads()
-        if self.debug: print "### Heartbeat ... finished"
+        if self.debug: print "### Heartbeat ... finished: %s" % (time.ctime())
         return []
 
     def _check_heartbeat(self):
@@ -237,6 +288,7 @@
             # server instance by default.
             self.shutdown()
             return
+        if self._heartbeat_timer is not None: return
         self._heartbeat_timer = threading.Timer(10, self._check_heartbeat)
         self._heartbeat_timer.start()
 
@@ -293,22 +345,11 @@
     def _highlighter_css(self):
         return highlighter_css
 
-    @lockit
     def execute(self, code, hide = False):
-        self.executed_cell_texts.append(code)
-
-        result = ProgrammaticREPL.execute(self, code)
-        if self.debug:
-            print "==================== Cell Execution ===================="
-            print code
-            print "====================                ===================="
-            print result
-            print "========================================================"
-        if hide: return
-        self.payload_handler.add_payload(
-            {'type': 'cell_results',
-             'output': result,
-             'input': highlighter(code)})
+            task = {'type': 'code',
+                    'code': code,
+                    'hide': hide}
+            self.execution_thread.queue.put(task)
 
     def get_history(self):
         return self.executed_cell_texts[:]
@@ -375,7 +416,9 @@
         return cs
 
     def _add_widget(self, widget_name, widget_data_name = None):
-        # This should be sanitized
+        # We need to make sure that we aren't running in advance of a new
+        # object being added.
+        self.execution_thread.queue.join()
         widget = self.locals[widget_name]
         uu = str(uuid.uuid1()).replace("-","_")
         varname = "%s_%s" % (widget._widget_name, uu)
@@ -413,7 +456,9 @@
                    field_z = field_z, weight = weight)
         funccall = "\n".join(line.strip() for line in funccall.splitlines())
         self.execute(funccall, hide=True)
-        self.execute(self._add_widget('_tpp', '_twidget_data'), hide=True)
+        self.execution_thread.queue.put({'type': 'add_widget',
+                                         'name': '_tpp',
+                                         'widget_data_name': '_twidget_data'})
 
     @lockit
     def create_proj(self, pfname, axis, field, weight, onmax):
@@ -450,7 +495,9 @@
         # There is a call to do this, but I have forgotten it ...
         funccall = "\n".join((line.strip() for line in funccall.splitlines()))
         self.execute(funccall, hide = True)
-        self.execute(self._add_widget('_tpw', '_twidget_data'), hide = True)
+        self.execution_thread.queue.put({'type': 'add_widget',
+                                         'name': '_tpw',
+                                         'widget_data_name': '_twidget_data'})
 
     @lockit
     def create_slice(self, pfname, center, axis, field, onmax):
@@ -488,7 +535,9 @@
         # There is a call to do this, but I have forgotten it ...
         funccall = "\n".join((line.strip() for line in funccall.splitlines()))
         self.execute(funccall, hide = True)
-        self.execute(self._add_widget('_tpw', '_twidget_data'), hide = True)
+        self.execution_thread.queue.put({'type': 'add_widget',
+                                         'name': '_tpw',
+                                         'widget_data_name': '_twidget_data'})
 
     @lockit
     def create_grid_dataview(self, pfname):


--- a/yt/visualization/profile_plotter.py	Mon May 23 23:25:57 2011 -0700
+++ b/yt/visualization/profile_plotter.py	Mon May 23 23:36:15 2011 -0700
@@ -64,6 +64,45 @@
     cmap = None
     display = True
 
+class PlotContainer(object):
+    x_spec = None
+    y_spec = None
+    x_values = None
+    y_values = None
+    plot_spec = None
+
+    def to_mpl(self, place = None):
+        import _mpl_imports as mpl
+        if isinstance(place, mpl.matplotlib.figure.Figure):
+            figure, place = place, None
+            place = None
+        else:
+            figure = mpl.matplotlib.figure.Figure((10,8))
+        if isinstance(place, mpl.matplotlib.axes.Axes):
+            axes, place = place, None
+        else:
+            axes = figure.add_subplot(1,1,1)
+        if self.x_spec.scale == 'log' and \
+           self.y_spec.scale == 'log':
+            func = axes.loglog
+        elif self.x_spec == 'log':
+            func = axes.semilogx
+        elif self.y_spec == 'log':
+            func = axes.semilogy
+        if self.plot_spec is None:
+            kwargs = {}
+        else:
+            kwargs = self.plot_spec
+        func(self.x_values, self.y_values, **kwargs)
+        if self.x_spec.title is not None:
+            axes.set_xlabel(self.x_spec.title)
+        if self.y_spec.title is not None:
+            axes.set_ylabel(self.y_spec.title)
+        if isinstance(place, types.StringTypes):
+            canvas = mpl.FigureCanvasAgg(figure)
+            canvas.print_figure(place)
+        return figure, axes
+
 class ImagePlotContainer(object):
     x_spec = None
     y_spec = None
@@ -335,3 +374,54 @@
         img_data = base64.b64encode(pngs)
         return img_data
 
+class ProfilePlotter(object):
+    scale = None
+    _current_field = None
+
+    def __init__(self, data_source, field_x, field_y, 
+                 weight="CellMassMsun", accumulation=False,
+                 x_bins=128, x_log=True, x_bounds=None,
+                 lazy_reader=True, fractional=False):
+        if x_bounds is None:
+            x_min, x_max = data_source.quantities["Extrema"](
+                                    field_x, non_zero = x_log,
+                                    lazy_reader=lazy_reader)[0]
+        else:
+            x_min, x_max = x_bounds
+        profile = BinnedProfile1D(data_source,
+                                  x_bins, field_x, x_min, x_max, x_log,
+                                  lazy_reader)
+        # This is a fallback, in case we forget.
+        if field_y == "CellMassMsun": weight = None
+        profile.add_fields(field_y, weight=weight, accumulation=accumulation, fractional=fractional)
+        self._current_field = field_y
+        self.profile = profile
+        self.scale = {True:'log', False:'linear'}.get(
+                data_source.pf.field_info[field_y], "log")
+        self._setup_plot()
+
+    def _setup_plot(self):
+        xax = AxisSpec()
+        xax.title = self.profile.bin_field
+        xax.bounds = (self.profile._bins[0],
+                      self.profile._bins[-1])
+        xax.scale = {True: 'log', False: 'linear'}[self.profile._x_log]
+        xax.calculate_ticks()
+
+        yax = AxisSpec()
+        yax.title = self._current_field
+        if self.scale == 'log':
+            ny = (self.profile[self._current_field] > 0)
+            mi = self.profile[self._current_field][ny].min()
+        else:
+            mi = self.profile[self._current_field][ny].min()
+        ma = self.profile[self._current_field].max()
+        yax.bounds = (mi, ma)
+        yax.scale = self.scale
+        yax.calculate_ticks()
+
+        self.plot = PlotContainer()
+        self.plot.x_values = self.profile._bins
+        self.plot.y_values = self.profile[self._current_field]
+        self.plot.x_spec = xax
+        self.plot.y_spec = yax


http://bitbucket.org/yt_analysis/yt/changeset/39e92a6e6711/
changeset:   r4283:39e92a6e6711
branch:      yt
user:        MatthewTurk
date:        2011-05-25 01:19:36
summary:     Updating CREDITS file and changing "Developers" to "Contributors"
affected #:  1 file (140 bytes)

--- a/CREDITS	Mon May 23 23:25:53 2011 -0400
+++ b/CREDITS	Tue May 24 19:19:36 2011 -0400
@@ -1,6 +1,6 @@
 YT is a group effort.
 
-Developers:                     Matthew Turk (matthewturk at gmail.com)
+Contributors:                   Matthew Turk (matthewturk at gmail.com)
                                 Britton Smith (brittonsmith at gmail.com)
                                 Jeff Oishi (jsoishi at gmail.com)
                                 Stephen Skory (s at skory.us)
@@ -15,6 +15,8 @@
                                 Cameron Hummels (chummels at astro.columbia.edu)
                                 Stefan Klemer (sklemer at phys.uni-goettingen.de)
                                 Andrew Myers (atmyers at astro.berkeley.edu)
+                                Michael Kuhlen (mqk at astro.berkeley.edu)
+                                Casey Stark (caseywstark at gmail.com)
 
 We also include the Delaunay Triangulation module written by Robert Kern of
 Enthought, the cmdln.py module by Trent Mick, and the progressbar module by


http://bitbucket.org/yt_analysis/yt/changeset/86524888ade8/
changeset:   r4284:86524888ade8
branch:      yt
user:        tabel
date:        2011-04-27 17:17:44
summary:     Added a feature that if load is called empty load() and Tkinter is avialable
it will open a OpenFileDialog and ask you to select the file you want to open.
Consequently you can reuse scripts and apply them to different datasets without
editing the script. E.g. Also as you do interactive work just start with a
pf = load()
instead of trying to remeber which directory etc. you want to work in.
affected #:  1 file (341 bytes)

--- a/yt/convenience.py	Tue May 24 19:19:36 2011 -0400
+++ b/yt/convenience.py	Wed Apr 27 17:17:44 2011 +0200
@@ -70,6 +70,17 @@
     match, at which point it returns an instance of the appropriate
     :class:`yt.data_objects.api.StaticOutput` subclass.
     """
+    if len(args) == 0:
+        try:
+            import Tkinter, tkFileDialog
+        except ImportError:
+            return None
+        root = Tkinter.Tk()
+        filename = tkFileDialog.askopenfilename(parent=root,title='Choose a file')
+        if filename != None:
+            return load(filename)
+        else:
+            return None
     candidates = []
     for n, c in output_type_registry.items():
         if n is None: continue


http://bitbucket.org/yt_analysis/yt/changeset/882770cb4188/
changeset:   r4285:882770cb4188
branch:      yt
user:        MatthewTurk
date:        2011-05-25 01:20:23
summary:     Adding Tom to CREDITS file
affected #:  1 file (62 bytes)

--- a/CREDITS	Wed Apr 27 17:17:44 2011 +0200
+++ b/CREDITS	Tue May 24 19:20:23 2011 -0400
@@ -14,6 +14,7 @@
                                 Chris Malone (cmalone at mail.astro.sunysb.edu)
                                 Cameron Hummels (chummels at astro.columbia.edu)
                                 Stefan Klemer (sklemer at phys.uni-goettingen.de)
+                                Tom Abel (tabel at stanford.edu)
                                 Andrew Myers (atmyers at astro.berkeley.edu)
                                 Michael Kuhlen (mqk at astro.berkeley.edu)
                                 Casey Stark (caseywstark at gmail.com)


http://bitbucket.org/yt_analysis/yt/changeset/86b3a0f0a6fc/
changeset:   r4286:86b3a0f0a6fc
branch:      yt
user:        MatthewTurk
date:        2011-05-25 01:21:53
summary:     Merging
affected #:  2 files (543 bytes)

--- a/CREDITS	Tue May 24 14:13:25 2011 -0700
+++ b/CREDITS	Tue May 24 19:21:53 2011 -0400
@@ -1,6 +1,6 @@
 YT is a group effort.
 
-Developers:                     Matthew Turk (matthewturk at gmail.com)
+Contributors:                   Matthew Turk (matthewturk at gmail.com)
                                 Britton Smith (brittonsmith at gmail.com)
                                 Jeff Oishi (jsoishi at gmail.com)
                                 Stephen Skory (s at skory.us)
@@ -14,7 +14,10 @@
                                 Chris Malone (cmalone at mail.astro.sunysb.edu)
                                 Cameron Hummels (chummels at astro.columbia.edu)
                                 Stefan Klemer (sklemer at phys.uni-goettingen.de)
+                                Tom Abel (tabel at stanford.edu)
                                 Andrew Myers (atmyers at astro.berkeley.edu)
+                                Michael Kuhlen (mqk at astro.berkeley.edu)
+                                Casey Stark (caseywstark at gmail.com)
 
 We also include the Delaunay Triangulation module written by Robert Kern of
 Enthought, the cmdln.py module by Trent Mick, and the progressbar module by


--- a/yt/convenience.py	Tue May 24 14:13:25 2011 -0700
+++ b/yt/convenience.py	Tue May 24 19:21:53 2011 -0400
@@ -70,6 +70,17 @@
     match, at which point it returns an instance of the appropriate
     :class:`yt.data_objects.api.StaticOutput` subclass.
     """
+    if len(args) == 0:
+        try:
+            import Tkinter, tkFileDialog
+        except ImportError:
+            return None
+        root = Tkinter.Tk()
+        filename = tkFileDialog.askopenfilename(parent=root,title='Choose a file')
+        if filename != None:
+            return load(filename)
+        else:
+            return None
     candidates = []
     for n, c in output_type_registry.items():
         if n is None: continue


http://bitbucket.org/yt_analysis/yt/changeset/cf6621509b71/
changeset:   r4287:cf6621509b71
branch:      yt
user:        MatthewTurk
date:        2011-05-25 01:23:23
summary:     Merging in Casey's activate/deactivate scripts.
affected #:  3 files (5.0 KB)

--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/activate	Tue May 24 19:23:23 2011 -0400
@@ -0,0 +1,110 @@
+### Adapted from virtualenv's activate script
+
+# This file must be used with "source bin/activate" *from bash*
+# you cannot run it directly
+
+deactivate () {
+    # reset old environment variables
+    if [ -n "$_OLD_VIRTUAL_PATH" ] ; then
+        PATH="$_OLD_VIRTUAL_PATH"
+        export PATH
+        unset _OLD_VIRTUAL_PATH
+    fi
+    if [ -n "$_OLD_VIRTUAL_PYTHONHOME" ] ; then
+        PYTHONHOME="$_OLD_VIRTUAL_PYTHONHOME"
+        export PYTHONHOME
+        unset _OLD_VIRTUAL_PYTHONHOME
+    fi
+
+    ### Begin extra yt vars
+    if [ -n "$_OLD_VIRTUAL_YT_DEST" ] ; then
+        YT_DEST="$_OLD_VIRTUAL_YT_DEST"
+        export YT_DEST
+        unset _OLD_VIRTUAL_PYTHONHOME
+    fi
+    if [ -n "$_OLD_VIRTUAL_PYTHONPATH" ] ; then
+        PYTHONPATH="$_OLD_VIRTUAL_PYTHONPATH"
+        export PYTHONPATH
+        unset _OLD_VIRTUAL_PYTHONPATH
+    fi
+    if [ -n "$_OLD_VIRTUAL_LD_LIBRARY_PATH" ] ; then
+        LD_LIBRARY_PATH="$_OLD_VIRTUAL_LD_LIBRARY_PATH"
+        export LD_LIBRARY_PATH
+        unset _OLD_VIRTUAL_LD_LIBRARY_PATH
+    fi
+    ### End extra yt vars
+
+    # This should detect bash and zsh, which have a hash command that must
+    # be called to get it to forget past commands.  Without forgetting
+    # past commands the $PATH changes we made may not be respected
+    if [ -n "$BASH" -o -n "$ZSH_VERSION" ] ; then
+        hash -r
+    fi
+
+    if [ -n "$_OLD_VIRTUAL_PS1" ] ; then
+        PS1="$_OLD_VIRTUAL_PS1"
+        export PS1
+        unset _OLD_VIRTUAL_PS1
+    fi
+
+    unset VIRTUAL_ENV
+    if [ ! "$1" = "nondestructive" ] ; then
+    # Self destruct!
+        unset -f deactivate
+    fi
+}
+
+# unset irrelavent variables
+deactivate nondestructive
+
+VIRTUAL_ENV="__YT_DIR__"
+export VIRTUAL_ENV
+
+_OLD_VIRTUAL_PATH="$PATH"
+PATH="$VIRTUAL_ENV/bin:$PATH"
+export PATH
+
+### Begin extra env vars for yt
+_OLD_VIRTUAL_YT_DEST="$YT_DEST"
+YT_DEST="$VIRTUAL_ENV"
+export YT_DEST
+
+_OLD_VIRTUAL_PYTHONPATH="$PYTHONPATH"
+PYTHONPATH="$VIRTUAL_ENV/lib/python2.7/site-packages"
+export PYTHONPATH
+
+_OLD_VIRTUAL_LD_LIBRARY_PATH="$LD_LIBRARY_PATH"
+LD_LIBRARY_PATH="$VIRTUAL_ENV/lib"
+export LD_LIBRARY_PATH
+### End extra env vars for yt
+
+# unset PYTHONHOME if set
+# this will fail if PYTHONHOME is set to the empty string (which is bad anyway)
+# could use `if (set -u; : $PYTHONHOME) ;` in bash
+if [ -n "$PYTHONHOME" ] ; then
+    _OLD_VIRTUAL_PYTHONHOME="$PYTHONHOME"
+    unset PYTHONHOME
+fi
+
+if [ -z "$VIRTUAL_ENV_DISABLE_PROMPT" ] ; then
+    _OLD_VIRTUAL_PS1="$PS1"
+    if [ "x" != x ] ; then
+	PS1="$PS1"
+    else
+    if [ "`basename \"$VIRTUAL_ENV\"`" = "__" ] ; then
+        # special case for Aspen magic directories
+        # see http://www.zetadev.com/software/aspen/
+        PS1="[`basename \`dirname \"$VIRTUAL_ENV\"\``] $PS1"
+    else
+        PS1="(`basename \"$VIRTUAL_ENV\"`)$PS1"
+    fi
+    fi
+    export PS1
+fi
+
+# This should detect bash and zsh, which have a hash command that must
+# be called to get it to forget past commands.  Without forgetting
+# past commands the $PATH changes we made may not be respected
+if [ -n "$BASH" -o -n "$ZSH_VERSION" ] ; then
+    hash -r
+fi


--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/activate.csh	Tue May 24 19:23:23 2011 -0400
@@ -0,0 +1,43 @@
+# This file must be used with "source bin/activate.csh" *from csh*.
+# You cannot run it directly.
+# Created by Davide Di Blasi <davidedb at gmail.com>.
+
+alias deactivate 'test $?_OLD_VIRTUAL_PATH != 0 && setenv PATH "$_OLD_VIRTUAL_PATH" && unset _OLD_VIRTUAL_PATH; test $?_OLD_VIRTUAL_YT_DEST != 0 && setenv YT_DEST "$_OLD_VIRTUAL_YT_DEST" && unset _OLD_VIRTUAL_YT_DEST; test $?_OLD_VIRTUAL_PYTHONPATH != 0 && setenv PYTHONPATH "$_OLD_VIRTUAL_PYTHONPATH" && unset _OLD_VIRTUAL_PYTHONPATH; test $?_OLD_VIRTUAL_LD_LIBRARY_PATH != 0 && setenv LD_LIBRARY_PATH "$_OLD_VIRTUAL_LD_LIBRARY_PATH" && unset _OLD_VIRTUAL_LD_LIBRARY_PATH; rehash; test $?_OLD_VIRTUAL_PROMPT != 0 && set prompt="$_OLD_VIRTUAL_PROMPT" && unset _OLD_VIRTUAL_PROMPT; unsetenv VIRTUAL_ENV; test "\!:*" != "nondestructive" && unalias deactivate'
+
+# Unset irrelavent variables.
+deactivate nondestructive
+
+setenv VIRTUAL_ENV "__YT_DIR__"
+
+set _OLD_VIRTUAL_PATH="$PATH"
+setenv PATH "$VIRTUAL_ENV/bin:$PATH"
+
+### Begin extra yt vars
+set _OLD_VIRTUAL_YT_DEST="$YT_DEST"
+setenv YT_DEST "$VIRTUAL_ENV:$YT_DEST"
+
+set _OLD_VIRTUAL_PYTHONPATH="$PYTHONPATH"
+setenv PYTHONPATH "$VIRTUAL_ENV/lib/python2.7/site-packages:$PYTHONPATH"
+
+set _OLD_VIRTUAL_LD_LIBRARY_PATH="$LD_LIBRARY_PATH"
+setenv LD_LIBRARY_PATH "$VIRTUAL_ENV/lib:$LD_LIBRARY_PATH"
+### End extra yt vars
+
+set _OLD_VIRTUAL_PROMPT="$prompt"
+
+if ("" != "") then
+    set env_name = ""
+else
+    if (`basename "$VIRTUAL_ENV"` == "__") then
+        # special case for Aspen magic directories
+        # see http://www.zetadev.com/software/aspen/
+        set env_name = `basename \`dirname "$VIRTUAL_ENV"\``
+    else
+        set env_name = `basename "$VIRTUAL_ENV"`
+    endif
+endif
+set prompt = "[$env_name] $prompt"
+unset env_name
+
+rehash
+


--- a/doc/install_script.sh	Tue May 24 19:21:53 2011 -0400
+++ b/doc/install_script.sh	Tue May 24 19:23:23 2011 -0400
@@ -588,6 +588,10 @@
     echo "*******************************************************"
 fi
 
+# Add the environment scripts
+( ln -sf ${YT_DIR}/doc/activate ${DEST_DIR}/bin/activate 2>&1 ) 1>> ${LOG_FILE}
+( ln -sf ${YT_DIR}/doc/activate.csh ${DEST_DIR}/bin/activate.csh 2>&1 ) 1>> ${LOG_FILE}
+
 function print_afterword
 {
     echo
@@ -595,26 +599,30 @@
     echo "========================================================================"
     echo
     echo "yt is now installed in $DEST_DIR ."
-    echo "To run from this new installation, the a few variables need to be"
-    echo "prepended with the following information:"
     echo
-    echo "YT_DEST         => $DEST_DIR"
-    echo "PATH            => $DEST_DIR/bin/"
-    echo "PYTHONPATH      => $DEST_DIR/lib/python2.7/site-packages/"
-    echo "LD_LIBRARY_PATH => $DEST_DIR/lib/"
+    echo "To run from this new installation, use the activate script for this "
+    echo "environment."
+    echo
+    echo "    $ source $DEST_DIR/bin/activate"
+    echo "    (yt)$ "
+    echo
+    echo "This modifies the environment variables YT_DEST, PATH, PYTHONPATH, and"
+    echo "LD_LIBRARY_PATH to match your new yt install. But don't worry - as soon"
+    echo "as you are done you can run `deactivate` to return to your previous"
+    echo "shell environment."
     echo
     echo "For interactive data analysis and visualization, we recommend running"
     echo "the IPython interface, which will become more fully featured with time:"
     echo
-    echo "$DEST_DIR/bin/iyt"
+    echo "    $DEST_DIR/bin/iyt"
     echo
     echo "For command line analysis run:"
     echo
-    echo "$DEST_DIR/bin/yt"
+    echo "    $DEST_DIR/bin/yt"
     echo
     echo "To bootstrap a development environment for yt, run:"
     echo 
-    echo "$DEST_DIR/bin/yt bootstrap_dev"
+    echo "    $DEST_DIR/bin/yt bootstrap_dev"
     echo
     echo "Note of interest: this installation will use the directory:"
     echo "    $YT_DIR"


http://bitbucket.org/yt_analysis/yt/changeset/9fdea5d3db6d/
changeset:   r4288:9fdea5d3db6d
branch:      yt
user:        MatthewTurk
date:        2011-05-25 06:37:32
summary:     Some tweaks to the activate/deactive change.
affected #:  1 file (178 bytes)

--- a/doc/install_script.sh	Tue May 24 19:23:23 2011 -0400
+++ b/doc/install_script.sh	Wed May 25 00:37:32 2011 -0400
@@ -589,8 +589,10 @@
 fi
 
 # Add the environment scripts
-( ln -sf ${YT_DIR}/doc/activate ${DEST_DIR}/bin/activate 2>&1 ) 1>> ${LOG_FILE}
-( ln -sf ${YT_DIR}/doc/activate.csh ${DEST_DIR}/bin/activate.csh 2>&1 ) 1>> ${LOG_FILE}
+( cp ${YT_DIR}/doc/activate ${DEST_DIR}/bin/activate 2>&1 ) 1>> ${LOG_FILE}
+sed -i.bak -e "s,__YT_DIR__,${DEST_DIR}," ${DEST_DIR}/bin/activate
+( cp ${YT_DIR}/doc/activate.csh ${DEST_DIR}/bin/activate.csh 2>&1 ) 1>> ${LOG_FILE}
+sed -i.bak -e "s,__YT_DIR__,${DEST_DIR}," ${DEST_DIR}/bin/activate.csh
 
 function print_afterword
 {
@@ -608,8 +610,8 @@
     echo
     echo "This modifies the environment variables YT_DEST, PATH, PYTHONPATH, and"
     echo "LD_LIBRARY_PATH to match your new yt install. But don't worry - as soon"
-    echo "as you are done you can run `deactivate` to return to your previous"
-    echo "shell environment."
+    echo "as you are done you can run 'deactivate' to return to your previous"
+    echo "shell environment.  If you use csh, just append .csh to the above."
     echo
     echo "For interactive data analysis and visualization, we recommend running"
     echo "the IPython interface, which will become more fully featured with time:"

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

--

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