<div dir="ltr">OK, I&#39;ve had a chance to run the tests and everything seems to check out.  For XFEL we use the &quot;levenberg_marquardt_iterations_encapsulated_eqns&quot; that seems to be not affected by your code commit.<div>Nick</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 8:42 AM, <a href="mailto:oleg@olexsys.org">oleg@olexsys.org</a> <span dir="ltr">&lt;<a href="mailto:oleg@olexsys.org" target="_blank">oleg@olexsys.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<div dir="ltr">
<div id="m_-5549362731142818077divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif" dir="ltr">
<p style="margin-top:0;margin-bottom:0">Sorry Nick,</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">please let me know - I can pull it back or tweak as needed...</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">Cheers,</p>
<p style="margin-top:0;margin-bottom:0">Oleg.</p>
</div>
<hr style="display:inline-block;width:98%">
<div id="m_-5549362731142818077divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> <a href="mailto:cctbxbb-bounces@phenix-online.org" target="_blank">cctbxbb-bounces@phenix-online.<wbr>org</a> &lt;<a href="mailto:cctbxbb-bounces@phenix-online.org" target="_blank">cctbxbb-bounces@phenix-<wbr>online.org</a>&gt; on behalf of Nicholas Sauter &lt;<a href="mailto:nksauter@lbl.gov" target="_blank">nksauter@lbl.gov</a>&gt;<br>
<b>Sent:</b> 05 September 2018 16:37:53<br>
<b>To:</b> cctbx mailing list<br>
<b>Cc:</b> <a href="mailto:CCTBX-COMMIT@jiscmail.ac.uk" target="_blank">CCTBX-COMMIT@jiscmail.ac.uk</a><br>
<b>Subject:</b> Re: [cctbxbb] [git/cctbx] master: 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
 analys...</font>
<div> </div>
</div>

<div>
<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="m_-5549362731142818077x_gmail_extra"><br clear="all">
<div>
<div class="m_-5549362731142818077x_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="m_-5549362731142818077x_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@<wbr>gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="m_-5549362731142818077x_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.a<wbr>c.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_solvi<wbr>ng.py | 17 +++++++++++------<br>
1 file changed, 11 insertions(+), 6 deletions(-)<br>
<br>
diff --git a/scitbx/lstbx/normal_eqns_sol<wbr>ving.py b/scitbx/lstbx/normal_eqns_sol<wbr>ving.py<br>
index 660304eab..45f070622 100644<br>
<tt style="color:#800">--- a/scitbx/lstbx/normal_eqns_sol<wbr>ving.py</tt><br>
<tt style="color:#008">+++ b/scitbx/lstbx/normal_eqns_sol<wbr>ving.py</tt><br>
@@ -140,15 +140,20 @@ class iterations(object):<br>
     a = self.non_linear_ls.normal_matr<wbr>ix_packed_u()<br>
     a.matrix_packed_u_diagona<wbr>l_add_in_place(value*a.matrix_<wbr>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_diago<wbr>nal()<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_over<wbr>_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.jacob<wbr>ian_transpose_matching_grad_<wbr>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_over<wbr>_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_l<wbr>s_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/cgi<wbr>-bin/webadmin?SUBED1=CCTBX-COM<wbr>MIT&amp;A=1</a>
</p>
</blockquote>
</div>
<br>
</div>
</div>
</div>

<br>______________________________<wbr>_________________<br>
cctbxbb mailing list<br>
<a href="mailto:cctbxbb@phenix-online.org">cctbxbb@phenix-online.org</a><br>
<a href="http://phenix-online.org/mailman/listinfo/cctbxbb" rel="noreferrer" target="_blank">http://phenix-online.org/<wbr>mailman/listinfo/cctbxbb</a><br>
<br></blockquote></div><br></div>