Skip to content
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

fix(robot-server): correct the data returned from instruments endpoint #12067

Merged
merged 7 commits into from
Feb 1, 2023

Conversation

sanni-t
Copy link
Member

@sanni-t sanni-t commented Jan 26, 2023

Overview

Fixes the issue where jawState and gripperModel were returning enums instead of strings/ values.
Also fixes the issue of instrument detachments not updating correctly in the instruments cache.

Test Plan

Tested on an OT3

Review requests

  • Code looks okay. There were multiple changes made to GripperModel and right now it's in a bit of incomplete state pending the decision on whether to use string enums or not. Until then it would contain a bit of a redundant code related to stringification of the models.
  • Test on the robot and with the app and make sure all data returned is in correct format

Risk assessment

None. The change is according to the schema & client expectations.

Copy link
Contributor

@b-cooper b-cooper left a comment

Choose a reason for hiding this comment

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

👍

@codecov
Copy link

codecov bot commented Jan 26, 2023

Codecov Report

Merging #12067 (f457ee6) into edge (595b73e) will increase coverage by 0.06%.
The diff coverage is 88.23%.

Impacted file tree graph

@@            Coverage Diff             @@
##             edge   #12067      +/-   ##
==========================================
+ Coverage   73.95%   74.02%   +0.06%     
==========================================
  Files        2194     2202       +8     
  Lines       60718    61067     +349     
  Branches     6428     6526      +98     
==========================================
+ Hits        44907    45204     +297     
- Misses      14293    14321      +28     
- Partials     1518     1542      +24     
Flag Coverage Δ
app 72.73% <ø> (+0.30%) ⬆️
notify-server 89.13% <ø> (ø)
protocol-designer 45.89% <ø> (ø)
shared-data 85.15% <75.00%> (-0.05%) ⬇️
step-generation 88.46% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...pentrons_shared_data/gripper/gripper_definition.py 95.74% <71.42%> (-2.04%) ⬇️
api/src/opentrons/hardware_control/ot3api.py 80.66% <100.00%> (ø)
...a/python/opentrons_shared_data/gripper/__init__.py 75.00% <100.00%> (ø)
app/src/organisms/CalibrationTaskList/index.tsx 78.12% <0.00%> (-6.50%) ⬇️
...ngsCalibration/CalibrationDetails/OverflowMenu.tsx 73.41% <0.00%> (-2.98%) ⬇️
.../organisms/Devices/hooks/useCalibrationTaskList.ts 97.48% <0.00%> (-0.27%) ⬇️
...pentrons_shared_data/pipette/pipette_definition.py 91.30% <0.00%> (-0.08%) ⬇️
app/src/organisms/SetupNetwork/SearchNetwork.tsx 100.00% <0.00%> (ø)
app/src/organisms/CalibrationStatusCard/index.tsx 100.00% <0.00%> (ø)
... and 17 more

@@ -498,6 +498,12 @@ async def cache_instruments(
await self.cache_pipette(
mount, cast(OT3AttachedPipette, instrument_data), req_instr_name
)
if self._gripper_handler.gripper and OT3Mount.GRIPPER not in found.keys():
Copy link
Contributor

@ahiuchingau ahiuchingau Jan 30, 2023

Choose a reason for hiding this comment

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

You could do something like this

for mount in OT3Mount:
    if mount in found.keys() and mount == OT3Mount.GRIPPER:
        await self.cache_gripper(cast(AttachedGripper, found[mount]))
    elif mount in found.keys():
        req_instr_name = checked_require.get(mount, None)
        await self.cache_pipette(
            mount, cast(OT3AttachedPipette, found[mount]), req_instr_name
        )
    elif mount == OT3Mount.GRIPPER:
         await  self._gripper_handler.reset()
    else:
          self._pipette_handler.hardware_instruments[mount] = None

Copy link
Contributor

@ahiuchingau ahiuchingau left a comment

Choose a reason for hiding this comment

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

Tested attaching/detaching on all mounts on Bubble, worked as expected

@sanni-t sanni-t marked this pull request as ready for review January 31, 2023 19:17
@sanni-t sanni-t requested review from a team as code owners January 31, 2023 19:17
@sanni-t sanni-t merged commit ed0e6f3 into edge Feb 1, 2023
@sanni-t sanni-t deleted the robot-server-update_instruments_endpoint branch February 1, 2023 20:07
y3rsh added a commit that referenced this pull request Feb 7, 2023
* edge: (116 commits)
  feat(system-server): add sqlite database and barebones HTTP server (#12085)
  feat(ot3): add enableOT3FirmwareUpdates feature flag to gate firmware update functionality. (#12102)
  feat(app): add bare bones hardware section to protocol details (#12099)
  feat(app): Support failed calibrations in the calibration wizard (#12092)
  refactor(docs): clean up Versioning page (#12084)
  refactor(robot-server): Make run and protocol limits configurable at launch (#12094)
  feat(app): add robotServerVersion to display the current robot software version (#12096)
  fix(hardware): do not track tip motor positions (#12093)
  feat(engine): allow calibrateGripper command to save calibration data (#12046)
  feat(app, api-client, react-api-client): delete POC TLC calibration data from overflow menu (#12075)
  fix(api): actually update OT3 instrument calibration offset in cache instrument (#12089)
  fix(robot-server): correct the data returned from instruments endpoint (#12067)
  feat(api): add thermocycler plate lift to hardware controller (#12068)
  fix(app): reference moduleId from result not params (#12077)
  feat(app): create ODD protocol setup page (#12071)
  refactor(api): Deprecate presses and increment args when using PAPI pick_up_tip (#12079)
  fix(ot3): handle multiple responses for a tip action request (#12083)
  refactor(api): touch tip implementation for PAPIv2 engine core (#12053)
  refactor(app): Remove ssid parameter from OnDeviceRouteParams (#11930)
  fix(api): fix broken test in the api hardware controller (#12080)
  ...
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.

None yet

3 participants