<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Folks,<div class=""><br class=""></div><div class="">I expressed some surprise at this &amp; friends however -&nbsp;</div><div class=""><br class=""></div><div class="">&nbsp;- this is necessary to make the bootstrap process Python 3 compatible - the timetable for which said this should have been finished 9 months ago (<a href="https://github.com/cctbx/cctbx_project/wiki/Python-3-roadmap" class="">https://github.com/cctbx/cctbx_project/wiki/Python-3-roadmap</a>)&nbsp;</div><div class="">&nbsp;- these changes were discussed and agreed (<a href="https://github.com/cctbx/cctbx_project/pull/199" class="">https://github.com/cctbx/cctbx_project/pull/199</a>)&nbsp;</div><div class=""><br class=""></div><div class="">The only part of this which was not approved was reverted before the request was merged</div><div class=""><br class=""></div><div class="">(I felt that this annotation was helpful as the changes themselves go back&nbsp;~6 months so people have possibly forgotten the context)</div><div class=""><br class=""></div><div class="">Best wishes Graeme</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On 21 Sep 2018, at 14:25, CCTBX commit &lt;<a href="mailto:diamondlightsource.jenkins@GMAIL.COM" class="">diamondlightsource.jenkins@GMAIL.COM</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div class=""><tt class="">Repository : <a href="ssh://ws133.diamond.ac.uk/cctbx" class="">ssh://ws133.diamond.ac.uk/cctbx</a><br class="">On branch&nbsp;&nbsp;: master<br class=""><br class=""><hr class=""><br class=""><br class="">commit 790d9e315a2a6ae5a875ba86b461ed570c77280d<br class="">Author: Markus Gerstel &lt;<a href="mailto:markus.gerstel@diamond.ac.uk" class="">markus.gerstel@diamond.ac.uk</a>&gt;<br class="">Date:&nbsp;&nbsp;&nbsp;Thu May 24 12:16:38 2018 +0100<br class=""><br class="">&nbsp;&nbsp;&nbsp;&nbsp;Python 3 syntax changes<br class="">&nbsp;&nbsp;&nbsp;&nbsp;<br class="">&nbsp;&nbsp;&nbsp;&nbsp;Replace the reduce(add, ...) function by sum().<br class="">&nbsp;&nbsp;&nbsp;&nbsp;reduce() is no longer in the global namespace in python 3.<br class=""><br class=""><br class=""><hr class=""><br class=""><br class="">790d9e315a2a6ae5a875ba86b461ed570c77280d<br class=""> scitbx/math/__init__.py | 34 ++++++++++++++++------------------<br class=""> 1 file changed, 16 insertions(+), 18 deletions(-)<br class=""><br class="">diff --git a/scitbx/math/__init__.py b/scitbx/math/__init__.py<br class="">index a13405f92..49e295eb0 100644<br class=""><tt style="color:#800" class="">--- a/scitbx/math/__init__.py</tt><br class=""><tt style="color:#008" class="">+++ b/scitbx/math/__init__.py</tt><br class="">@@ -1,11 +1,13 @@<br class=""><tt style="color:#800" class="">-from __future__ import division, absolute_import</tt><br class=""><tt style="color:#008" class="">+from __future__ import absolute_import, division, print_function</tt><br class=""><tt style="color:#008" class="">+</tt><br class=""><tt style="color:#008" class="">+import math</tt><br class=""><tt style="color:#008" class="">+</tt><br class=""> from scitbx.math.ext import *<br class=""> import scitbx.linalg.eigensystem<br class=""> import scitbx.math.gaussian # implicit import<br class=""> from scitbx import matrix<br class=""> from scitbx.array_family import flex<br class=""> from boost import rational # implicit import<br class=""><tt style="color:#800" class="">-import math</tt><br class=""> <br class=""> gaussian_fit_1d_analytical.__doc__ = """<br class=""> Fits a gaussian function to a list of points.<br class="">@@ -88,16 +90,14 @@ def r3_rotation_average_rotation_matrix_from_matrices(*matrices):<br class="">&nbsp;&nbsp;&nbsp;"""<br class=""> <br class="">&nbsp;&nbsp;&nbsp;if not matrices:<br class=""><tt style="color:#800" class="">-&nbsp;&nbsp;&nbsp;&nbsp;raise TypeError, "Average of empty sequence"</tt><br class=""><tt style="color:#008" class="">+&nbsp;&nbsp;&nbsp;&nbsp;raise TypeError("Average of empty sequence")</tt><br class=""> <br class=""><tt style="color:#800" class="">-&nbsp;&nbsp;import operator</tt><br class="">&nbsp;&nbsp;&nbsp;import scitbx.matrix<br class=""> <br class=""><tt style="color:#800" class="">-&nbsp;&nbsp;average = reduce(</tt><br class=""><tt style="color:#800" class="">-&nbsp;&nbsp;&nbsp;&nbsp;operator.add,</tt><br class=""><tt style="color:#800" class="">-&nbsp;&nbsp;&nbsp;&nbsp;[ scitbx.matrix.col( r3_rotation_matrix_as_unit_quaternion( e ) )</tt><br class=""><tt style="color:#800" class="">-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for e in matrices ]</tt><br class=""><tt style="color:#800" class="">-&nbsp;&nbsp;&nbsp;&nbsp;)</tt><br class=""><tt style="color:#008" class="">+&nbsp;&nbsp;average = sum(</tt><br class=""><tt style="color:#008" class="">+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;scitbx.matrix.col( r3_rotation_matrix_as_unit_quaternion( e ) )</tt><br class=""><tt style="color:#008" class="">+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for e in matrices</tt><br class=""><tt style="color:#008" class="">+&nbsp;&nbsp;)</tt><br class=""> <br class="">&nbsp;&nbsp;&nbsp;return r3_rotation_unit_quaternion_as_matrix( average.normalize() )<br class=""> <br class="">@@ -111,13 +111,12 @@ def r3_rotation_average_rotation_via_lie_algebra(matrices, maxiter = 100, conver<br class="">&nbsp;&nbsp;&nbsp;"""<br class=""> <br class="">&nbsp;&nbsp;&nbsp;if not matrices:<br class=""><tt style="color:#800" class="">-&nbsp;&nbsp;&nbsp;&nbsp;raise TypeError, "Average of empty sequence"</tt><br class=""><tt style="color:#008" class="">+&nbsp;&nbsp;&nbsp;&nbsp;raise TypeError("Average of empty sequence")</tt><br class=""> <br class="">&nbsp;&nbsp;&nbsp;if maxiter &lt; 0 or convergence &lt;= 0:<br class=""><tt style="color:#800" class="">-&nbsp;&nbsp;&nbsp;&nbsp;raise ValueError, "Invalid iteration parameters"</tt><br class=""><tt style="color:#008" class="">+&nbsp;&nbsp;&nbsp;&nbsp;raise ValueError("Invalid iteration parameters")</tt><br class=""> <br class="">&nbsp;&nbsp;&nbsp;from scitbx.math import so3_lie_algebra<br class=""><tt style="color:#800" class="">-&nbsp;&nbsp;import operator</tt><br class=""> <br class="">&nbsp;&nbsp;&nbsp;conv_sq = convergence * convergence<br class="">&nbsp;&nbsp;&nbsp;norm = 1.0 / len( matrices )<br class="">@@ -125,10 +124,9 @@ def r3_rotation_average_rotation_via_lie_algebra(matrices, maxiter = 100, conver<br class=""> <br class="">&nbsp;&nbsp;&nbsp;for i in range( maxiter ):<br class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;inverse = current.inverse()<br class=""><tt style="color:#800" class="">-&nbsp;&nbsp;&nbsp;&nbsp;log_diff = norm * reduce(</tt><br class=""><tt style="color:#800" class="">-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;operator.add,</tt><br class=""><tt style="color:#800" class="">-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[ so3_lie_algebra.element.from_rotation_matrix( matrix = inverse * m )</tt><br class=""><tt style="color:#800" class="">-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for m in matrices ]</tt><br class=""><tt style="color:#008" class="">+&nbsp;&nbsp;&nbsp;&nbsp;log_diff = norm * sum(</tt><br class=""><tt style="color:#008" class="">+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;so3_lie_algebra.element.from_rotation_matrix( matrix = inverse * m )</tt><br class=""><tt style="color:#008" class="">+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for m in matrices</tt><br class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;)<br class=""> <br class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if log_diff.norm_sq() &lt; conv_sq:<br class="">@@ -136,7 +134,7 @@ def r3_rotation_average_rotation_via_lie_algebra(matrices, maxiter = 100, conver<br class=""> <br class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;current *= log_diff.exponential()<br class=""> <br class=""><tt style="color:#800" class="">-&nbsp;&nbsp;raise RuntimeError, "Iteration limit exceeded"</tt><br class=""><tt style="color:#008" class="">+&nbsp;&nbsp;raise RuntimeError("Iteration limit exceeded")</tt><br class=""> <br class=""> def euler_angles_as_matrix(angles, deg=False):<br class="">&nbsp;&nbsp;&nbsp;if (deg):<br class="">@@ -174,7 +172,7 @@ class erf_verification(object):<br class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (self.max_delta &lt; delta):<br class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.max_delta = delta<br class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (delta &gt; self.tolerance):<br class=""><tt style="color:#800" class="">-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print x, expected_result, result, delta</tt><br class=""><tt style="color:#008" class="">+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print(x, expected_result, result, delta)</tt><br class=""> <br class=""> class minimum_covering_sphere_nd(object):<br class=""> <br class=""></tt></div>
<br class="">
<hr class=""><p align="center" class="">To unsubscribe from the CCTBX-COMMIT list, click the following link:<br class="">
<a href="https://www.jiscmail.ac.uk/cgi-bin/webadmin?SUBED1=CCTBX-COMMIT&amp;A=1" target="_blank" class="">https://www.jiscmail.ac.uk/cgi-bin/webadmin?SUBED1=CCTBX-COMMIT&amp;A=1</a>
</p></div></blockquote></div><br class=""></div></body></html>