<div dir="ltr">I&#39;m worried about making changes like this to a fundamental toolbox component like normal equations solving.  We use this for processing xfel data, and would like the opportunity to test any changes through a pull request, prior to having them committed to the main branch.<div><br></div><div>Nick Sauter</div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>Nicholas K. Sauter, Ph. D.<br>Senior Scientist, Molecular Biophysics &amp; Integrated Bioimaging Division<div>Lawrence Berkeley National Laboratory<br>1 Cyclotron Rd., Bldg. 33R0345<br>Berkeley, CA 94720<br>(510) 486-5713<br></div></div></div></div></div></div></div></div></div>
<br><div class="gmail_quote">On Wed, Sep 5, 2018 at 5:29 AM, CCTBX commit <span dir="ltr">&lt;<a href="mailto:diamondlightsource.jenkins@gmail.com" target="_blank">diamondlightsource.jenkins@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><tt>Repository : ssh://<a href="http://g18-sc-serv-04.diamond.ac.uk/cctbx" target="_blank">g18-sc-serv-04.diamond.<wbr>ac.uk/cctbx</a><br>On branch  : master<br><br><hr><br><br>commit 9339fd5f7d240f0d6f85dd57ce42e7<wbr>96d19608f1<br>Author: pcxod &lt;<a href="mailto:oleg_dolomanov@hotmail.com" target="_blank">oleg_dolomanov@hotmail.com</a>&gt;<br>Date:   Wed Sep 5 13:29:29 2018 +0100<br><br>    re-defining the shift/est convergence limit in terms of crystallographic rather than independent parameters to make it easier to relate to the convergence reported in the CIF; also caching the shifts for further analysis and reporting;<br><br><br><hr><br><br>9339fd5f7d240f0d6f85dd57ce42e7<wbr>96d19608f1<br> scitbx/lstbx/normal_eqns_<wbr>solving.py | 17 +++++++++++------<br> 1 file changed, 11 insertions(+), 6 deletions(-)<br><br>diff --git a/scitbx/lstbx/normal_eqns_<wbr>solving.py b/scitbx/lstbx/normal_eqns_<wbr>solving.py<br>index 660304eab..45f070622 100644<br><tt style="color:#800">--- a/scitbx/lstbx/normal_eqns_<wbr>solving.py</tt><br><tt style="color:#008">+++ b/scitbx/lstbx/normal_eqns_<wbr>solving.py</tt><br>@@ -140,15 +140,20 @@ class iterations(object):<br>     a = self.non_linear_ls.normal_<wbr>matrix_packed_u()<br>     a.matrix_packed_u_<wbr>diagonal_add_in_place(value*a.<wbr>matrix_packed_u_diagonal())<br> <br><tt style="color:#800">-  def do_scale_shifts(self, max_shift_over_esd):</tt><br><tt style="color:#008">+  def do_scale_shifts(self, limit_shift_over_su):</tt><br>     x = self.non_linear_ls.step()<br>     esd = self.non_linear_ls.covariance_<wbr>matrix().matrix_packed_u_<wbr>diagonal()<br><tt style="color:#800">-    x_over_esd = flex.abs(x/flex.sqrt(esd))</tt><br><tt style="color:#800">-    max_val = flex.max(x_over_esd)</tt><br><tt style="color:#800">-    if max_val &lt; self.convergence_as_shift_<wbr>over_esd:</tt><br><tt style="color:#008">+    ls_shifts_over_su = flex.abs(x/flex.sqrt(esd))</tt><br><tt style="color:#008">+    #max shift for the LS</tt><br><tt style="color:#008">+    self.max_ls_shift_over_su = flex.max(ls_shifts_over_su)</tt><br><tt style="color:#008">+    jac_tr = self.non_linear_ls.actual.\</tt><br><tt style="color:#008">+      reparametrisation.<wbr>jacobian_transpose_matching_<wbr>grad_fc()</tt><br><tt style="color:#008">+    self.shifts_over_su = jac_tr.transpose() * ls_shifts_over_su</tt><br><tt style="color:#008">+    self.max_shift_over_su = flex.max(self.shifts_over_su)</tt><br><tt style="color:#008">+    if self.max_shift_over_su &lt; self.convergence_as_shift_<wbr>over_esd:</tt><br>       return True<br><tt style="color:#800">-    if max_val &gt; max_shift_over_esd:</tt><br><tt style="color:#800">-      shift_scale = max_shift_over_esd/max_val</tt><br><tt style="color:#008">+    if self.max_ls_shift_over_su &gt; limit_shift_over_su:</tt><br><tt style="color:#008">+      shift_scale = limit_shift_over_su/self.max_<wbr>ls_shift_over_su</tt><br>       x *= shift_scale<br>     return False<br> <br></tt></div>
<br>
<hr>
<p align="center">To unsubscribe from the CCTBX-COMMIT list, click the following link:<br>
<a href="https://www.jiscmail.ac.uk/cgi-bin/webadmin?SUBED1=CCTBX-COMMIT&amp;A=1" target="_blank">https://www.jiscmail.ac.uk/<wbr>cgi-bin/webadmin?SUBED1=CCTBX-<wbr>COMMIT&amp;A=1</a>
</p></blockquote></div><br></div>