Skip to content
This repository was archived by the owner on May 7, 2026. It is now read-only.

New routes for diffcalc-core changes#134

Merged
rosesyrett merged 2 commits into
masterfrom
includeNewCoreRoutes
Nov 29, 2022
Merged

New routes for diffcalc-core changes#134
rosesyrett merged 2 commits into
masterfrom
includeNewCoreRoutes

Conversation

@rosesyrett
Copy link
Copy Markdown
Contributor

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.

@rosesyrett
Copy link
Copy Markdown
Contributor Author

Adding these extra routes has made me realise there's a few problems with the library I'd like to address:

  1. Way too many routes, maybe I should be splitting them up more? For example maybe I clump them together into routes for reflections, for orientations, etc... rather than how they are now.
  2. Comments, these should probably look like numpy comments. I think the system I've got now probably won't compile nicely into sphynx documentation.

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.

Copy link
Copy Markdown
Contributor

@callumforrester callumforrester left a comment

Choose a reason for hiding this comment

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

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.
    """

@rosesyrett rosesyrett merged commit da06754 into master Nov 29, 2022
@rosesyrett rosesyrett deleted the includeNewCoreRoutes branch November 29, 2022 13:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants