Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dials.index: Handle possibility of krivy-gruber iteration limit exceeded exception #2332

Merged
merged 4 commits into from
Feb 3, 2023

Conversation

jbeilstenedmands
Copy link
Contributor

This is a rare but possible exception that can be raised by cctbx when performing niggli cell reduction, possibly only for higher symmetry cases, but is the second time I have seen this or had this reported

At the moment, it is uncaught and results in a stack trace e.g.:

  File "/dls_sw/apps/dials/dials-v3-12-1-2/modules/xia2/src/xia2/cli/ssx.py", line 69, in run
    run_xia2_ssx(cwd, params)
  File "/dls_sw/apps/dials/dials-v3-12-1-2/modules/xia2/src/xia2/Modules/SSX/util.py", line 21, in wrap_fn
    result = fn(*args, **kwargs)
  File "/dls_sw/apps/dials/dials-v3-12-1-2/modules/xia2/src/xia2/Modules/SSX/xia2_ssx.py", line 270, in run_xia2_ssx
    integrated_batch_directories = run_data_integration(
  File "/dls_sw/apps/dials/dials-v3-12-1-2/modules/xia2/src/xia2/Modules/SSX/data_integration_standard.py", line 756, in run_data_integration
    cumulative_determine_reference_geometry(
  File "/dls_sw/apps/dials/dials-v3-12-1-2/modules/xia2/src/xia2/Modules/SSX/data_integration_standard.py", line 513, in cumulative_determine_reference_geometry
    expts, refl, summary_this = ssx_index(working_directory, indexing_params)
  File "/dls_sw/apps/dials/dials-v3-12-1-2/modules/xia2/src/xia2/Modules/SSX/data_integration_programs.py", line 295, in ssx_index
    indexed_experiments, indexed_reflections, summary_data = index(
  File "/dls_sw/apps/dials/dials-v3-12-1-2/modules/dials/src/dials/algorithms/indexing/ssx/processing.py", line 442, in index
    indexed_experiments, indexed_reflections, results_summary = index_all_concurrent(
  File "/dls_sw/apps/dials/dials-v3-12-1-2/modules/dials/src/dials/algorithms/indexing/ssx/processing.py", line 262, in index_all_concurrent
    results: List[IndexingResult] = pool.map(
  File "/dls_sw/apps/dials/dials-v3-12-1-2/conda_base/lib/python3.9/multiprocessing/pool.py", line 364, in map
    return self._map_async(func, iterable, mapstar, chunksize).get()
  File "/dls_sw/apps/dials/dials-v3-12-1-2/conda_base/lib/python3.9/multiprocessing/pool.py", line 771, in get
    raise self._value
cctbx.uctbx.reduction_base.iteration_limit_exceeded: Krivy-Gruber iteration limit exceeded (limit=1000).

This PR catches the exception and raises it as a DialsIndexError (as are other exceptions encountered in indexing), which is caught in the dials.index command line program.

@jbeilstenedmands jbeilstenedmands enabled auto-merge (squash) February 3, 2023 13:29
@codecov
Copy link

codecov bot commented Feb 3, 2023

Codecov Report

Merging #2332 (6a79357) into main (094ce52) will decrease coverage by 0.04%.
The diff coverage is 66.66%.

@@            Coverage Diff             @@
##             main    #2332      +/-   ##
==========================================
- Coverage   80.57%   80.53%   -0.04%     
==========================================
  Files         587      587              
  Lines       67276    67286      +10     
  Branches     8995     8995              
==========================================
- Hits        54205    54187      -18     
- Misses      10992    11020      +28     
  Partials     2079     2079              

@jbeilstenedmands jbeilstenedmands merged commit fd41200 into main Feb 3, 2023
@jbeilstenedmands jbeilstenedmands deleted the catch_krivy_gruber_iteration_exceeded branch February 3, 2023 14:49
dagewa pushed a commit that referenced this pull request Feb 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants