[yt-svn] commit/yt: MatthewTurk: Merged in hegan/yt/yt-3.0 (pull request #931)
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Wed Jun 4 17:03:06 PDT 2014
1 new commit in yt:
https://bitbucket.org/yt_analysis/yt/commits/fe4b3e445a40/
Changeset: fe4b3e445a40
Branch: yt-3.0
User: MatthewTurk
Date: 2014-06-05 02:02:59
Summary: Merged in hegan/yt/yt-3.0 (pull request #931)
changes so that inline frontend can recognize particle fields
Affected #: 1 file
diff -r 094b6fc944711b4d719fb70770c8e79548bfd919 -r fe4b3e445a40ed0af3a9ce4740b88f4bb35a8a54 yt/frontends/enzo/io.py
--- a/yt/frontends/enzo/io.py
+++ b/yt/frontends/enzo/io.py
@@ -235,7 +235,18 @@
BaseIOHandler.__init__(self, pf)
def _read_field_names(self, grid):
- return [("enzo", field) for field in self.grids_in_memory[grid.id].keys()]
+ fields = []
+ add_io = "io" in grid.pf.particle_types
+ for name, v in self.grids_in_memory[grid.id].items():
+
+ # NOTE: This won't work with 1D datasets or references.
+ if not hasattr(v, "shape") or v.dtype == "O":
+ continue
+ elif v.ndim == 1:
+ if add_io: fields.append( ("io", str(name)) )
+ else:
+ fields.append( ("enzo", str(name)) )
+ return fields
def _read_fluid_selection(self, chunks, selector, fields, size):
rv = {}
@@ -296,7 +307,7 @@
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)
+ mask = selector.select_points(x, y, z, 0.0)
if mask is None: continue
for field in field_list:
data = self.grids_in_memory[g.id][field]
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