[Yt-svn] yt: 2 new changesets
hg at spacepope.org
hg at spacepope.org
Thu Dec 9 12:36:57 PST 2010
hg Repository: yt
details: yt/rev/6c42b545f846
changeset: 3591:6c42b545f846
user: Sam Skillman <sam.skillman at gmail.com>
date:
Thu Dec 09 13:35:54 2010 -0700
description:
Replacing show() with draw() and adding interactive_zoom function in PlotCollectionInteractive. The show->draw replacement allows multiple interactive plots to remain active while exploring and changing widths/colors/limits. interactive_zoom works with TkAgg and MacOSX backends, but will likely fail with threaded backends such as Qt4Agg.
hg Repository: yt
details: yt/rev/64e3e2cdd514
changeset: 3592:64e3e2cdd514
user: Sam Skillman <sam.skillman at gmail.com>
date:
Thu Dec 09 13:36:33 2010 -0700
description:
merging.
diffstat:
doc/install_script.sh | 70 +++++++-
yt/analysis_modules/spectral_integrator/spectral_frequency_integrator.py | 6 +-
yt/data_objects/data_containers.py | 21 +-
yt/data_objects/field_info_container.py | 5 +-
yt/data_objects/static_output.py | 19 ++
yt/frontends/enzo/data_structures.py | 2 +-
yt/frontends/flash/data_structures.py | 57 ++++++-
yt/frontends/flash/fields.py | 63 +++++++-
yt/mods.py | 3 +
yt/utilities/data_point_utilities.c | 2 +-
yt/utilities/parallel_tools/parallel_analysis_interface.py | 8 +
yt/visualization/color_maps.py | 5 +-
yt/visualization/plot_collection.py | 44 +++++-
yt/visualization/plot_types.py | 3 +-
yt/visualization/plot_window.py | 79 +++++++--
15 files changed, 329 insertions(+), 58 deletions(-)
diffs (truncated from 768 to 300 lines):
diff -r 2e69ac29577d -r 64e3e2cdd514 doc/install_script.sh
--- a/doc/install_script.sh Thu Dec 02 16:54:09 2010 -0700
+++ b/doc/install_script.sh Thu Dec 09 13:36:33 2010 -0700
@@ -37,15 +37,16 @@
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.
+INST_FTYPE=1 # Install FreeType2 locally?
INST_ENZO=0 # Clone a copy of Enzo?
# If you've got YT some other place, set this to point to it.
YT_DIR=""
-# If you need to pass anything to matplotlib, do so here:
-#MPL_SUPP_LDFLAGS=""
-#MPL_SUPP_CCFLAGS=""
-#MPL_SUPP_CXXFLAGS=""
+# If you need to pass anything to matplotlib, do so here.
+MPL_SUPP_LDFLAGS=""
+MPL_SUPP_CFLAGS=""
+MPL_SUPP_CXXFLAGS=""
#------------------------------------------------------------------------------#
# #
@@ -142,6 +143,14 @@
get_willwont ${INST_BZLIB}
echo "be installing bzlib"
+printf "%-15s = %s so I " "INST_PNG" "${INST_PNG}"
+get_willwont ${INST_PNG}
+echo "be installing libpng"
+
+printf "%-15s = %s so I " "INST_FTYPE" "${INST_FTYPE}"
+get_willwont ${INST_FTYPE}
+echo "be installing freetype2"
+
printf "%-15s = %s so I " "INST_HG" "${INST_HG}"
get_willwont ${INST_HG}
echo "be installing Mercurial"
@@ -188,7 +197,8 @@
{
[ -e $1/done ] && return
echo "Installing $1 (arguments: '$*')"
- [ ! -e $1 ] && tar xfz $1.tar.gz
+ [ ! -e $1/extracted ] && tar xfz $1.tar.gz
+ touch $1/extracted
cd $1
if [ ! -z `echo $1 | grep h5py` ]
then
@@ -233,6 +243,7 @@
[ $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_FTYPE -eq 1 ] && get_enzotools freetype-2.4.4.tar.gz
get_enzotools Python-2.6.3.tgz
get_enzotools numpy-1.5.1.tar.gz
get_enzotools matplotlib-1.0.0.tar.gz
@@ -240,6 +251,7 @@
get_enzotools ipython-0.10.tar.gz
get_enzotools h5py-1.2.0.tar.gz
get_enzotools Cython-0.13.tar.gz
+get_enzotools yt.hg
if [ $INST_BZLIB -eq 1 ]
then
@@ -294,6 +306,23 @@
LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${PNG_DIR}/lib/"
fi
+if [ $INST_FTYPE -eq 1 ]
+then
+ if [ ! -e freetype-2.4.4/done ]
+ then
+ [ ! -e freetype-2.4.4 ] && tar xfz freetype-2.4.4.tar.gz
+ echo "Installing FreeType2"
+ cd freetype-2.4.4
+ ( ./configure CFLAGS=-I${DEST_DIR}/include --prefix=${DEST_DIR}/ 2>&1 ) 1>> ${LOG_FILE} || do_exit
+ ( make install 2>&1 ) 1>> ${LOG_FILE} || do_exit
+ touch done
+ cd ..
+ fi
+ FTYPE_DIR=${DEST_DIR}
+ export LDFLAGS="${LDFLAGS} -L${FTYPE_DIR}/lib/ -L${FTYPE_DIR}/lib64/"
+ LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${FTYPE_DIR}/lib/"
+fi
+
if [ -z "$HDF5_DIR" ]
then
if [ ! -e hdf5-1.6.9/done ]
@@ -353,11 +382,19 @@
YT_DIR=`dirname $ORIG_PWD`
elif [ ! -e yt-hg ]
then
- # Note that we clone the entire repository, not just the branch in
- # question. We update to the correct branch momentarily...
- ( ${HG_EXEC} --debug clone --pull http://hg.enzotools.org/yt/ ./yt-hg 2>&1 ) 1>> ${LOG_FILE}
YT_DIR="$PWD/yt-hg/"
- ( ${HG_EXEC} up -R ${YT_DIR} -C ${BRANCH} 2>&1 ) 1>> ${LOG_FILE}
+ # Recently the hg server has had some issues with timeouts. In lieu of
+ # a new webserver, we are now moving to a three-stage process.
+ # First we clone the repo, but only up to r0.
+ ( ${HG_EXEC} --debug clone -r0 http://hg.enzotools.org/yt/ ./yt-hg 2>&1 ) 1>> ${LOG_FILE}
+ # Now we unbundle our previously downloaded bundle of changesets.
+ # This bundle has been created to include most of the recent
+ # changesets, which should avoid any problematic timeouts.
+ ( ${HG_EXEC} -R ${YT_DIR} unbundle yt.hg 2>&1 ) 1>> ${LOG_FILE}
+ # Now we pull new changes
+ ( ${HG_EXEC} -R ${YT_DIR} pull 2>&1 ) 1>> ${LOG_FILE}
+ # Now we update to the branch we're interested in.
+ ( ${HG_EXEC} -R ${YT_DIR} up -C ${BRANCH} 2>&1 ) 1>> ${LOG_FILE}
elif [ -e yt-hg ]
then
YT_DIR="$PWD/yt-hg/"
@@ -388,12 +425,16 @@
export CXXFLAGS="${MPL_SUPP_CXXFLAGS}"
echo "Setting CXXFLAGS ${CXXFLAGS}"
fi
-if [ -n "${MPL_SUPP_CCFLAGS}" ]
+if [ -n "${MPL_SUPP_CFLAGS}" ]
then
- OLD_CCFLAGS=${CCFLAGS}
- export CCFLAGS="${MPL_SUPP_CCFLAGS}"
- echo "Setting CCFLAGS ${CCFLAGS}"
+ OLD_CFLAGS=${CFLAGS}
+ export CFLAGS="${MPL_SUPP_CFLAGS}"
+ echo "Setting CFLAGS ${CFLAGS}"
fi
+# Now we set up the basedir for matplotlib:
+mkdir -p ${DEST_DIR}/src/matplotlib-1.0.0
+echo "[directories]" >> ${DEST_DIR}/src/matplotlib-1.0.0/setup.cfg
+echo "basedirlist = ${DEST_DIR}" >> ${DEST_DIR}/src/matplotlib-1.0.0/setup.cfg
do_setup_py matplotlib-1.0.0
if [ -n "${OLD_LDFLAGS}" ]
then
@@ -401,7 +442,7 @@
fi
[ -n "${OLD_LDFLAGS}" ] && export LDFLAGS=${OLD_LDFLAGS}
[ -n "${OLD_CXXFLAGS}" ] && export CXXFLAGS=${OLD_CXXFLAGS}
-[ -n "${OLD_CCFLAGS}" ] && export CCFLAGS=${OLD_CCFLAGS}
+[ -n "${OLD_CFLAGS}" ] && export CFLAGS=${OLD_CFLAGS}
do_setup_py ipython-0.10
do_setup_py h5py-1.2.0
do_setup_py Cython-0.13
@@ -414,6 +455,7 @@
echo "Installing yt"
echo $HDF5_DIR > hdf5.cfg
[ $INST_PNG -eq 1 ] && echo $PNG_DIR > png.cfg
+[ $INST_FTYPE -eq 1 ] && echo $FTYPE_DIR > freetype.cfg
( ${DEST_DIR}/bin/python2.6 setup.py develop 2>&1 ) 1>> ${LOG_FILE} || do_exit
touch done
cd $MY_PWD
diff -r 2e69ac29577d -r 64e3e2cdd514 yt/analysis_modules/spectral_integrator/spectral_frequency_integrator.py
--- a/yt/analysis_modules/spectral_integrator/spectral_frequency_integrator.py Thu Dec 02 16:54:09 2010 -0700
+++ b/yt/analysis_modules/spectral_integrator/spectral_frequency_integrator.py Thu Dec 09 13:36:33 2010 -0700
@@ -24,9 +24,11 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
+import numpy as na
+
from yt.funcs import *
-from yt.mods import add_field
-import numpy as na
+
+from yt.data_objects.field_info_container import add_field
from yt.utilities.linear_interpolators import \
UnilinearFieldInterpolator, \
BilinearFieldInterpolator, \
diff -r 2e69ac29577d -r 64e3e2cdd514 yt/data_objects/data_containers.py
--- a/yt/data_objects/data_containers.py Thu Dec 02 16:54:09 2010 -0700
+++ b/yt/data_objects/data_containers.py Thu Dec 09 13:36:33 2010 -0700
@@ -40,7 +40,7 @@
grid_points_in_volume, planar_points_in_volume, VoxelTraversal, \
QuadTree
from yt.utilities.data_point_utilities import CombineGrids, \
- DataCubeRefine, DataCubeReplace, FillRegion
+ DataCubeRefine, DataCubeReplace, FillRegion, FillBuffer
from yt.utilities.definitions import axis_names, x_dict, y_dict
from yt.utilities.parallel_tools.parallel_analysis_interface import \
ParallelAnalysisInterface
@@ -48,6 +48,8 @@
UnilinearFieldInterpolator, \
BilinearFieldInterpolator, \
TrilinearFieldInterpolator
+from yt.utilities.parameter_file_storage import \
+ ParameterFileStore
from .derived_quantities import DerivedQuantityCollection
from .field_info_container import \
@@ -762,11 +764,14 @@
points = []
for grid in self._get_grids():
points.append(self._generate_grid_coords(grid))
- if len(points) == 0: points = None
- else: points = na.concatenate(points)
- # We have to transpose here so that _mpi_catarray works properly, as
- # it and the alltoall assume the long axis is the last one.
- t = self._mpi_catarray(points.transpose())
+ if len(points) == 0:
+ points = None
+ t = self._mpi_catarray(None)
+ else:
+ points = na.concatenate(points)
+ # We have to transpose here so that _mpi_catarray works properly, as
+ # it and the alltoall assume the long axis is the last one.
+ t = self._mpi_catarray(points.transpose())
self['px'] = t[0,:]
self['py'] = t[1,:]
self['pz'] = t[2,:]
@@ -1764,6 +1769,7 @@
self._dls = {}
self.domain_width = na.rint((self.pf.domain_right_edge -
self.pf.domain_left_edge)/self.dds).astype('int64')
+ self._refresh_data()
def _get_list_of_grids(self):
if self._grids is not None: return
@@ -1802,9 +1808,10 @@
if not self.has_key('pdx'):
self._generate_coords()
if fields == None:
- fields_to_get = self.fields[:]
+ fields_to_get = [f for f in self.fields if f not in self._key_fields]
else:
fields_to_get = ensure_list(fields)
+ if len(fields_to_get) == 0: return
temp_data = {}
for field in fields_to_get:
self[field] = na.zeros(self.dims, dtype='float64')
diff -r 2e69ac29577d -r 64e3e2cdd514 yt/data_objects/field_info_container.py
--- a/yt/data_objects/field_info_container.py Thu Dec 02 16:54:09 2010 -0700
+++ b/yt/data_objects/field_info_container.py Thu Dec 09 13:36:33 2010 -0700
@@ -164,7 +164,8 @@
self.hierarchy = fake_hierarchy()
self.requested = []
self.requested_parameters = []
- defaultdict.__init__(self, lambda: na.ones((nd,nd,nd)))
+ defaultdict.__init__(self,
+ lambda: na.ones((nd,nd,nd), dtype='float64') + 1e-4*na.random.random((nd,nd,nd)))
def __missing__(self, item):
if FieldInfo.has_key(item) and \
FieldInfo[item]._function.func_name != '<lambda>':
@@ -195,7 +196,7 @@
def get_field_parameter(self, param):
self.requested_parameters.append(param)
if param in ['bulk_velocity','center','height_vector']:
- return na.array([0,0,0])
+ return na.random.random(3)*1e-2
else:
return 0.0
_spatial = True
diff -r 2e69ac29577d -r 64e3e2cdd514 yt/data_objects/static_output.py
--- a/yt/data_objects/static_output.py Thu Dec 02 16:54:09 2010 -0700
+++ b/yt/data_objects/static_output.py Thu Dec 09 13:36:33 2010 -0700
@@ -85,6 +85,7 @@
_pf_store.check_pf(self)
except NoParameterShelf:
pass
+ self.print_key_parameters()
def __reduce__(self):
args = (self._hash(),)
@@ -165,6 +166,24 @@
hierarchy = property(_get_hierarchy, _set_hierarchy)
h = property(_get_hierarchy, _set_hierarchy)
+ def print_key_parameters(self):
+ for a in ["current_time", "domain_dimensions", "domain_left_edge",
+ "domain_right_edge", "cosmological_simulation"]:
+ if not hasattr(self, a):
+ mylog.error("Missing %s in parameter file definition!", a)
+ continue
+ v = getattr(self, a)
+ mylog.info("Parameters: %-25s = %s", a, v)
+ if hasattr(self, "cosmological_simulation") and \
+ getattr(self, "cosmological_simulation"):
+ for a in ["current_redshift", "omega_lambda", "omega_matter",
+ "hubble_constant"]:
+ if not hasattr(self, a):
+ mylog.error("Missing %s in parameter file definition!", a)
+ continue
+ v = getattr(self, a)
+ mylog.info("Parameters: %-25s = %s", a, v)
+
def _reconstruct_pf(*args, **kwargs):
pfs = ParameterFileStore()
pf = pfs.get_pf_hash(*args)
diff -r 2e69ac29577d -r 64e3e2cdd514 yt/frontends/enzo/data_structures.py
--- a/yt/frontends/enzo/data_structures.py Thu Dec 02 16:54:09 2010 -0700
+++ b/yt/frontends/enzo/data_structures.py Thu Dec 09 13:36:33 2010 -0700
@@ -527,7 +527,7 @@
self.filenames = ["-1"] * self.num_grids
for id,pid in enumerate(reverse_tree):
self.grids.append(self.grid(id+1, self))
- self.grids[-1].Level = self.grid_levels[id]
+ self.grids[-1].Level = self.grid_levels[id, 0]
if pid > 0:
self.grids[-1]._parent_id = pid
self.grids[pid-1]._children_ids.append(self.grids[-1].id)
diff -r 2e69ac29577d -r 64e3e2cdd514 yt/frontends/flash/data_structures.py
More information about the yt-svn
mailing list