<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" 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&nbsp;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%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> cctbxbb-bounces@phenix-online.org &lt;cctbxbb-bounces@phenix-online.org&gt; on behalf of Nicholas Sauter &lt;nksauter@lbl.gov&gt;<br>
<b>Sent:</b> 05 September 2018 16:37:53<br>
<b>To:</b> cctbx mailing list<br>
<b>Cc:</b> CCTBX-COMMIT@jiscmail.ac.uk<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>&nbsp;</div>
</div>
<meta content="text/html; charset=utf-8">
<div>
<div dir="ltr">I'm worried about making changes like this to a fundamental toolbox component like normal equations solving.&nbsp; 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="x_gmail_extra"><br clear="all">
<div>
<div class="x_gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>Nicholas K. Sauter, Ph. D.<br>
Senior Scientist,&nbsp;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="x_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="x_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&nbsp;&nbsp;: 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:&nbsp;&nbsp;&nbsp;Wed Sep 5 13:29:29 2018 &#43;0100<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;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 &#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;------<br>
1 file changed, 11 insertions(&#43;), 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">&#43;&#43;&#43; b/scitbx/lstbx/normal_eqns_<wbr>solving.py</tt><br>
@@ -140,15 &#43;140,20 @@ class iterations(object):<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a = self.non_linear_ls.normal_<wbr>matrix_packed_u()<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a.matrix_packed_u_<wbr>diagonal_add_in_place(value*a.<wbr>matrix_packed_u_diagonal())<br>
<br>
<tt style="color:#800">-&nbsp;&nbsp;def do_scale_shifts(self, max_shift_over_esd):</tt><br>
<tt style="color:#008">&#43;&nbsp;&nbsp;def do_scale_shifts(self, limit_shift_over_su):</tt><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x = self.non_linear_ls.step()<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;esd = self.non_linear_ls.covariance_<wbr>matrix().matrix_packed_u_<wbr>diagonal()<br>
<tt style="color:#800">-&nbsp;&nbsp;&nbsp;&nbsp;x_over_esd = flex.abs(x/flex.sqrt(esd))</tt><br>
<tt style="color:#800">-&nbsp;&nbsp;&nbsp;&nbsp;max_val = flex.max(x_over_esd)</tt><br>
<tt style="color:#800">-&nbsp;&nbsp;&nbsp;&nbsp;if max_val &lt; self.convergence_as_shift_<wbr>over_esd:</tt><br>
<tt style="color:#008">&#43;&nbsp;&nbsp;&nbsp;&nbsp;ls_shifts_over_su = flex.abs(x/flex.sqrt(esd))</tt><br>
<tt style="color:#008">&#43;&nbsp;&nbsp;&nbsp;&nbsp;#max shift for the LS</tt><br>
<tt style="color:#008">&#43;&nbsp;&nbsp;&nbsp;&nbsp;self.max_ls_shift_over_su = flex.max(ls_shifts_over_su)</tt><br>
<tt style="color:#008">&#43;&nbsp;&nbsp;&nbsp;&nbsp;jac_tr = self.non_linear_ls.actual.\</tt><br>
<tt style="color:#008">&#43;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reparametrisation.<wbr>jacobian_transpose_matching_<wbr>grad_fc()</tt><br>
<tt style="color:#008">&#43;&nbsp;&nbsp;&nbsp;&nbsp;self.shifts_over_su = jac_tr.transpose() * ls_shifts_over_su</tt><br>
<tt style="color:#008">&#43;&nbsp;&nbsp;&nbsp;&nbsp;self.max_shift_over_su = flex.max(self.shifts_over_su)</tt><br>
<tt style="color:#008">&#43;&nbsp;&nbsp;&nbsp;&nbsp;if self.max_shift_over_su &lt; self.convergence_as_shift_<wbr>over_esd:</tt><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return True<br>
<tt style="color:#800">-&nbsp;&nbsp;&nbsp;&nbsp;if max_val &gt; max_shift_over_esd:</tt><br>
<tt style="color:#800">-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;shift_scale = max_shift_over_esd/max_val</tt><br>
<tt style="color:#008">&#43;&nbsp;&nbsp;&nbsp;&nbsp;if self.max_ls_shift_over_su &gt; limit_shift_over_su:</tt><br>
<tt style="color:#008">&#43;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;shift_scale = limit_shift_over_su/self.max_<wbr>ls_shift_over_su</tt><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x *= shift_scale<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>
</div>
</body>
</html>