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

Remove symmetry elements for SaveINS #38605

Open
wants to merge 12 commits into
base: release-next
Choose a base branch
from
Open

Conversation

zjmorgan
Copy link
Contributor

@zjmorgan zjmorgan commented Jan 15, 2025

Description of work

SaveINS incorrectly includes all symmetry elements and should not include identity, inversion, or any that can be generated by the lattice centering translations.

Summary of work

Redundant symmetry elements that can be generated by the underlying centering condition or rotoinversion should be removed. In addition, identity does not need to be included.

To test:

Run the additional system tests. Or, run this example. Choose any space group. Go to link https://cci.lbl.gov/cctbx/shelx.html and enter the same space group symbol. Cross check that it gives the same symmetry operators. Order does not matter.

# import mantid algorithms, numpy and matplotlib
from mantid.simpleapi import *
import matplotlib.pyplot as plt
import numpy as np

ws = CreateSampleWorkspace(OutputWorkspace='ws', NumBanks=1, BankPixelWidth=1, BinWidth=20000)  # 1 bin
SetUB(Workspace=ws, a=7.6508, b=13.2431, c=11.6243, alpha=90, beta=104.1183, gamma=90)
ndensity = 4 / ws.sample().getOrientedLattice().volume()  # number density with 4 formula units per u.c
SetSample(InputWorkspace=ws, Material={'ChemicalFormula': 'C12 H9 N3 O2 S1',
          'SampleNumberDensity': ndensity})
SaveINS(InputWorkspace=ws, Filename='/tmp/SHELX.ins', Spacegroup='I a -3 d', UseNaturalIsotopicAbundances=True)

Reviewer

Please comment on the points listed below (full description).
Your comments will be used as part of the gatekeeper process, so please comment clearly on what you have checked during your review. If changes are made to the PR during the review process then your final comment will be the most important for gatekeepers. In this comment you should make it clear why any earlier review is still valid, or confirm that all requested changes have been addressed.

Code Review

  • Is the code of an acceptable quality?
  • Does the code conform to the coding standards?
  • Are the unit tests small and test the class in isolation?
  • If there is GUI work does it follow the GUI standards?
  • If there are changes in the release notes then do they describe the changes appropriately?
  • Do the release notes conform to the release notes guide?

Functional Tests

  • Do changes function as described? Add comments below that describe the tests performed?
  • Do the changes handle unexpected situations, e.g. bad input?
  • Has the relevant (user and developer) documentation been added/updated?

Does everything look good? Mark the review as Approve. A member of @mantidproject/gatekeepers will take care of it.

Gatekeeper

If you need to request changes to a PR then please add a comment and set the review status to "Request changes". This will stop the PR from showing up in the list for other gatekeepers.

@sf1919
Copy link
Contributor

sf1919 commented Jan 15, 2025

Can we get a milestone on this so we know whether we're trying to get it into v6.12 or not?

@zjmorgan zjmorgan added Diffraction Issues and pull requests related to diffraction Single Crystal Issues and pull requests related to single crystal Bug Issues and pull requests that are regressions or would be considered a bug by users (e.g. crashing) labels Jan 15, 2025
@zjmorgan zjmorgan added this to the Release 6.12 milestone Jan 15, 2025
@@ -0,0 +1 @@
- Fix :ref:`SaveINS<algm-SaveINS-v1>` that saved all symmetry records to file. Only the minimum are needed that can be generated by translation/rotation corresponding to the lattice type.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this needs to move a level deeper, into the Bugfixes folder

@jclarkeSTFC jclarkeSTFC changed the base branch from main to release-next January 16, 2025 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Issues and pull requests that are regressions or would be considered a bug by users (e.g. crashing) Diffraction Issues and pull requests related to diffraction Single Crystal Issues and pull requests related to single crystal
Projects
Status: Ready for Review
Development

Successfully merging this pull request may close these issues.

4 participants