mailr26251 - in /trunk: lib/software/opendx/files.py pipe_control/opendx.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by tlinnet on October 13, 2014 - 11:48:
Author: tlinnet
Date: Mon Oct 13 11:48:03 2014
New Revision: 26251

URL: http://svn.gna.org/viewcvs/relax?rev=26251&view=rev
Log:
Modified that structure of points in dx.map() is always a list of numpy 
arrays with 3 values.

Modified:
    trunk/lib/software/opendx/files.py
    trunk/pipe_control/opendx.py

Modified: trunk/lib/software/opendx/files.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/lib/software/opendx/files.py?rev=26251&r1=26250&r2=26251&view=diff
==============================================================================
--- trunk/lib/software/opendx/files.py  (original)
+++ trunk/lib/software/opendx/files.py  Mon Oct 13 11:48:03 2014
@@ -151,16 +151,8 @@
     point_file_general = open_write_file(file_name=file_prefix+".general", 
dir=dir, force=True)
 
     # Calculate the coordinate values.
-    if num_points > 1:
-        for i in range(num_points):
-            i_point = point[i]
-
-            coords = inc * (i_point - bounds[:, 0]) / (bounds[:, 1] - 
bounds[:, 0])
-            for i in range(N):
-                point_file.write("%-15.5g" % coords[i])
-            point_file.write("1\n")
-    else:
-        i_point = point
+    for i in range(num_points):
+        i_point = point[i]
 
         coords = inc * (i_point - bounds[:, 0]) / (bounds[:, 1] - bounds[:, 
0])
         for i in range(N):

Modified: trunk/pipe_control/opendx.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/pipe_control/opendx.py?rev=26251&r1=26250&r2=26251&view=diff
==============================================================================
--- trunk/pipe_control/opendx.py        (original)
+++ trunk/pipe_control/opendx.py        Mon Oct 13 11:48:03 2014
@@ -119,11 +119,12 @@
         # Points.
         if point != None:
             # Check if list is a nested list of lists.
+            point_list = []
             if isinstance(point[0], float):
-                self.point = array(point, float64)
+                point_list.append(array(point, float64))
+                self.point = point_list
                 self.num_points = 1
             else:
-                point_list = []
                 for i in range(len(point)):
                     point_list.append(array(point[i], float64))
                 self.point = point_list




Related Messages


Powered by MHonArc, Updated Mon Oct 13 12:00:03 2014