[yt-svn] commit/yt: 2 new changesets
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Mon Jan 13 10:39:48 PST 2014
2 new commits in yt:
https://bitbucket.org/yt_analysis/yt/commits/ea98f4f1778c/
Changeset: ea98f4f1778c
Branch: yt-3.0
User: bcrosby
Date: 2014-01-11 05:34:58
Summary: Ported _read_particle_coords() and _read_particle_fields() to IOHandlerInMemory
Affected #: 1 file
diff -r 4ef4449dc0af669eed5d6477f70487a7be779e00 -r ea98f4f1778ca1967df92620bced0a2a47c7859b yt/frontends/enzo/io.py
--- a/yt/frontends/enzo/io.py
+++ b/yt/frontends/enzo/io.py
@@ -277,6 +277,57 @@
nd = g.select(selector, data_view, rv[field], ind)
return rv
+ def _read_particle_coords(self, chunks, ptf):
+ chunks = list(chunks)
+ for chunk in chunks: # These should be organized by grid filename
+ for g in chunk.objs:
+ if g.id not in self.grids_in_memory: continue
+
+ nap = sum(g.NumberOfActiveParticles.values())
+ if g.NumberOfParticles == 0 and nap == 0:
+ continue
+ for ptype, field_list in sorted(ptf.items()):
+ # this if/else can probably be removed
+ if ptype != "io":
+ if g.NumberOfActiveParticles[ptype] == 0: continue
+ pds = self.grids_in_memory[g.id][ptype]
+ else:
+ pds = self.grids_in_memory[g.id]
+ # remove to above comment?
+ x, y, z = self.grids_in_memory[g.id]['particle_position_x'], \
+ self.grids_in_memory[g.id]['particle_position_y'], \
+ self.grids_in_memory[g.id]['particle_position_z']
+ yield ptype, (x, y, z)
+
+ def _read_particle_fields(self, chunks, ptf, selector):
+ chunks = list(chunks)
+ for chunk in chunks: # These should be organized by grid filename
+ for g in chunk.objs:
+ if g.id not in self.grids_in_memory: continue
+
+ nap = sum(g.NumberOfActiveParticles.values())
+ if g.NumberOfParticles == 0 and nap == 0:
+ continue
+
+ for ptype, field_list in sorted(ptf.items()):
+ # remove to below comment?
+ if ptype != "io":
+ if g.NumberOfActiveParticles[ptype] == 0: continue
+ pds = self.grids_in_memory[g.id][ptype]
+ else:
+ pds = self.grids_in_memory[g.id]
+ # remove to above comment?
+ x, y, z = self.grids_in_memory[g.id]['particle_position_x'], \
+ self.grids_in_memory[g.id]['particle_position_y'], \
+ self.grids_in_memory[g.id]['particle_position_z']
+ mask = selector.select_points(x, y, z)
+ if mask is None: continue
+ for field in field_list:
+ data = self.grids_in_memory[g.id][field]
+ if field in _convert_mass:
+ data *= g.dds.prod(dtype="f8")
+ yield (ptype, field), data[mask]
+
@property
def _read_exception(self):
return KeyError
https://bitbucket.org/yt_analysis/yt/commits/c690a3e1a6b7/
Changeset: c690a3e1a6b7
Branch: yt-3.0
User: bcrosby
Date: 2014-01-11 05:50:24
Summary: Removed conditions from the HDF5 version that are not needed when the enzo module is used.
Affected #: 1 file
diff -r ea98f4f1778ca1967df92620bced0a2a47c7859b -r c690a3e1a6b7fd8caf6a4e2571f6d960caecd6af yt/frontends/enzo/io.py
--- a/yt/frontends/enzo/io.py
+++ b/yt/frontends/enzo/io.py
@@ -282,18 +282,9 @@
for chunk in chunks: # These should be organized by grid filename
for g in chunk.objs:
if g.id not in self.grids_in_memory: continue
-
nap = sum(g.NumberOfActiveParticles.values())
- if g.NumberOfParticles == 0 and nap == 0:
- continue
+ if g.NumberOfParticles == 0 and nap == 0: continue
for ptype, field_list in sorted(ptf.items()):
- # this if/else can probably be removed
- if ptype != "io":
- if g.NumberOfActiveParticles[ptype] == 0: continue
- pds = self.grids_in_memory[g.id][ptype]
- else:
- pds = self.grids_in_memory[g.id]
- # remove to above comment?
x, y, z = self.grids_in_memory[g.id]['particle_position_x'], \
self.grids_in_memory[g.id]['particle_position_y'], \
self.grids_in_memory[g.id]['particle_position_z']
@@ -304,19 +295,9 @@
for chunk in chunks: # These should be organized by grid filename
for g in chunk.objs:
if g.id not in self.grids_in_memory: continue
-
nap = sum(g.NumberOfActiveParticles.values())
- if g.NumberOfParticles == 0 and nap == 0:
- continue
-
+ if g.NumberOfParticles == 0 and nap == 0: continue
for ptype, field_list in sorted(ptf.items()):
- # remove to below comment?
- if ptype != "io":
- if g.NumberOfActiveParticles[ptype] == 0: continue
- pds = self.grids_in_memory[g.id][ptype]
- else:
- pds = self.grids_in_memory[g.id]
- # remove to above comment?
x, y, z = self.grids_in_memory[g.id]['particle_position_x'], \
self.grids_in_memory[g.id]['particle_position_y'], \
self.grids_in_memory[g.id]['particle_position_z']
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