[Yt-svn] yt: Fixes to FixedResProj. Adding on a call to _refresh_data to...

hg at spacepope.org hg at spacepope.org
Wed Dec 8 09:28:56 PST 2010


hg Repository: yt
details:   yt/rev/77e711615681
changeset: 3581:77e711615681
user:      Matthew Turk <matthewturk at gmail.com>
date:
Wed Dec 08 09:28:15 2010 -0800
description:
Fixes to FixedResProj.  Adding on a call to _refresh_data to make sure that
fields= gets used immediately, and making sure that we don't ask for the
_key_fields in _get_data.

diffstat:

 yt/data_objects/data_containers.py |  4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diffs (23 lines):

diff -r e6bd204c661f -r 77e711615681 yt/data_objects/data_containers.py
--- a/yt/data_objects/data_containers.py	Tue Dec 07 19:16:00 2010 -0800
+++ b/yt/data_objects/data_containers.py	Wed Dec 08 09:28:15 2010 -0800
@@ -1766,6 +1766,7 @@
         self._dls = {}
         self.domain_width = na.rint((self.pf.domain_right_edge -
                     self.pf.domain_left_edge)/self.dds).astype('int64')
+        self._refresh_data()
 
     def _get_list_of_grids(self):
         if self._grids is not None: return
@@ -1804,9 +1805,10 @@
         if not self.has_key('pdx'):
             self._generate_coords()
         if fields == None:
-            fields_to_get = self.fields[:]
+            fields_to_get = [f for f in self.fields if f not in self._key_fields]
         else:
             fields_to_get = ensure_list(fields)
+        if len(fields_to_get) == 0: return
         temp_data = {}
         for field in fields_to_get:
             self[field] = na.zeros(self.dims, dtype='float64')



More information about the yt-svn mailing list