[Yt-svn] commit/yt: MatthewTurk: Changing the mechanism for detecting fields slightly by ensuring that the
Bitbucket
commits-noreply at bitbucket.org
Mon Apr 25 08:55:08 PDT 2011
1 new changeset in yt:
http://bitbucket.org/yt_analysis/yt/changeset/c63c3cf317fd/
changeset: r4200:c63c3cf317fd
branch: yt
user: MatthewTurk
date: 2011-04-25 17:53:19
summary: Changing the mechanism for detecting fields slightly by ensuring that the
parameter file's field info is the item that's queried for the existence of a
dependency field. This should ensure that *more* fields are included in
pf.h.derived_field_list. For instance, as it stands, none of the
[Species]_Fraction fields are in derived_field_list, but this changeset fixes
that.
affected #: 1 file (68 bytes)
--- a/yt/data_objects/field_info_container.py Mon Apr 25 11:27:48 2011 -0400
+++ b/yt/data_objects/field_info_container.py Mon Apr 25 11:53:19 2011 -0400
@@ -177,15 +177,16 @@
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>':
+ FI = getattr(self.pf, "field_info", FieldInfo)
+ if FI.has_key(item) and \
+ FI[item]._function.func_name != '<lambda>':
try:
- vv = FieldInfo[item](self)
+ vv = FI[item](self)
except NeedsGridType as exc:
ngz = exc.ghost_zones
nfd = FieldDetector(self.nd+ngz*2)
nfd._num_ghost_zones = ngz
- vv = FieldInfo[item](nfd)
+ vv = FI[item](nfd)
if ngz > 0: vv = vv[ngz:-ngz,ngz:-ngz,ngz:-ngz]
for i in nfd.requested:
if i not in self.requested: self.requested.append(i)
@@ -200,8 +201,9 @@
def _read_data(self, field_name):
self.requested.append(field_name)
- if FieldInfo.has_key(field_name) and \
- FieldInfo[field_name].particle_type:
+ FI = getattr(self.pf, "field_info", FieldInfo)
+ if FI.has_key(field_name) and \
+ FI[field_name].particle_type:
self.requested.append(field_name)
return na.ones(self.NumberOfParticles)
return defaultdict.__missing__(self, field_name)
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