This repository was archived by the owner on May 7, 2026. It is now read-only.
Added get operations for UB/Constraints#2
Merged
Conversation
…aint objects in HklCalculation object. Modified tests for this, and also moved the UB calculation operation to hklCalc routes as it made most sense. Modified tests to reflect these changes.
garryod
reviewed
Jul 13, 2022
| name: str, hklCalc: HklCalculation = Depends(unpickleHkl) | ||
| ): | ||
| return Response( | ||
| content=hklCalc.constraints.__str__(), media_type="application/text" |
Contributor
There was a problem hiding this comment.
Is it appropriate to return a string? Would we be better of serialising to JSON?
Contributor
Author
There was a problem hiding this comment.
Ah, so the reason this is returning a string is because I want the terminal to print a lovely long message with newlines when this route is called. And I discovered that if it was inside a JSON object, this would not be the case. Effectively, the response content looks something like:
'<>
h k l tag
0 0 1 orient1
0 0 0.5 orient2
<< UB Matrix >>
....
'
and so on.
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.
added get operations to return the current state of the UB and Constraint objects in HklCalculation object. Modified tests for this, and also moved the UB calculation operation to hklCalc routes as it made most sense. Modified tests to reflect these changes.