-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add a builder class for CIF files #548
Conversation
src/scippneutron/io/cif.py
Outdated
blocks = (blocks,) | ||
if isinstance(content, CIF): | ||
if comment: | ||
raise ValueError('Cannot specify a comment when saving a CIF object') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we just replace the comment if another one is given...?
Or will it be too flacky...?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right. I changed to it overwrite the comment. I don't think this is too flaky.
1849b1e
to
52469d8
Compare
This PR adds a new class to simplify writing CIF files. When implementing scipp/essdiffraction#89, I found that the existing low-level interface is tedious to use. And I needed to implement some functionality that should be in ScippNeutron and not ESS*, such as author and beamline handling. This will in particular be relevant once #473 is implemented. (Note that the current PR is meant as a stop-gap solution until the models from that issue are added.)
Fixes #547