Skip to content

Commit

Permalink
Fix log output line in dials.symmetry. (dials#2523)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbeilstenedmands authored Oct 18, 2023
1 parent ca52cf0 commit af67cf6
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
1 change: 1 addition & 0 deletions newsfragments/2523.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
``dials.symmetry``: Print reindexed unit cell in log output
12 changes: 6 additions & 6 deletions src/dials/algorithms/symmetry/cosym/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,7 @@ def subgroups_table(d):
@staticmethod
def summary_table(d):
best_subgroup = d["subgroup_scores"][0]
cell = ", ".join(f"{i:.3f}" for i in best_subgroup["unit_cell"])
return (
(
"Best solution",
Expand All @@ -604,10 +605,7 @@ def summary_table(d):
).info()
),
),
(
"Unit cell",
"%.3f %.3f %.3f %.1f %.1f %.1f" % tuple(best_subgroup["unit_cell"]),
),
("Unit cell", cell),
("Reindex operator", best_subgroup["cb_op"]),
("Laue group probability", f"{best_subgroup['likelihood']:.3f}"),
("Laue group confidence", f"{best_subgroup['confidence']:.3f}"),
Expand All @@ -631,9 +629,11 @@ def __str__(self):
"Best solution: %s"
% self.best_solution.subgroup["best_subsym"].space_group_info()
)
output.append(
f"Unit cell: {str(self.best_solution.subgroup['best_subsym'].unit_cell())}"
cell = ", ".join(
f"{i:.3f}"
for i in self.best_solution.subgroup["best_subsym"].unit_cell().parameters()
)
output.append(f"Unit cell: {cell}")
output.append(
"Reindex operator: %s"
% (self.best_solution.subgroup["cb_op_inp_best"] * self.cb_op_inp_min)
Expand Down
6 changes: 4 additions & 2 deletions src/dials/algorithms/symmetry/laue_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,9 +354,11 @@ def __str__(self):
"\nBest solution: %s"
% self.best_solution.subgroup["best_subsym"].space_group_info()
)
output.append(
f"Unit cell: {self.best_solution.subgroup['best_subsym'].unit_cell()}"
cell = ", ".join(
f"{i:.3f}"
for i in self.best_solution.subgroup["best_subsym"].unit_cell().parameters()
)
output.append(f"Unit cell: {cell}")
output.append(
f"Reindex operator: {self.best_solution.subgroup['cb_op_inp_best']}"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def test_symmetry_analysis():
| C 1 2/m 1 | | 0 | -5.24 | 1.96 | 7.21 | 0 | -a-c,-a+c,b |
+-------------------+-----+--------------+----------+--------+--------+---------+--------------------+
Best solution: R -3 :H
Unit cell: (98.33, 98.33, 135.99, 90, 90, 120)
Unit cell: 98.330, 98.330, 135.990, 90.000, 90.000, 120.000
Reindex operator: b-c,-a+c,a+b+c
Laue group probability: 0.995
Laue group confidence: 0.994"""
Expand Down

0 comments on commit af67cf6

Please sign in to comment.