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

Bitbucket commits-noreply at bitbucket.org
Fri Feb 3 11:23:49 PST 2012


2 new commits in yt:


https://bitbucket.org/yt_analysis/yt/changeset/a4d969d99aed/
changeset:   a4d969d99aed
branch:      yt
user:        samskillman
date:        2012-02-03 19:00:33
summary:     Adding pf.center and pf.width for convenience
affected #:  1 file

diff -r 9d72d2c6f211dd5342291506a799b297942eae1b -r a4d969d99aed84df40d276b0a66bbb7c6b3b1297 yt/data_objects/static_output.py
--- a/yt/data_objects/static_output.py
+++ b/yt/data_objects/static_output.py
@@ -91,6 +91,7 @@
 
         self._parse_parameter_file()
         self._set_units()
+        self._set_derived_attrs()
 
         # Because we need an instantiated class to check the pf's existence in
         # the cache, we move that check to here from __new__.  This avoids
@@ -103,6 +104,10 @@
 
         self.create_field_info()
 
+    def _set_derived_attrs(self):
+        self.center = 0.5 * (self.domain_right_edge + self.domain_left_edge)
+        self.width = self.domain_right_edge - self.domain_left_edge
+
     def __reduce__(self):
         args = (self._hash(),)
         return (_reconstruct_pf, args)



https://bitbucket.org/yt_analysis/yt/changeset/bbb5aeca876f/
changeset:   bbb5aeca876f
branch:      yt
user:        samskillman
date:        2012-02-03 19:22:28
summary:     prefixing center, width with domain_
affected #:  1 file

diff -r a4d969d99aed84df40d276b0a66bbb7c6b3b1297 -r bbb5aeca876f1f3fbc2a14f60b6a853e7589f347 yt/data_objects/static_output.py
--- a/yt/data_objects/static_output.py
+++ b/yt/data_objects/static_output.py
@@ -105,8 +105,8 @@
         self.create_field_info()
 
     def _set_derived_attrs(self):
-        self.center = 0.5 * (self.domain_right_edge + self.domain_left_edge)
-        self.width = self.domain_right_edge - self.domain_left_edge
+        self.domain_center = 0.5 * (self.domain_right_edge + self.domain_left_edge)
+        self.domain_width = self.domain_right_edge - self.domain_left_edge
 
     def __reduce__(self):
         args = (self._hash(),)

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