This repository was archived by the owner on May 7, 2026. It is now read-only.
New routes for diffcalc-core changes#134
Merged
Merged
Conversation
added 2 commits
November 29, 2022 11:14
…a functions to calculate hkl and offsets between them
Contributor
Author
|
Adding these extra routes has made me realise there's a few problems with the library I'd like to address:
Please have a look and recommend anything else that would be good for a PR. I'm also thinking I should actually write tests for my persistence layers, which so far I haven't. |
callumforrester
approved these changes
Nov 29, 2022
Contributor
callumforrester
left a comment
There was a problem hiding this comment.
Looks good to me, in response to your comments:
I think having many routes that do many things is fine in principle. I'm happy for you to talk me through the docs page though if you think there's room for consolidation.
Regarding comments, I think you have the right ones, you want this style:
"""Calculate a vector in reciprocal space relative to a reference vector.
Note, this method requires that a UB matrix exists for the Hkl object retrieved.
Args:
name: the name of the hkl object to access within the store
hkl_ref: the reference vector in hkl space
polar_angle: the polar angle, or the inclination between the zenith and
reference vector.
azimuth_angle: the azimuth angle
store: accessor to the hkl object.
collection: collection within which the hkl object resides.
Returns:
Tuple[float, float, float]
The calculated vector, related by an offset to the reference vector given.
"""
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An upcoming change to diffcalc-core functionality is being tested here. As a result the requirements.txt file has one changed line which looks at this branch instead of master.
These functions include, finding the offset between two hkl vectors, finding one hkl vector given another and an offset, and finding valid hkl solutions for a fixed scattering vector.