Skip to content

Commit

Permalink
doc name requests
Browse files Browse the repository at this point in the history
  • Loading branch information
Laura-Danielle committed Feb 21, 2024
1 parent 6398060 commit 7557e9f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
4 changes: 4 additions & 0 deletions api/src/opentrons/calibration_storage/ot2/models/v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ class TipLengthModel(BaseModel):
default_factory=CalibrationStatus,
description="The status of the calibration data.",
)
# Old data may have a `uri` field, replaced later by `definitionHash`.
# uri: typing.Union[LabwareUri, Literal[""]] = Field(
# ..., description="The tiprack URI associated with the tip length data."
# )
definitionHash: str = Field(
..., description="The tiprack hash associated with the tip length data."
)
Expand Down
13 changes: 8 additions & 5 deletions api/src/opentrons/calibration_storage/ot2/tip_length.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@ def tip_lengths_for_pipette(
tip_length_filepath = config.get_tip_length_cal_path() / f"{pipette_id}.json"
all_tip_lengths_for_pipette = io.read_cal_file(tip_length_filepath)
for tiprack_identifier, data in all_tip_lengths_for_pipette.items():
# check if tiprack hash
if len(tiprack_identifier.split("/")) == 1:
# We normally key these calibrations by their tip rack URI,
# but older software had them keyed by their tip rack hash.
# Migrate from the old format, if necessary.
if "/" not in tiprack_identifier:
data["definitionHash"] = tiprack_identifier
tiprack_identifier = data.pop("uri")
try:
Expand Down Expand Up @@ -140,10 +142,11 @@ def delete_tip_length_calibration(
tiprack_hash: typing.Optional[str] = None,
) -> None:
"""
Delete tip length calibration based on tiprack hash and
pipette serial number
Delete tip length calibration based on an optional tiprack uri or
tiprack hash and pipette serial number.
:param tiprack: tiprack hash
:param tiprack_uri: tiprack uri
:param tiprack_hash: tiprack uri
:param pipette: pipette serial number
"""
tip_lengths = tip_lengths_for_pipette(pipette_id)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,6 @@ def load_tip_length_for_pipette(
pipette_id, tiprack
)

# TODO (lc 09-26-2022) We shouldn't have to do a hash twice. We should figure out what
# information we actually need from the labware definition and pass it into
# the `load_tip_length_calibration` function.
tiprack_uri = helpers.uri_from_definition(tiprack)

return TipLengthCalibration(
Expand Down

0 comments on commit 7557e9f

Please sign in to comment.