cctbx / cctbx_project

Computational Crystallography Toolbox
https://cci.lbl.gov/docs/cctbx
Other
218 stars 116 forks source link

Refactor `small_cell_index_detail` #912

Closed dagewa closed 1 year ago

dagewa commented 1 year ago

This PR splits out the lattice determination part of small_cell_index_detail into a new function, small_cell_index_lattice_detail, so that this could be called by dials.index. This is necessary because dials.index loads experiments with check_format=False, so fails on the subsequent parts of the original function where the pixel data are accessed.

During the refactor, a certain amount of tidying-up was also done, such as reducing nested indents.

This PR has been tested to give the same results as main on this test case:

cd $(dials.data get -q 4fluoro_cxi)/lcls_2022_smSFX_workshop_data/indexing/
cctbx.xfel.small_cell_process params_1.phil ../ten_cbfs/*.cbf

Before a small_cell indexer is added to DIALS, @phyy-nx noted that it may be worth moving this code to serialtbx, to avoid adding a new DIALS --> cctbx.xfel dependency.

phyy-nx commented 1 year ago

Hi @dagewa, XFEL CI runs this test:

libtbx.python ../../modules/xfel_regression/test/command_line/tst_small_cell_process.py

Which passes on master and on this branch. I'm trying to figure out a better diff program that will help me review the changes easier. I think the white space changes are making the diff hard to follow.