[yt-svn] commit/yt: 2 new changesets

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Wed Mar 19 09:25:54 PDT 2014


2 new commits in yt:

https://bitbucket.org/yt_analysis/yt/commits/55bfe6d9264d/
Changeset:   55bfe6d9264d
Branch:      yt-3.0
User:        MatthewTurk
Date:        2014-03-14 20:02:25
Summary:     Adding a mechanism for ensuring index has been created.

Should we use this in the .field_list as well?
Affected #:  1 file

diff -r fa45403f8a392652e6ec58d992f49dbdeed64899 -r 55bfe6d9264dc6b543f5d163d24a737c3e51bcec yt/data_objects/static_output.py
--- a/yt/data_objects/static_output.py
+++ b/yt/data_objects/static_output.py
@@ -81,6 +81,20 @@
             return getattr(self.ds.index, name)
         raise AttributeError
 
+def requires_index(attr_name):
+    @property
+    def ireq(self):
+        self.index
+        # By now it should have been set
+        attr = self.__dict__[attr_name]
+        return attr
+
+    @ireq.setter
+    def ireq(self, value):
+        self.__dict__[attr_name] = value
+
+    return ireq
+
 class Dataset(object):
 
     default_fluid_type = "gas"
@@ -95,6 +109,7 @@
     known_filters = None
     _index_class = None
     field_units = None
+    derived_field_list = requires_index("derived_field_list")
 
     class __metaclass__(type):
         def __init__(cls, name, b, d):


https://bitbucket.org/yt_analysis/yt/commits/fda591adc4f2/
Changeset:   fda591adc4f2
Branch:      yt-3.0
User:        ngoldbaum
Date:        2014-03-19 17:25:47
Summary:     Merged in MatthewTurk/yt/yt-3.0 (pull request #722)

Adding a mechanism for ensuring index has been created.
Affected #:  1 file

diff -r f31a4502dad8691791600432252743771a7d5b62 -r fda591adc4f24f4d67f4da7f53272ceda3a3de66 yt/data_objects/static_output.py
--- a/yt/data_objects/static_output.py
+++ b/yt/data_objects/static_output.py
@@ -81,6 +81,20 @@
             return getattr(self.ds.index, name)
         raise AttributeError
 
+def requires_index(attr_name):
+    @property
+    def ireq(self):
+        self.index
+        # By now it should have been set
+        attr = self.__dict__[attr_name]
+        return attr
+
+    @ireq.setter
+    def ireq(self, value):
+        self.__dict__[attr_name] = value
+
+    return ireq
+
 class Dataset(object):
 
     default_fluid_type = "gas"
@@ -95,6 +109,7 @@
     known_filters = None
     _index_class = None
     field_units = None
+    derived_field_list = requires_index("derived_field_list")
 
     class __metaclass__(type):
         def __init__(cls, name, b, d):

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