Skip to content

Conversation

@rosesyrett
Copy link
Contributor

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.

…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.
name: str, hklCalc: HklCalculation = Depends(unpickleHkl)
):
return Response(
content=hklCalc.constraints.__str__(), media_type="application/text"
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it appropriate to return a string? Would we be better of serialising to JSON?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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.

@rosesyrett rosesyrett merged commit dac9961 into master Jul 13, 2022
@rosesyrett rosesyrett deleted the getUbAndConstraints branch July 13, 2022 15:08
rosesyrett pushed a commit that referenced this pull request Aug 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants