[Yt-svn] yt: 2 new changesets
hg at spacepope.org
hg at spacepope.org
Tue Dec 21 10:12:12 PST 2010
hg Repository: yt
details: yt/rev/26a0ea2fb5bb
changeset: 3625:26a0ea2fb5bb
user: Matthew Turk <matthewturk at gmail.com>
date:
Tue Dec 21 10:10:13 2010 -0800
description:
Adding Forthon to the install script.
hg Repository: yt
details: yt/rev/8887a71218d7
changeset: 3626:8887a71218d7
user: Matthew Turk <matthewturk at gmail.com>
date:
Tue Dec 21 10:11:42 2010 -0800
description:
Turning back on particle IO. The fix was to change how the particle fields are
generated: the assignment now operates directly in the particle IO.
diffstat:
doc/install_script.sh | 8 ++++++++
yt/data_objects/data_containers.py | 5 +++--
yt/data_objects/particle_io.py | 5 +++--
yt/data_objects/universal_fields.py | 5 ++---
yt/frontends/enzo/io.py | 4 ++--
5 files changed, 18 insertions(+), 9 deletions(-)
diffs (112 lines):
diff -r 5c8b3e682a15 -r 8887a71218d7 doc/install_script.sh
--- a/doc/install_script.sh Tue Dec 21 10:38:49 2010 -0700
+++ b/doc/install_script.sh Tue Dec 21 10:11:42 2010 -0800
@@ -39,6 +39,7 @@
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?
+INST_FORTHON=1
# If you've got YT some other place, set this to point to it.
YT_DIR=""
@@ -151,6 +152,10 @@
get_willwont ${INST_FTYPE}
echo "be installing freetype2"
+printf "%-15s = %s so I " "INST_FORTHON" "${INST_FORTHON}"
+get_willwont ${INST_FORTHON}
+echo "be installing Forthon (for Halo Finding, etc)"
+
printf "%-15s = %s so I " "INST_HG" "${INST_HG}"
get_willwont ${INST_HG}
echo "be installing Mercurial"
@@ -251,6 +256,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 Forthon-0.8.4.tar.gz
get_enzotools yt.hg
if [ $INST_BZLIB -eq 1 ]
@@ -446,6 +452,7 @@
do_setup_py ipython-0.10
do_setup_py h5py-1.2.0
do_setup_py Cython-0.13
+[ $INST_FORTHON -eq 1 ] && do_setup_py Forthon-0.8.4
echo "Doing yt update, wiping local changes and updating to branch ${BRANCH}"
MY_PWD=`pwd`
@@ -456,6 +463,7 @@
echo $HDF5_DIR > hdf5.cfg
[ $INST_PNG -eq 1 ] && echo $PNG_DIR > png.cfg
[ $INST_FTYPE -eq 1 ] && echo $FTYPE_DIR > freetype.cfg
+[ $INST_FORTHON -eq 1 ] && ( ( cd yt/utilities/kdtree && FORTHON_EXE=${DEST_DIR}/bin/Forthon make 2>&1 ) 1>> ${LOG_FILE} )
( ${DEST_DIR}/bin/python2.6 setup.py develop 2>&1 ) 1>> ${LOG_FILE} || do_exit
touch done
cd $MY_PWD
diff -r 5c8b3e682a15 -r 8887a71218d7 yt/data_objects/data_containers.py
--- a/yt/data_objects/data_containers.py Tue Dec 21 10:38:49 2010 -0700
+++ b/yt/data_objects/data_containers.py Tue Dec 21 10:11:42 2010 -0800
@@ -1914,8 +1914,9 @@
self.pf.field_info.has_key(field) and \
self.pf.field_info[field].particle_type and \
self.pf.h.io._particle_reader:
- self[field] = self.particles[field]
- continue
+ self.particles.get_data(field)
+ if field not in self.data:
+ if self._generate_field(field): continue
mylog.info("Getting field %s from %s", field, len(self._grids))
self[field] = na.concatenate(
[self._get_data_from_grid(grid, field)
diff -r 5c8b3e682a15 -r 8887a71218d7 yt/data_objects/particle_io.py
--- a/yt/data_objects/particle_io.py Tue Dec 21 10:38:49 2010 -0700
+++ b/yt/data_objects/particle_io.py Tue Dec 21 10:11:42 2010 -0800
@@ -90,8 +90,9 @@
rvs = self.pf.h.io._read_particles(
fields_to_read, rtype, args, grid_list, count_list,
conv_factors)
- if len(fields) == 1: return rvs[0]
- return rvs
+ for [n, v] in zip(fields_to_read, rvs):
+ self.source.data[n] = v
+ print self.source.data.keys()
class ParticleIOHandlerRegion(ParticleIOHandlerImplemented):
periodic = False
diff -r 5c8b3e682a15 -r 8887a71218d7 yt/data_objects/universal_fields.py
--- a/yt/data_objects/universal_fields.py Tue Dec 21 10:38:49 2010 -0700
+++ b/yt/data_objects/universal_fields.py Tue Dec 21 10:11:42 2010 -0800
@@ -188,9 +188,8 @@
return (current_time - data["creation_time"])
def _convertParticleAge(data):
return data.convert("years")
-add_field("ParticleAge",
- function=_ParticleAge,
- validators=[ValidateSpatial(0), ValidateDataField("creation_time")],
+add_field("ParticleAge", function=_ParticleAge,
+ validators=[ValidateDataField("creation_time")],
particle_type=True, convert_function=_convertParticleAge)
def _ParticleMass(field, data):
diff -r 5c8b3e682a15 -r 8887a71218d7 yt/frontends/enzo/io.py
--- a/yt/frontends/enzo/io.py Tue Dec 21 10:38:49 2010 -0700
+++ b/yt/frontends/enzo/io.py Tue Dec 21 10:11:42 2010 -0800
@@ -100,7 +100,7 @@
class IOHandlerEnzoHDF5(BaseIOHandler):
_data_style = "enzo_hdf5"
- #_particle_reader = True
+ _particle_reader = True
def _read_field_names(self, grid):
"""
@@ -145,7 +145,7 @@
class IOHandlerPackedHDF5(BaseIOHandler):
_data_style = "enzo_packed_3d"
- #_particle_reader = True
+ _particle_reader = True
def _read_particles(self, fields, rtype, args, grid_list, enclosed,
conv_factors):
More information about the yt-svn
mailing list