[cctbxbb] tst_miller failing

markus.gerstel at diamond.ac.uk markus.gerstel at diamond.ac.uk
Tue Aug 11 01:30:37 PDT 2015


Hi everyone, particularly Pavel I guess,

I had a look at one intermittently failing test: cctbx/regression/tst_miller.py, run with parameter P31

The relevant piece of code is:
 def exercise_randomize_amplitude_and_phase():
   xrs = random_structure.xray_structure(
     space_group_info=sgtbx.space_group_info(number=1),
     elements=["C"]*300)
   fc = xrs.structure_factors(d_min=1).f_calc()
   def run(a,p):
     fc_ = fc.randomize_amplitude_and_phase(amplitude_error=a,
       phase_error_deg=p, random_seed=1312425)
     d1, d2 = flex.abs(fc.data()), flex.abs(fc_.data())
     r = flex.sum(flex.abs(d1-d2))/flex.sum(flex.abs(d1+d2))*2
     return (r, fc.mean_phase_error(phase_source=fc_))
   #
   assert approx_equal(run(0,0), (0,0))
   for v in list(xrange(0,91, 10)):
     r = run(v/100.,v)
     assert approx_equal(r[0], v/100., 0.01)
     assert approx_equal(r[1], v, 1)

The test fails in the last line for varying values of v. I saw that the values of r[] increase proportionally to v, so I ran the test 2000 times for v=90, plotting the values of r[0] and r[1]; results attached.
With the current statistics the r[1] test is expected to fail in 1 run out of every 80.

Could you please have a look at this, and either increase the tolerance on the test or identify whether these values are true unexpected outliers indicating a problem in the code? Don't know what the r[1] distribution should look like, but that's clearly not normal.

:)

-Markus

-- 
This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail.
Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd. 
Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message.
Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom

-------------- next part --------------
A non-text attachment was scrubbed...
Name: miller-r0.png
Type: image/png
Size: 35333 bytes
Desc: miller-r0.png
URL: <http://phenix-online.org/pipermail/cctbxbb/attachments/20150811/d4f2dcc0/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: miller-r1.png
Type: image/png
Size: 32094 bytes
Desc: miller-r1.png
URL: <http://phenix-online.org/pipermail/cctbxbb/attachments/20150811/d4f2dcc0/attachment-0003.png>


More information about the cctbxbb mailing list