[yt-svn] commit/yt-3.0: MatthewTurk: Skip empty block lists in kD-tree and use _get_field_info in grid patch.
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Thu Oct 24 11:56:12 PDT 2013
1 new commit in yt-3.0:
https://bitbucket.org/yt_analysis/yt-3.0/commits/788e19ee51e6/
Changeset: 788e19ee51e6
Branch: yt-3.0
User: MatthewTurk
Date: 2013-10-24 20:29:22
Summary: Skip empty block lists in kD-tree and use _get_field_info in grid patch.
Also supply optional argument for get_field_info to make it guess.
Affected #: 3 files
diff -r a068074be818374213c9a209eb681d84e2bd778a -r 788e19ee51e682974a4d576f0e0912611c92d454 yt/data_objects/grid_patch.py
--- a/yt/data_objects/grid_patch.py
+++ b/yt/data_objects/grid_patch.py
@@ -259,7 +259,8 @@
new_field[1:,1:,:-1] += of
new_field[1:,1:,1:] += of
np.multiply(new_field, 0.125, new_field)
- if self.pf.field_info[field].take_log:
+ finfo = self.pf._get_field_info(field)
+ if finfo.take_log:
new_field = np.log10(new_field)
new_field[:,:, -1] = 2.0*new_field[:,:,-2] - new_field[:,:,-3]
@@ -269,7 +270,7 @@
new_field[-1,:,:] = 2.0*new_field[-2,:,:] - new_field[-3,:,:]
new_field[0,:,:] = 2.0*new_field[1,:,:] - new_field[2,:,:]
- if self.pf.field_info[field].take_log:
+ if finfo.take_log:
np.power(10.0, new_field, new_field)
else:
cg = self.retrieve_ghost_zones(1, field, smoothed=smoothed)
diff -r a068074be818374213c9a209eb681d84e2bd778a -r 788e19ee51e682974a4d576f0e0912611c92d454 yt/data_objects/static_output.py
--- a/yt/data_objects/static_output.py
+++ b/yt/data_objects/static_output.py
@@ -291,7 +291,9 @@
_last_freq = (None, None)
_last_finfo = None
- def _get_field_info(self, ftype, fname):
+ def _get_field_info(self, ftype, fname = None):
+ if fname is None:
+ ftype, fname = "unknown", ftype
guessing_type = False
if ftype == "unknown" and self._last_freq[0] != None:
ftype = self._last_freq[0]
diff -r a068074be818374213c9a209eb681d84e2bd778a -r 788e19ee51e682974a4d576f0e0912611c92d454 yt/utilities/amr_kdtree/amr_kdtree.py
--- a/yt/utilities/amr_kdtree/amr_kdtree.py
+++ b/yt/utilities/amr_kdtree/amr_kdtree.py
@@ -83,6 +83,7 @@
grids = np.array([b for b, mask in self.data_source.blocks if b.Level == lvl])
gids = np.array([g.id for g in grids if g.Level == lvl],
dtype="int64")
+ if len(grids) == 0: continue
self.add_grids(grids)
def check_tree(self):
Repository URL: https://bitbucket.org/yt_analysis/yt-3.0/
--
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