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

Bare print statement in xfel/clustering/cluster_groups.py #742

Open
jbeilstenedmands opened this issue Mar 2, 2022 · 1 comment
Open

Comments

@jbeilstenedmands
Copy link
Contributor

jbeilstenedmands commented Mar 2, 2022

In the unit_cell_info function in cluster_groups.py, text output is collated into an output string, except in one instance, where print is called:

print(" Unit cell:", group['best_subsym'].unit_cell())

This becomes an issue when trying to control text output, as one can not selectively suppress this output.
As this is printing information that is also added to the output string, it could be the case that this is just leftover redundancy after a few code updates.
I would like to either a) remove the print statement entirely, or b) add this information to the start of the output string.
I wondered if @phyy-nx has any thoughts? My preference would be for a). I'm happy to do the work for this.

Currently, if you then immediately print the output string, as is typically the case in the code, this gives the following kind of output:

                       Unit cell: (96.7358, 96.7358, 96.7358, 90, 90, 90)
                       Unit cell: (136.846, 136.846, 96.6817, 90, 90, 90)
                       Unit cell: (96.7108, 96.7108, 193.541, 90, 90, 90)

0 singletons:

Point group    a           b           c          alpha        beta         gamma       

3 clusters:

Cluster_id       N_xtals  Med_a         Med_b         Med_c         Med_alpha    Med_beta     Med_gamma   Delta(deg)
34 in P1.
cluster_23       34       96.51 (0.17 ) 96.69 (0.09 ) 97.01 (0.31 ) 89.95 (0.31) 89.97 (0.31) 89.96 (0.17)
      P m -3 m (No. 221)  96.74         96.74         96.74         90.00        90.00        90.00         0.3   

5 in P1.
cluster_22       5        96.68 (0.32 ) 136.62(0.16 ) 137.08(0.31 ) 90.12 (0.24) 90.05 (0.17) 90.07 (0.40)
     P 4/m m m (No. 123)  136.85        136.85        96.68         90.00        90.00        90.00         0.21  

4 in P1.
cluster_21       4        96.50 (0.06 ) 96.92 (0.36 ) 193.54(0.55 ) 89.97 (0.27) 89.92 (0.33) 89.99 (0.27)
     P 4/m m m (No. 123)  96.71         96.71         193.54        90.00        90.00        90.00         0.26  

Removing the print would remove the three lines of unit cells at the start.

@phyy-nx
Copy link
Contributor

phyy-nx commented Mar 3, 2022

Hi @jbeilstenedmands, no issues from me if you remove that print statement.

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

No branches or pull requests

2 participants