[Yt-svn] yt: 2 new changesets

hg at spacepope.org hg at spacepope.org
Tue Sep 7 15:31:28 PDT 2010


hg Repository: yt
details:   yt/rev/e21304c5d59e
changeset: 3390:e21304c5d59e
user:      Britton Smith <brittonsmith at gmail.com>
date:
Tue Sep 07 18:31:02 2010 -0400
description:
Put md5 import in a try block.

hg Repository: yt
details:   yt/rev/29e6df16f738
changeset: 3391:29e6df16f738
user:      Britton Smith <brittonsmith at gmail.com>
date:
Tue Sep 07 18:31:25 2010 -0400
description:
Merged.

diffstat:

 doc/install_script.sh                               |  111 ++++++++----------
 setup.py                                            |    2 +-
 yt/analysis_modules/halo_merger_tree/merger_tree.py |    7 +-
 yt/analysis_modules/light_ray/light_ray.py          |    1 -
 yt/frontends/gadget/data_structures.py              |   95 +++++++--------
 yt/frontends/gadget/fields.py                       |   49 +++++++-
 yt/frontends/gadget/io.py                           |   14 +-
 yt/frontends/ramses/data_structures.py              |   12 +-
 yt/frontends/ramses/io.py                           |    2 +
 yt/utilities/answer_testing/api.py                  |    4 +
 yt/utilities/answer_testing/hydro_tests.py          |    1 +
 yt/utilities/answer_testing/runner.py               |   14 ++-
 yt/utilities/command_line.py                        |    7 +-
 yt/utilities/logger.py                              |   37 +-----
 yt/visualization/plot_collection.py                 |  135 +++++++++++++++++++---
 yt/visualization/plot_types.py                      |    6 +-
 16 files changed, 307 insertions(+), 190 deletions(-)

diffs (truncated from 1044 to 300 lines):

diff -r 3c6f946f64a9 -r 29e6df16f738 doc/install_script.sh
--- a/doc/install_script.sh	Fri Sep 03 16:53:10 2010 -0400
+++ b/doc/install_script.sh	Tue Sep 07 18:31:25 2010 -0400
@@ -17,6 +17,7 @@
 
 DEST_SUFFIX="yt-`uname -p`"
 DEST_DIR="`pwd`/${DEST_SUFFIX/ /}"   # Installation location
+BRANCH="yt" # This is the branch to which we will forcibly update.
 
 # Here's where you put the HDF5 path if you like; otherwise it'll download it
 # and install it on its own
@@ -28,13 +29,14 @@
 # If you absolutely can't get the fortran to work, try this:
 #NUMPY_ARGS="--fcompiler=fake"
 
-INST_WXPYTHON=0 # If you want to install wxPython, set this to 1
+INST_HG=1       # Install Mercurial or not?  If hg is not already
+                # installed, yt cannot be installed.
 INST_ZLIB=1     # On some systems (Kraken) matplotlib has issues with 
                 # the system zlib, which is compiled statically.
                 # If need be, you can turn this off.
-INST_PNG=0      # Install a local libpng?  Same things apply as with zlib.
-INST_TRAITS=0   # Experimental TraitsUI installation
-INST_HG=1       # Install Mercurial or not?
+INST_BZLIB=1    # On some systems, libbzip2 is missing.  This can
+                # lead to broken mercurial installations.
+INST_PNG=1      # Install a local libpng?  Same things apply as with zlib.
 
 # If you've got YT some other place, set this to point to it.
 YT_DIR=""
@@ -126,22 +128,18 @@
 echo "they're currently set to -- you can hit Ctrl-C and edit the values in "
 echo "the script if you aren't such a fan."
 echo
-printf "%-15s = %s so I " "INST_WXPYTHON" "${INST_WXPYTHON}"
-get_willwont $INST_WXPYTHON
-echo "be installing wxPython"
-
 printf "%-15s = %s so I " "INST_ZLIB" "${INST_ZLIB}"
 get_willwont ${INST_ZLIB}
 echo "be installing zlib"
 
+printf "%-15s = %s so I " "INST_BZLIB" "${INST_BZLIB}"
+get_willwont ${INST_BZLIB}
+echo "be installing bzlib"
+
 printf "%-15s = %s so I " "INST_HG" "${INST_HG}"
 get_willwont ${INST_HG}
 echo "be installing Mercurial"
 
-printf "%-15s = %s so I " "INST_TRAITS" "${INST_TRAITS}"
-get_willwont ${INST_TRAITS}
-echo "be installing Traits"
-
 echo
 
 if [ -z "$HDF5_DIR" ]
@@ -151,13 +149,6 @@
     echo "HDF5_DIR=${HDF5_DIR} , so I will not be installing HDF5"
 fi
 
-if [ -z "$YT_DIR" ]
-then
-    echo "YT_DIR is not set, so I will be checking out a fresh copy"
-else
-    echo "YT_DIR=${YT_DIR} , so I will use that for YT"
-fi
-
 echo
 echo "Installation will be to"
 echo "  ${DEST_DIR}"
@@ -230,31 +221,31 @@
 fi
 
 [ $INST_ZLIB -eq 1 ] && get_enzotools zlib-1.2.3.tar.bz2 
+[ $INST_BZLIB -eq 1 ] && get_enzotools bzip2-1.0.5.tar.gz
 [ $INST_PNG -eq 1 ] && get_enzotools libpng-1.2.43.tar.gz
-[ $INST_WXPYTHON -eq 1 ] && get_enzotools wxPython-src-2.8.10.1.tar.bz2
 get_enzotools Python-2.6.3.tgz
 get_enzotools numpy-1.4.1.tar.gz
 get_enzotools matplotlib-0.99.3.tar.gz
+get_enzotools mercurial-1.6.3.tar.gz
 get_enzotools ipython-0.10.tar.gz
 get_enzotools h5py-1.2.0.tar.gz
 
-if [ -z "$YT_DIR" ]
+if [ $INST_BZLIB -eq 1 ]
 then
-    if [ -e $ORIG_PWD/yt/mods.py ]
+    if [ ! -e bzip2-1.0.5/done ]
     then
-        YT_DIR="$ORIG_PWD"
-    elif [ -e $ORIG_PWD/../yt/mods.py ]
-    then
-        YT_DIR=`dirname $ORIG_PWD`
-    elif [ ! -e yt-trunk-svn ] 
-    then
-        ( svn co http://svn.enzotools.org/yt/trunk/ ./yt-trunk-svn 2>&1 ) 1>> ${LOG_FILE}
-        YT_DIR="$PWD/yt-trunk-svn/"
-    elif [ -e yt-trunk-svn ] 
-    then
-        YT_DIR="$PWD/yt-trunk-svn/"
+        [ ! -e bzip2-1.0.5 ] && tar xfz bzip2-1.0.5.tar.gz
+        echo "Installing BZLIB"
+        cd bzip2-1.0.5
+        ( make install CFLAGS=-fPIC LDFLAGS=-fPIC PREFIX=${DEST_DIR} 2>&1 ) 1>> ${LOG_FILE} || do_exit
+        ( make -f Makefile-libbz2_so CFLAGS=-fPIC LDFLAGS=-fPIC PREFIX=${DEST_DIR} 2>&1 ) 1>> ${LOG_FILE} || do_exit
+        ( cp -v libbz2.so.1.0.4 ${DEST_DIR}/lib 2>&1 ) 1>> ${LOG_FILE} || do_exit
+        touch done
+        cd ..
     fi
-    echo Setting YT_DIR=${YT_DIR}
+    BZLIB_DIR=${DEST_DIR}
+    export LDFLAGS="${LDFLAGS} -L${BZLIB_DIR}/lib/ -L${BZLIB_DIR}/lib64/"
+    LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${BZLIB_DIR}/lib/"
 fi
 
 if [ $INST_ZLIB -eq 1 ]
@@ -324,23 +315,29 @@
 
 export PYTHONPATH=${DEST_DIR}/lib/python2.6/site-packages/
 
-if [ $INST_WXPYTHON -eq 1 ] && [ ! -e wxPython-src-2.8.10.1/done ]
+if [ $INST_HG -eq 1 ]
 then
-    echo "Installing wxPython.  This may take a while, but don't worry.  YT loves you."
-    [ ! -e wxPython-src-2.8.10.1 ] && tar xfj wxPython-src-2.8.10.1.tar.bz2
-    cd wxPython-src-2.8.10.1
+    echo "Installing Mercurial."
+    do_setup_py mercurial-1.6.3
+fi
 
-    get_enzotools wxpython28101_gdiwrap.diff
-    patch -p0 < wxpython28101_gdiwrap.diff
-    ( ./configure --prefix=${DEST_DIR}/ --with-opengl 2>&1 ) 1>> ${LOG_FILE} || do_exit
-    ( make install 2>&1 ) 1>> ${LOG_FILE} || do_exit
-    cd contrib
-    ( make install 2>&1 ) 1>> ${LOG_FILE} || do_exit
-    cd ../wxPython/
-    ( ${DEST_DIR}/bin/python2.6 setup.py WX_CONFIG=${DEST_DIR}/bin/wx-config install 2>&1 ) 1>> ${LOG_FILE} || do_exit
-
-    touch ../done
-    cd ../..
+if [ -z "$YT_DIR" ]
+then
+    if [ -e $ORIG_PWD/yt/mods.py ]
+    then
+        YT_DIR="$ORIG_PWD"
+    elif [ -e $ORIG_PWD/../yt/mods.py ]
+    then
+        YT_DIR=`dirname $ORIG_PWD`
+    elif [ ! -e yt-hg ] 
+    then
+        ( ${DEST_DIR}/bin/hg clone -r ${BRANCH} http://hg.enzotools.org/yt/ ./yt-hg 2>&1 ) 1>> ${LOG_FILE}
+        YT_DIR="$PWD/yt-hg/"
+    elif [ -e yt-hg ] 
+    then
+        YT_DIR="$PWD/yt-hg/"
+    fi
+    echo Setting YT_DIR=${YT_DIR}
 fi
 
 # This fixes problems with gfortran linking.
@@ -364,10 +361,10 @@
 do_setup_py ipython-0.10
 do_setup_py h5py-1.2.0
 
-echo "Doing yt update"
+echo "Doing yt update, wiping local changes and updating to branch ${BRANCH}"
 MY_PWD=`pwd`
 cd $YT_DIR
-( svn up 2>&1 ) 1>> ${LOG_FILE}
+( ${DEST_DIR}/bin/hg pull && ${DEST_DIR}/bin/hg up -C ${BRANCH} 2>&1 ) 1>> ${LOG_FILE}
 
 echo "Installing yt"
 echo $HDF5_DIR > hdf5.cfg
@@ -376,18 +373,6 @@
 touch done
 cd $MY_PWD
 
-if [ $INST_HG -eq 1 ]
-then
-    echo "Installing Mercurial."
-    ( ${DEST_DIR}/bin/pip install -U mercurial 2>&1 ) 1>> ${LOG_FILE} || do_exit
-fi
-
-if [ $INST_WXPYTHON -eq 1 ] && [ $INST_TRAITS -eq 1 ]
-then
-    echo "Installing Traits"
-    ( ${DEST_DIR}/bin/pip install -U TraitsGUI TraitsBackendWX 2>&1 ) 1>> ${LOG_FILE} || do_exit
-fi
-
 echo
 echo
 echo "========================================================================"
diff -r 3c6f946f64a9 -r 29e6df16f738 setup.py
--- a/setup.py	Fri Sep 03 16:53:10 2010 -0400
+++ b/setup.py	Tue Sep 07 18:31:25 2010 -0400
@@ -56,7 +56,7 @@
                            'pdf' : ['pypdf']},
         entry_points = { 'console_scripts' : [
                             'yt = yt.utilities.command_line:run_main',
-                            'enzo_test = yt.extensions.enzo_test:run_main',
+                            'enzo_test = yt.utilities.answer_testing.runner:run_main',
                        ]},
         author="Matthew J. Turk",
         author_email="matthewturk at gmail.com",
diff -r 3c6f946f64a9 -r 29e6df16f738 yt/analysis_modules/halo_merger_tree/merger_tree.py
--- a/yt/analysis_modules/halo_merger_tree/merger_tree.py	Fri Sep 03 16:53:10 2010 -0400
+++ b/yt/analysis_modules/halo_merger_tree/merger_tree.py	Tue Sep 07 18:31:25 2010 -0400
@@ -24,7 +24,7 @@
 """
 
 import numpy as na
-import os, glob, md5, time, gc, sys
+import os, glob, time, gc, sys
 import h5py
 import types
 
@@ -46,6 +46,11 @@
     parallel_blocking_call
 
 try:
+    import md5
+except ImportError:
+    mylog.error("md5 not imported!")
+
+try:
     import sqlite3 as sql
 except ImportError:
     mylog.error("sqlite3 not imported!")
diff -r 3c6f946f64a9 -r 29e6df16f738 yt/analysis_modules/light_ray/light_ray.py
--- a/yt/analysis_modules/light_ray/light_ray.py	Fri Sep 03 16:53:10 2010 -0400
+++ b/yt/analysis_modules/light_ray/light_ray.py	Tue Sep 07 18:31:25 2010 -0400
@@ -44,7 +44,6 @@
 from yt.analysis_modules.halo_profiler.multi_halo_profiler import \
     HaloProfiler
 from yt.convenience import load
-from yt.utilities.logger import lagosLogger as mylog
 
 class LightRay(EnzoSimulation):
     def __init__(self, EnzoParameterFile, FinalRedshift, InitialRedshift, 
diff -r 3c6f946f64a9 -r 29e6df16f738 yt/frontends/gadget/data_structures.py
--- a/yt/frontends/gadget/data_structures.py	Fri Sep 03 16:53:10 2010 -0400
+++ b/yt/frontends/gadget/data_structures.py	Tue Sep 07 18:31:25 2010 -0400
@@ -26,8 +26,8 @@
 """
 
 import h5py
-import numpy as np
-import ipdb
+import numpy as na
+from itertools import izip
 
 from yt.funcs import *
 from yt.data_objects.grid_patch import \
@@ -41,42 +41,26 @@
 
 class GadgetGrid(AMRGridPatch):
     _id_offset = 0
-    def __init__(self, hierarchy, id,dimensions,left_index,
-            level,parent_id,particle_count,Parent=[],Children=[]):
+    def __init__(self, hierarchy, id, dimensions, left_index,
+                 level, parent_id, particle_count):
         AMRGridPatch.__init__(self, id, filename = hierarchy.filename,
                               hierarchy = hierarchy)
         self.id = id
-        self.address = '/data/grid_%010i'%id
-        self.dimensions = dimensions
-        self.left_index = left_index
-        self.level = level
+        self.ActiveDimensions = dimensions
+        self.start_index = left_index.astype("int64")
         self.Level = level
-        self.parent_id = parent_id
-        self.particle_count = particle_count
+        self._parent_id = parent_id
+        self.Parent = None # Only one parent per grid
+        self.Children = []
+        self.NumberOfParticles = particle_count
         
         try:
-            padd =self.address+'/particles'
+            padd = '/data/grid_%010i/particles' % id
             self.particle_types = self.hierarchy._handle[padd].keys()
         except:
             self.particle_types =  ()
         self.filename = hierarchy.filename
         
-        self.Parent = Parent
-        self.Children = Children
-        
-    def _setup_dx(self):
-        # So first we figure out what the index is.  We don't assume
-        # that dx=dy=dz , at least here.  We probably do elsewhere.
-        if len(self.Parent)>0:
-            self.dds = self.Parent[0].dds / self.pf.refine_by
-        else:
-            LE, RE = self.hierarchy.grid_left_edge[self.id,:], \
-                     self.hierarchy.grid_right_edge[self.id,:]



More information about the yt-svn mailing list