Skip to content

Commit

Permalink
enable the pipette script to skip all pressure based things (#16934)
Browse files Browse the repository at this point in the history
<!--
Thanks for taking the time to open a Pull Request (PR)! Please make sure
you've read the "Opening Pull Requests" section of our Contributing
Guide:


https://github.com/Opentrons/opentrons/blob/edge/CONTRIBUTING.md#opening-pull-requests

GitHub provides robust markdown to format your PR. Links, diagrams,
pictures, and videos along with text formatting make it possible to
create a rich and informative PR. For more information on GitHub
markdown, see:


https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax

To ensure your code is reviewed quickly and thoroughly, please fill out
the sections below to the best of your ability!
-->

# Overview
Add an option for skipping pressure, we won't actually need this
apparently since they changed their mind about skipping the step of
drilling out the back vent of the diaphragm but if they change that in
the future we can use this.
<!--
Describe your PR at a high level. State acceptance criteria and how this
PR fits into other work. Link issues, PRs, and other relevant resources.
-->

## Test Plan and Hands on Testing

<!--
Describe your testing of the PR. Emphasize testing not reflected in the
code. Attach protocols, logs, screenshots and any other assets that
support your testing.
-->

## Changelog

<!--
List changes introduced by this PR considering future developers and the
end user. Give careful thought and clear documentation to breaking
changes.
-->

## Review requests

<!--
- What do you need from reviewers to feel confident this PR is ready to
merge?
- Ask questions.
-->

## Risk assessment

<!--
- Indicate the level of attention this PR needs.
- Provide context to guide reviewers.
- Discuss trade-offs, coupling, and side effects.
- Look for the possibility, even if you think it's small, that your
change may affect some other part of the system.
- For instance, changing return tip behavior may also change the
behavior of labware calibration.
- How do your unit tests and on hands on testing mitigate this PR's
risks and the risk of future regressions?
- Especially in high risk PRs, explain how you know your testing is
enough.
-->
  • Loading branch information
ryanthecoder authored Nov 21, 2024
1 parent cb182a0 commit 94bbb99
Showing 1 changed file with 24 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ class TestConfig:
num_trials: int
droplet_wait_seconds: int
simulate: bool
skip_all_pressure: bool


@dataclass
Expand Down Expand Up @@ -700,9 +701,12 @@ async def _test_for_leak(
accumulate_raw_data_cb
), "pressure fixture requires recording data to disk"
await _move_to_fixture(api, mount)
test_passed = await _fixture_check_pressure(
api, mount, test_config, fixture, write_cb, accumulate_raw_data_cb
)
if not test_config.skip_all_pressure:
test_passed = await _fixture_check_pressure(
api, mount, test_config, fixture, write_cb, accumulate_raw_data_cb
)
else:
test_passed = True
else:
await _pick_up_tip_for_tip_volume(api, mount, tip_volume=tip_volume)
await _move_to_reservoir_liquid(api, mount)
Expand Down Expand Up @@ -1129,7 +1133,9 @@ async def _read_pressure(_sensor_id: SensorId) -> float:
return all(results)


async def _test_diagnostics(api: OT3API, mount: OT3Mount, write_cb: Callable) -> bool:
async def _test_diagnostics(
api: OT3API, mount: OT3Mount, write_cb: Callable, cfg: TestConfig
) -> bool:
# ENVIRONMENT SENSOR
environment_pass = await _test_diagnostics_environment(api, mount, write_cb)
print(f"environment: {_bool_to_pass_fail(environment_pass)}")
Expand All @@ -1146,9 +1152,14 @@ async def _test_diagnostics(api: OT3API, mount: OT3Mount, write_cb: Callable) ->
print(f"capacitance: {_bool_to_pass_fail(capacitance_pass)}")
write_cb(["diagnostics-capacitance", _bool_to_pass_fail(capacitance_pass)])
# PRESSURE
pressure_pass = await _test_diagnostics_pressure(api, mount, write_cb)
print(f"pressure: {_bool_to_pass_fail(pressure_pass)}")
if not cfg.skip_all_pressure:
pressure_pass = await _test_diagnostics_pressure(api, mount, write_cb)
print(f"pressure: {_bool_to_pass_fail(pressure_pass)}")
else:
print("Skipping pressure")
pressure_pass = True
write_cb(["diagnostics-pressure", _bool_to_pass_fail(pressure_pass)])

return environment_pass and pressure_pass and encoder_pass and capacitance_pass


Expand Down Expand Up @@ -1674,7 +1685,9 @@ async def _main(test_config: TestConfig) -> None: # noqa: C901
if not test_config.skip_diagnostics:
await api.move_to(mount, hover_over_slot_3)
await api.move_rel(mount, Point(z=-20))
test_passed = await _test_diagnostics(api, mount, csv_cb.write)
test_passed = await _test_diagnostics(
api, mount, csv_cb.write, test_config
)
await api.retract(mount)
csv_cb.results("diagnostics", test_passed)
if not test_config.skip_plunger:
Expand Down Expand Up @@ -1806,6 +1819,7 @@ async def _main(test_config: TestConfig) -> None: # noqa: C901
arg_parser.add_argument("--skip-plunger", action="store_true")
arg_parser.add_argument("--skip-tip-presence", action="store_true")
arg_parser.add_argument("--skip-liquid-probe", action="store_true")
arg_parser.add_argument("--skip-all-pressure", action="store_true")
arg_parser.add_argument("--fixture-side", choices=["left", "right"], default="left")
arg_parser.add_argument("--port", type=str, default="")
arg_parser.add_argument("--num-trials", type=int, default=2)
Expand Down Expand Up @@ -1841,11 +1855,11 @@ async def _main(test_config: TestConfig) -> None: # noqa: C901
_cfg = TestConfig(
operator_name=operator,
skip_liquid=args.skip_liquid,
skip_fixture=args.skip_fixture,
skip_fixture=args.skip_fixture or args.skip_all_pressure,
skip_diagnostics=args.skip_diagnostics,
skip_plunger=args.skip_plunger,
skip_tip_presence=args.skip_tip_presence,
skip_liquid_probe=args.skip_liquid_probe,
skip_liquid_probe=args.skip_liquid_probe or args.skip_all_pressure,
fixture_port=args.port,
fixture_side=args.fixture_side,
fixture_aspirate_sample_count=args.aspirate_sample_count,
Expand All @@ -1859,6 +1873,7 @@ async def _main(test_config: TestConfig) -> None: # noqa: C901
num_trials=args.num_trials,
droplet_wait_seconds=args.wait,
simulate=args.simulate,
skip_all_pressure=args.skip_all_pressure,
)
# NOTE: overwrite default aspirate sample-count from user's input
# FIXME: this value is being set in a few places, maybe there's a way to clean this up
Expand Down

0 comments on commit 94bbb99

Please sign in to comment.