[yt-svn] commit/yt: MatthewTurk: Merged in ngoldbaum/yt (pull request #1327)

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Mon Dec 8 09:57:14 PST 2014


1 new commit in yt:

https://bitbucket.org/yt_analysis/yt/commits/035841dcdeb1/
Changeset:   035841dcdeb1
Branch:      yt
User:        MatthewTurk
Date:        2014-12-08 17:56:57+00:00
Summary:     Merged in ngoldbaum/yt (pull request #1327)

Fix issues with the "center" field parameter being set to None. Closes #946.
Affected #:  2 files

diff -r e2419cd7c32929d3fdfa8d4077f280dfaa17bbcf -r 035841dcdeb12e347ecac6934c39e141d4785aef yt/data_objects/data_containers.py
--- a/yt/data_objects/data_containers.py
+++ b/yt/data_objects/data_containers.py
@@ -164,7 +164,6 @@
     def _set_center(self, center):
         if center is None:
             self.center = None
-            self.set_field_parameter('center', self.center)
             return
         elif isinstance(center, YTArray):
             self.center = self.ds.arr(center.in_cgs())
@@ -904,7 +903,7 @@
             return frb
 
         if center is None:
-            center = self.get_field_parameter("center")
+            center = self.center
             if center is None:
                 center = (self.ds.domain_right_edge
                         + self.ds.domain_left_edge)/2.0

diff -r e2419cd7c32929d3fdfa8d4077f280dfaa17bbcf -r 035841dcdeb12e347ecac6934c39e141d4785aef yt/fields/vector_operations.py
--- a/yt/fields/vector_operations.py
+++ b/yt/fields/vector_operations.py
@@ -121,7 +121,9 @@
                      - data[ftype, "radial_%s" % basename]**2.0)
 
     registry.add_field((ftype, "radial_%s" % basename),
-                       function = _radial, units = field_units)
+                       function = _radial, units = field_units,
+                       validators=[ValidateParameter("normal"),
+                                   ValidateParameter("center")])
     registry.add_field((ftype, "radial_%s_absolute" % basename),
                        function = _radial_absolute, units = field_units)
     registry.add_field((ftype, "tangential_%s" % basename),

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