Skip to content

Commit

Permalink
defer_build=True in shared-data.
Browse files Browse the repository at this point in the history
  • Loading branch information
SyntaxColoring committed Dec 17, 2024
1 parent 023276e commit b64c446
Show file tree
Hide file tree
Showing 8 changed files with 158 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ class Geometry(GripperBaseModel):
jaw_width: Dict[str, float]
max_allowed_grip_error: _StrictNonNegativeFloat

model_config = {"defer_build": True}


class GripForceProfile(GripperBaseModel):
"""Gripper force profile."""
Expand All @@ -85,6 +87,8 @@ class GripForceProfile(GripperBaseModel):
min: _StrictNonNegativeFloat
max: _StrictNonNegativeFloat

model_config = {"defer_build": True}


class GripperDefinition(GripperBaseModel):
"""Gripper definition."""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ class CornerOffsetFromSlot(BaseModel):
y: _Number
z: _Number

model_config = {"defer_build": True}


class OverlapOffset(BaseModel):
"""
Expand All @@ -71,6 +73,8 @@ class OverlapOffset(BaseModel):
y: _Number
z: _Number

model_config = {"defer_build": True}


class OffsetVector(BaseModel):
"""
Expand All @@ -81,6 +85,8 @@ class OffsetVector(BaseModel):
y: _Number
z: _Number

model_config = {"defer_build": True}


class GripperOffsets(BaseModel):
"""
Expand All @@ -90,6 +96,8 @@ class GripperOffsets(BaseModel):
pickUpOffset: OffsetVector
dropOffset: OffsetVector

model_config = {"defer_build": True}


class BrandData(BaseModel):
brand: str = Field(..., description="Brand/manufacturer name")
Expand All @@ -101,6 +109,8 @@ class BrandData(BaseModel):
None, description="URLs for manufacturer page(s)"
)

model_config = {"defer_build": True}


class DisplayCategory(str, Enum):
tipRack = "tipRack"
Expand All @@ -113,6 +123,8 @@ class DisplayCategory(str, Enum):
other = "other"
lid = "lid"

model_config = {"defer_build": True}


class LabwareRole(str, Enum):
labware = "labware"
Expand All @@ -121,6 +133,8 @@ class LabwareRole(str, Enum):
maintenance = "maintenance"
lid = "lid"

model_config = {"defer_build": True}


class Metadata(BaseModel):
"""
Expand All @@ -138,6 +152,8 @@ class Metadata(BaseModel):
None, description="List of descriptions for a given labware"
)

model_config = {"defer_build": True}


class Parameters(BaseModel):
"""
Expand Down Expand Up @@ -181,6 +197,8 @@ class Parameters(BaseModel):
None, description="Distance to move magnetic module magnets to engage"
)

model_config = {"defer_build": True}


class Dimensions(BaseModel):
"""
Expand All @@ -191,6 +209,8 @@ class Dimensions(BaseModel):
zDimension: _NonNegativeNumber = Field(...)
xDimension: _NonNegativeNumber = Field(...)

model_config = {"defer_build": True}


class WellDefinition(BaseModel):
model_config = ConfigDict(extra="allow")
Expand Down Expand Up @@ -235,6 +255,8 @@ class WellDefinition(BaseModel):
None, description="str id of the well's corresponding" "innerWellGeometry"
)

model_config = {"defer_build": True}


class SphericalSegment(BaseModel):
shape: Spherical = Field(..., description="Denote shape as spherical")
Expand Down Expand Up @@ -262,7 +284,7 @@ class SphericalSegment(BaseModel):
def count(self) -> int:
return self.xCount * self.yCount

model_config = ConfigDict(ignored_types=(cached_property,))
model_config = ConfigDict(ignored_types=(cached_property,), defer_build=True)


class ConicalFrustum(BaseModel):
Expand Down Expand Up @@ -296,7 +318,7 @@ class ConicalFrustum(BaseModel):
def count(self) -> int:
return self.xCount * self.yCount

model_config = ConfigDict(ignored_types=(cached_property,))
model_config = ConfigDict(ignored_types=(cached_property,), defer_build=True)


class CuboidalFrustum(BaseModel):
Expand Down Expand Up @@ -339,7 +361,7 @@ class CuboidalFrustum(BaseModel):
def count(self) -> int:
return self.xCount * self.yCount

model_config = ConfigDict(ignored_types=(cached_property,))
model_config = ConfigDict(ignored_types=(cached_property,), defer_build=True)


# A squared cone is the intersection of a cube and a cone that both
Expand Down Expand Up @@ -480,7 +502,7 @@ def volume_to_height_table(self) -> Dict[float, float]:
def count(self) -> int:
return self.xCount * self.yCount

model_config = ConfigDict(ignored_types=(cached_property,))
model_config = ConfigDict(ignored_types=(cached_property,), defer_build=True)


"""
Expand Down Expand Up @@ -605,7 +627,7 @@ class RoundedCuboidSegment(BaseModel):
def count(self) -> int:
return self.xCount * self.yCount

model_config = ConfigDict(ignored_types=(cached_property,))
model_config = ConfigDict(ignored_types=(cached_property,), defer_build=True)


class Metadata1(BaseModel):
Expand All @@ -623,6 +645,8 @@ class Metadata1(BaseModel):
None, description="Bottom shape of the well for UI purposes"
)

model_config = {"defer_build": True}


class Group(BaseModel):
wells: List[str] = Field(
Expand All @@ -635,6 +659,8 @@ class Group(BaseModel):
None, description="Brand data for the well group (e.g. for tubes)"
)

model_config = {"defer_build": True}


WellSegment = Union[
ConicalFrustum,
Expand All @@ -651,6 +677,8 @@ class InnerWellGeometry(BaseModel):
description="A list of all of the sections of the well that have a contiguous shape",
)

model_config = {"defer_build": True}


class LabwareDefinition(BaseModel):
schemaVersion: Literal[1, 2, 3] = Field(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ class Coordinate(BaseModel):
y: _Number
z: _Number

model_config = {"defer_build": True}


class DelayParams(BaseModel):
"""Parameters for delay."""
Expand All @@ -68,6 +70,8 @@ class DelayParams(BaseModel):
..., description="Duration of delay, in seconds."
)

model_config = {"defer_build": True}


class DelayProperties(BaseModel):
"""Shared properties for delay.."""
Expand All @@ -88,6 +92,8 @@ def _validate_params(
raise ValueError("If enable is true parameters for delay must be defined.")
return v

model_config = {"defer_build": True}


class LiquidClassTouchTipParams(BaseModel):
"""Parameters for touch-tip."""
Expand Down Expand Up @@ -129,6 +135,8 @@ def _validate_params(
)
return v

model_config = {"defer_build": True}


class MixParams(BaseModel):
"""Parameters for mix."""
Expand All @@ -138,6 +146,8 @@ class MixParams(BaseModel):
)
volume: _Number = Field(..., description="Volume used for mixing, in microliters.")

model_config = {"defer_build": True}


class MixProperties(BaseModel):
"""Mixing properties."""
Expand All @@ -158,6 +168,8 @@ def _validate_params(
raise ValueError("If enable is true parameters for mix must be defined.")
return v

model_config = {"defer_build": True}


class BlowoutParams(BaseModel):
"""Parameters for blowout."""
Expand All @@ -169,6 +181,8 @@ class BlowoutParams(BaseModel):
..., description="Flow rate for blow out, in microliters per second."
)

model_config = {"defer_build": True}


class BlowoutProperties(BaseModel):
"""Blowout properties."""
Expand All @@ -191,6 +205,8 @@ def _validate_params(
)
return v

model_config = {"defer_build": True}


class Submerge(BaseModel):
"""Shared properties for the submerge function before aspiration or dispense."""
Expand All @@ -204,6 +220,8 @@ class Submerge(BaseModel):
)
delay: DelayProperties = Field(..., description="Delay settings for submerge.")

model_config = {"defer_build": True}


class RetractAspirate(BaseModel):
"""Shared properties for the retract function after aspiration."""
Expand All @@ -227,6 +245,8 @@ class RetractAspirate(BaseModel):
..., description="Delay settings for retract after aspirate."
)

model_config = {"defer_build": True}


class RetractDispense(BaseModel):
"""Shared properties for the retract function after dispense."""
Expand All @@ -253,6 +273,8 @@ class RetractDispense(BaseModel):
..., description="Delay settings for retract after dispense."
)

model_config = {"defer_build": True}


class AspirateProperties(BaseModel):
"""Properties specific to the aspirate function."""
Expand Down Expand Up @@ -280,6 +302,8 @@ class AspirateProperties(BaseModel):
)
delay: DelayProperties = Field(..., description="Delay settings after an aspirate")

model_config = {"defer_build": True}


class SingleDispenseProperties(BaseModel):
"""Properties specific to the single-dispense function."""
Expand Down Expand Up @@ -309,6 +333,8 @@ class SingleDispenseProperties(BaseModel):
)
delay: DelayProperties = Field(..., description="Delay after dispense, in seconds.")

model_config = {"defer_build": True}


class MultiDispenseProperties(BaseModel):
"""Properties specific to the multi-dispense function."""
Expand Down Expand Up @@ -343,6 +369,8 @@ class MultiDispenseProperties(BaseModel):
..., description="Delay settings after each dispense"
)

model_config = {"defer_build": True}


class ByTipTypeSetting(BaseModel):
"""Settings for each kind of tip this pipette can use."""
Expand All @@ -363,6 +391,8 @@ class ByTipTypeSetting(BaseModel):
json_schema_extra=_remove_default,
)

model_config = {"defer_build": True}


class ByPipetteSetting(BaseModel):
"""The settings for this liquid class when used with a specific kind of pipette."""
Expand All @@ -372,6 +402,8 @@ class ByPipetteSetting(BaseModel):
..., description="Settings for each kind of tip this pipette can use"
)

model_config = {"defer_build": True}


class LiquidClassSchemaV1(BaseModel):
"""Defines a single liquid class's properties for liquid handling functions."""
Expand Down
Loading

0 comments on commit b64c446

Please sign in to comment.