-
Notifications
You must be signed in to change notification settings - Fork 14
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 fields required for SSX to events route #250
Open
mgaonach
wants to merge
3
commits into
master
Choose a base branch
from
ssx-events
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,10 @@ | |
|
||
from pydantic import BaseModel, Field | ||
|
||
from pydantic_sqlalchemy import sqlalchemy_to_pydantic | ||
|
||
from ispyb import models | ||
|
||
|
||
class Workflow(BaseModel): | ||
workflowId: int | ||
|
@@ -42,7 +46,8 @@ class Config: | |
|
||
class DataCollectionGroup(BaseModel): | ||
dataCollectionGroupId: int | ||
experimentType: str | ||
experimentType: Optional[str] | ||
blSampleId: Optional[int] | ||
|
||
Workflow: Optional[Workflow] | ||
|
||
|
@@ -128,6 +133,13 @@ class DataCollectionBase(BaseModel): | |
xBeamPix: Optional[float] = Field(title="Beam size X", unit="pixels") | ||
yBeamPix: Optional[float] = Field(title="Beam size Y", unit="pixels") | ||
|
||
undulatorGap1: Optional[float] | ||
undulatorGap2: Optional[float] | ||
undulatorGap3: Optional[float] | ||
beamShape: Optional[str] | ||
polarisation: Optional[float] | ||
imagePrefix: Optional[str] | ||
|
||
# EM | ||
magnification: Optional[int] = Field(title="Magnification", unit="x") | ||
binning: Optional[int] = Field(title="Binning") | ||
|
@@ -155,6 +167,8 @@ class DataCollection(DataCollectionBase): | |
|
||
DataCollectionGroup: DataCollectionGroup | ||
GridInfo: Optional[list[GridInfo]] | ||
SSXDataCollection: Optional[sqlalchemy_to_pydantic(models.SSXDataCollection)] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is more complicated because its nested and not generated at run time. The easy option is to manually define the Schema in this case. Will have to think about runtime possibilities... |
||
Detector: Optional[sqlalchemy_to_pydantic(models.Detector)] | ||
|
||
metadata: DataCollectionMetaData = Field(alias="_metadata") | ||
|
||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
ispyb-models==1.0.6 | ||
ispyb-models==1.1.0 | ||
|
||
fastapi | ||
pydantic[dotenv] | ||
|
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.
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.
It'd be sensible to make this optional based on if models.DataCollection.SSXDataCollection exists. That way if people dont have the table it doesnt break the app