Skip to content

Commit

Permalink
News and tidying
Browse files Browse the repository at this point in the history
  • Loading branch information
jbeilstenedmands committed Jan 10, 2024
1 parent 8c75bec commit 0dba3aa
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 25 deletions.
1 change: 1 addition & 0 deletions newsfragments/XXX.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
``dials.cosym``: Filter out datasets that can't be mapped through a consistent best cell, rather than exiting.
3 changes: 2 additions & 1 deletion src/dials/command_line/cosym.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,11 @@ def __init__(self, experiments, reflections, params=None):
if not cb_op
]
if len(exclude):
exclude_indices = [i for i, cb_op in enumerate(cb_ops) if not cb_op]
logger.info(
f"Rejecting {len(exclude)} datasets from cosym analysis "
f"(couldn't determine consistent cb_op to minimum cell):\n"
f"{exclude}",
f"dataset indices: {exclude_indices}",
)
self._experiments, self._reflections = select_datasets_on_identifiers(
self._experiments, self._reflections, exclude_datasets=exclude
Expand Down
23 changes: 0 additions & 23 deletions src/dials/command_line/symmetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ def change_of_basis_ops_to_minimum_cell(
)
target_group = counter.most_common()[0][0]
cb_ops = []
# best_cell = None
best_cells = []
for expt in experiments:
groups = metric_subgroups(
Expand All @@ -222,28 +221,6 @@ def change_of_basis_ops_to_minimum_cell(
if group:
cb_ops.append(group["cb_op_inp_best"])
best_cells.append(group["best_subsym"].unit_cell())
"""if not best_cell:
best_cell = group["best_subsym"].unit_cell()
else:
this_best_cell = group["best_subsym"].unit_cell()
if not best_cell.is_similar_to(
this_best_cell,
relative_length_tolerance,
absolute_angle_tolerance,
):
best_params = ", ".join(
f"{i:.2f}" for i in best_cell.parameters()
)
this_params = ", ".join(
f"{i:.2f}" for i in this_best_cell.parameters()
)
raise ValueError(
"Exiting symmetry analysis: Unable to map input cells to a minimum cell through\n"
+ f"a consistent best cell in space group {target_group.info()}.\n"
+ f"Incompatible best cells:\n {best_params},\n {this_params},\n"
+ f" within a relative_length_tolerance of {relative_length_tolerance}\n"
+ f" and an absolute_angle_tolerance of {absolute_angle_tolerance}"
)"""
else:
cb_ops.append(None)
logger.info(
Expand Down
2 changes: 1 addition & 1 deletion tests/command_line/test_cosym.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def test_cosym_with_reference(dials_data, run_in_tmp_path):


def test_synthetic_map_cell_issue(run_in_tmp_path):
# Test that the program cleanly exits if a set of unit cells cannot be mapped to a consistent
# Test that the program filters out datasets that cannot be mapped to a consistent
# minimum cell in the change_of_basis_ops_to_minimum_cell function.
unit_cell = uctbx.unit_cell((5.46, 9.82, 29.58, 95.24, 94.54, 105.21))
space_group = sgtbx.space_group_info("P1").group()
Expand Down

0 comments on commit 0dba3aa

Please sign in to comment.