[yt-svn] commit/yt-3.0: 3 new changesets

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Fri Oct 25 07:59:22 PDT 2013


3 new commits in yt-3.0:

https://bitbucket.org/yt_analysis/yt-3.0/commits/d6fb32282181/
Changeset:   d6fb32282181
Branch:      yt-3.0
User:        ngoldbaum
Date:        2013-10-25 00:47:01
Summary:     Fixing the handling of the normal keyword in the new SlicePlot factory function.
Affected #:  1 file

diff -r 788e19ee51e682974a4d576f0e0912611c92d454 -r d6fb3228218105fccef16f36c4c8b7f9d8c9748d yt/visualization/plot_window.py
--- a/yt/visualization/plot_window.py
+++ b/yt/visualization/plot_window.py
@@ -2123,7 +2123,10 @@
     if iterable(normal) and not isinstance(normal,str):
         normal = np.array(normal)
         np.divide(normal, np.dot(normal,normal), normal)
-    if np.count_nonzero(normal) == 1:
+    elif isinstance(normal, str):
+        assert normal in ('x', 'y', 'z'), \
+            "The normal axis must be 'x', 'y', or 'z'"
+    elif np.count_nonzero(normal) == 1:
         normal = ("x","y","z")[np.nonzero(normal)[0][0]]
 
     # by now the normal should be properly set to get either a On/Off Axis plot


https://bitbucket.org/yt_analysis/yt-3.0/commits/efc7c71f4b7b/
Changeset:   efc7c71f4b7b
Branch:      yt-3.0
User:        ngoldbaum
Date:        2013-10-25 03:40:26
Summary:     Fixing the logic a bit.
Affected #:  1 file

diff -r d6fb3228218105fccef16f36c4c8b7f9d8c9748d -r efc7c71f4b7b656280a82234ecf43e7e800476a5 yt/visualization/plot_window.py
--- a/yt/visualization/plot_window.py
+++ b/yt/visualization/plot_window.py
@@ -2121,14 +2121,12 @@
     # use an AxisAlignedSlicePlot where possible, e.g.:
     # maybe someone passed normal=[0,0,0.2] when they should have just used "z"
     if iterable(normal) and not isinstance(normal,str):
-        normal = np.array(normal)
-        np.divide(normal, np.dot(normal,normal), normal)
-    elif isinstance(normal, str):
-        assert normal in ('x', 'y', 'z'), \
-            "The normal axis must be 'x', 'y', or 'z'"
-    elif np.count_nonzero(normal) == 1:
-        normal = ("x","y","z")[np.nonzero(normal)[0][0]]
-
+        if np.count_nonzero(normal) == 1:
+            normal = ("x","y","z")[np.nonzero(normal)[0][0]]
+        else:
+            normal = np.array(normal)
+            np.divide(normal, np.dot(normal,normal), normal)
+        
     # by now the normal should be properly set to get either a On/Off Axis plot
     if iterable(normal) and not isinstance(normal,str):
         # OffAxisSlicePlot has hardcoded origin; remove it if in kwargs


https://bitbucket.org/yt_analysis/yt-3.0/commits/69034824f51e/
Changeset:   69034824f51e
Branch:      yt-3.0
User:        MatthewTurk
Date:        2013-10-25 16:59:17
Summary:     Merged in ngoldbaum/yt-3.0 (pull request #125)

Fixing the handling of the normal keyword in the new SlicePlot factory function.
Affected #:  1 file

diff -r 9cd06e4233044a84bc4f8c880a4e45417816f316 -r 69034824f51e8ff3ac076e0ee3ded333c534d4ad yt/visualization/plot_window.py
--- a/yt/visualization/plot_window.py
+++ b/yt/visualization/plot_window.py
@@ -2121,11 +2121,12 @@
     # use an AxisAlignedSlicePlot where possible, e.g.:
     # maybe someone passed normal=[0,0,0.2] when they should have just used "z"
     if iterable(normal) and not isinstance(normal,str):
-        normal = np.array(normal)
-        np.divide(normal, np.dot(normal,normal), normal)
-    if np.count_nonzero(normal) == 1:
-        normal = ("x","y","z")[np.nonzero(normal)[0][0]]
-
+        if np.count_nonzero(normal) == 1:
+            normal = ("x","y","z")[np.nonzero(normal)[0][0]]
+        else:
+            normal = np.array(normal)
+            np.divide(normal, np.dot(normal,normal), normal)
+        
     # by now the normal should be properly set to get either a On/Off Axis plot
     if iterable(normal) and not isinstance(normal,str):
         # OffAxisSlicePlot has hardcoded origin; remove it if in kwargs

Repository URL: https://bitbucket.org/yt_analysis/yt-3.0/

--

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