Skip to content

Commit

Permalink
Merge branch 'edge' into chore-electron-update-v26
Browse files Browse the repository at this point in the history
  • Loading branch information
koji committed Oct 25, 2023
2 parents d7448af + 49fd98b commit ce11535
Show file tree
Hide file tree
Showing 146 changed files with 2,597 additions and 1,120 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/app-test-build-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:
make setup-js
- name: 'test frontend packages'
run: |
yarn jest --coverage=true --ci=true --collectCoverageFrom="app/src/**/*.(js|ts|tsx)" app/src components/src shared-data/js
make -C app test-cov
- name: 'Upload coverage report'
uses: codecov/codecov-action@v3
with:
Expand Down Expand Up @@ -141,8 +141,7 @@ jobs:
yarn config set cache-folder ${{ github.workspace }}/.yarn-cache
make setup-js
- name: 'test native(er) packages'
run: |
yarn jest --coverage=true --ci=true --collectCoverageFrom="(app-shell|app-shell-odd| discovery-client)/src/**/*.(js|ts|tsx)" app-shell/src app-shell-odd/src discovery-client/src
run: make test-js-internal tests="app-shell/src app-shell-odd/src discovery-client/src" cov_opts="--coverage=true --ci=true --collectCoverageFrom='(app-shell|app-shell-odd| discovery-client)/src/**/*.(js|ts|tsx)'"
- name: 'Upload coverage report'
uses: 'codecov/codecov-action@v3'
with:
Expand Down Expand Up @@ -315,7 +314,8 @@ jobs:
deploy-release-app:
name: 'Deploy built app artifacts to S3'
runs-on: 'ubuntu-22.04'
needs: ['js-unit-test', 'backend-unit-test', 'build-app', 'determine-build-type']
needs:
['js-unit-test', 'backend-unit-test', 'build-app', 'determine-build-type']
if: contains(fromJSON(needs.determine-build-type.outputs.variants), 'release') || contains(fromJSON(needs.determine-build-type.outputs.variants), 'internal-release')
steps:
- name: 'download run app builds'
Expand Down Expand Up @@ -401,15 +401,15 @@ jobs:
uses: slackapi/[email protected]
if: contains(fromJSON(needs.determine-build-type.outputs.variants), 'internal-release')
with:
payload: "{\"branch_or_tag\":\"${{ github.ref_name }}\",\"build_type\":\"${{ needs.determine-build-type.outputs.type }}\", \"gh_linkback\":\"https://github.com/Opentrons/opentrons/tree/${{ github.ref_name }}\", \"windows_build\":\"${{ env._ACCESS_URL }}/${{steps.names.outputs.windows-internal-release}}\", \"mac_build\":\"${{ env._ACCESS_URL }}/${{steps.names.outputs.mac-internal-release}}\", \"linux_build\":\"${{ env._ACCESS_URL }}/${{steps.names.outputs.linux-internal-release}}\"}"
payload: '{"branch_or_tag":"${{ github.ref_name }}","build_type":"${{ needs.determine-build-type.outputs.type }}", "gh_linkback":"https://github.com/Opentrons/opentrons/tree/${{ github.ref_name }}", "windows_build":"${{ env._ACCESS_URL }}/${{steps.names.outputs.windows-internal-release}}", "mac_build":"${{ env._ACCESS_URL }}/${{steps.names.outputs.mac-internal-release}}", "linux_build":"${{ env._ACCESS_URL }}/${{steps.names.outputs.linux-internal-release}}"}'
env:
SLACK_WEBHOOK_URL: ${{ secrets.OT_APP_OT3_SLACK_NOTIFICATION_WEBHOOK_URL }}
_ACCESS_URL: https://${{env._APP_DEPLOY_BUCKET_OT3}}/${{env._APP_DEPLOY_FOLDER_OT3}}
- name: 'slack notify release'
uses: slackapi/[email protected]
if: contains(fromJSON(needs.determine-build-type.outputs.variants), 'release')
with:
payload: "{\"branch_or_tag\":\"${{ github.ref_name }}\",\"build_type\":\"${{ needs.determine-build-type.outputs.type }}\", \"gh_linkback\":\"https://github.com/Opentrons/opentrons/tree/${{ github.ref_name }}\", \"windows_build\":\"${{ env._ACCESS_URL }}/${{steps.names.outputs.windows-release}}\", \"mac_build\":\"${{ env._ACCESS_URL }}/${{steps.names.outputs.mac-release}}\", \"linux_build\":\"${{ env._ACCESS_URL }}/${{steps.names.outputs.linux-release}}\"}"
payload: '{"branch_or_tag":"${{ github.ref_name }}","build_type":"${{ needs.determine-build-type.outputs.type }}", "gh_linkback":"https://github.com/Opentrons/opentrons/tree/${{ github.ref_name }}", "windows_build":"${{ env._ACCESS_URL }}/${{steps.names.outputs.windows-release}}", "mac_build":"${{ env._ACCESS_URL }}/${{steps.names.outputs.mac-release}}", "linux_build":"${{ env._ACCESS_URL }}/${{steps.names.outputs.linux-release}}"}'
env:
SLACK_WEBHOOK_URL: ${{ secrets.OT_APP_ROBOTSTACK_SLACK_NOTIFICATION_WEBHOOK_URL }}
_ACCESS_URL: https://${{env._APP_DEPLOY_BUCKET_ROBOTSTACK}}/${{env._APP_DEPLOY_FOLDER_ROBOTSTACK}}
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/components-test-build-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ jobs:
yarn config set cache-folder ./.yarn-cache
make setup-js
- name: 'run components unit tests'
run: |
yarn jest --coverage=true --ci=true --collectCoverageFrom="components/src/**/*.(js|ts|tsx)" components/src
run: make -C components test-cov
- name: 'Upload coverage report'
uses: codecov/codecov-action@v3
with:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/ll-test-build-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ jobs:
yarn config set cache-folder ./.yarn-cache
make setup-js
- name: 'run labware library unit tests'
run: |
yarn jest --coverage=true --ci=true --collectCoverageFrom="labware-library/src/**/*.(js|ts|tsx)" labware-library/src
run: make -C labware-library test-cov
- name: 'Upload coverage report'
uses: codecov/codecov-action@v3
with:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/pd-test-build-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ jobs:
yarn config set cache-folder ./.yarn-cache
make setup-js
- name: 'run PD unit tests'
run: |
yarn jest --coverage=true --ci=true --collectCoverageFrom="protocol-designer/src/**/*.(js|ts|tsx)" protocol-designer/src
run: make -C protocol-designer test-cov
- name: 'Upload coverage report'
uses: codecov/codecov-action@v3
with:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/react-api-client-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ jobs:
yarn config set cache-folder ./.yarn-cache
make setup-js
- name: 'run react-api-client unit tests'
run: |
yarn jest --coverage=true --ci=true --collectCoverageFrom="react-api-client/src/**/*.(js|ts|tsx)" react-api-client/src
run: make -C react-api-client test-cov
- name: 'Upload coverage report'
uses: codecov/codecov-action@v3
with:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/shared-data-test-lint-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,7 @@ jobs:
yarn config set cache-folder ./.yarn-cache
make setup-js
- name: 'run shared-data JS unit tests'
run: |
yarn jest --coverage=true --ci=true --collectCoverageFrom="shared-data/js/**/*.(js|ts|tsx)" shared-data/js
run: make -C shared-data test-cov
- name: 'Upload coverage report'
uses: codecov/codecov-action@v3
with:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/step-generation-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ jobs:
yarn config set cache-folder ./.yarn-cache
make setup-js
- name: 'run step generation unit tests'
run: |
yarn jest --coverage=true --ci=true --collectCoverageFrom="step-generation/src/**/*.(js|ts|tsx)" step-generation/src
run: make -C step-generation test-cov
- name: 'Upload coverage report'
uses: codecov/codecov-action@v3
with:
Expand Down
19 changes: 13 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
include ./scripts/python.mk

API_DIR := api
API_CLIENT_DIR := api-client
APP_DIR := app
APP_SHELL_DIR := app-shell
APP_SHELL_ODD_DIR := app-shell-odd
COMPONENTS_DIR := components
Expand All @@ -15,8 +17,10 @@ NOTIFY_SERVER_DIR := notify-server
PROTOCOL_DESIGNER_DIR := protocol-designer
SHARED_DATA_DIR := shared-data
UPDATE_SERVER_DIR := update-server
REACT_API_CLIENT_DIR := react-api-client
ROBOT_SERVER_DIR := robot-server
SERVER_UTILS_DIR := server-utils
STEP_GENERATION_DIR := step-generation
SYSTEM_SERVER_DIR := system-server
HARDWARE_DIR := hardware
USB_BRIDGE_DIR := usb-bridge
Expand Down Expand Up @@ -195,12 +199,7 @@ test-py: test-py-windows
$(MAKE) -C $(USB_BRIDGE_DIR) test

.PHONY: test-js
test-js:
yarn jest \
--coverage=$(cover) \
--watch=$(watch) \
--updateSnapshot=$(updateSnapshot) \
--ci=$(if $(CI),true,false)
test-js: test-js-internal

# lints and typechecks
.PHONY: lint
Expand Down Expand Up @@ -261,3 +260,11 @@ circular-dependencies-js:
yarn madge $(and $(CI),--no-spinner --no-color) --circular labware-library/src/index.tsx
yarn madge $(and $(CI),--no-spinner --no-color) --circular app/src/index.tsx
yarn madge $(and $(CI),--no-spinner --no-color) --circular components/src/index.ts

.PHONY: test-js-internal
test-js-internal:
yarn jest $(tests) $(test_opts) $(cov_opts)

.PHONY: test-js-%
test-js-%:
$(MAKE) test-js-internal tests="$(if $(tests),$(foreach test,$(tests),$*/$(test)),$*)" test_opts="$(test_opts)" cov_opts="$(cov_opts)"
4 changes: 4 additions & 0 deletions api-client/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@ clean:
.PHONY: build
build:
rollup --config rollup.config.js

.PHONY: test
test:
$(MAKE) -C .. test-js-api-client
9 changes: 5 additions & 4 deletions api/docs/v2/new_advanced_running.rst
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Creating the dummy protocol requires you to:
1. Use the ``metadata`` or ``requirements`` dictionary to specify the API version. (See :ref:`v2-versioning` for details.) Use the same API version as you did in :py:meth:`opentrons.execute.get_protocol_api`.
2. Define a ``run()`` function.
3. Load all of your labware in their initial locations.
4. Load your smallest capacity pipette and specify its ``tipracks``.
4. Load your smallest capacity pipette and specify its ``tip_racks``.
5. Call ``pick_up_tip()``. Labware Position Check can't run if you don't pick up a tip.

For example, the following dummy protocol will use a P300 Single-Channel GEN2 pipette to enable Labware Position Check for an OT-2 tip rack, NEST reservoir, and NEST flat well plate.
Expand Down Expand Up @@ -116,13 +116,13 @@ This automatically generated code uses generic names for the loaded labware. If
.. versionadded:: 2.12

Once you've executed this code in Jupyter Notebook, all subsequent positional calculations for this reservoir in slot D2 will be adjusted 0.1 mm to the right, 0.2 mm to the back, and 0.3 mm up.
Once you've executed this code in Jupyter Notebook, all subsequent positional calculations for this reservoir in slot 2 will be adjusted 0.1 mm to the right, 0.2 mm to the back, and 0.3 mm up.

Remember, you should only add ``.set_offset()`` commands to protocols run outside of the Opentrons App. And you should follow the behavior of Labware Position Check, i.e., *do not* reuse offset measurements unless they apply to the *same labware* in the *same deck slot* on the *same robot*.
Remember, you should only add ``set_offset()`` commands to protocols run outside of the Opentrons App. And you should follow the behavior of Labware Position Check, i.e., *do not* reuse offset measurements unless they apply to the *same labware* in the *same deck slot* on the *same robot*.

.. warning::

Improperly reusing offset data may cause your robot to move to an unexpected position or crash against other labware, which can lead to incorrect protocol execution or damage your equipment. The same applies when running protocols with ``.set_offset()`` commands in the Opentrons App. When in doubt: run Labware Position Check again and update your code!
Improperly reusing offset data may cause your robot to move to an unexpected position or crash against labware, which can lead to incorrect protocol execution or damage your equipment. The same applies when running protocols with ``set_offset()`` commands in the Opentrons App. When in doubt: run Labware Position Check again and update your code!

Using Custom Labware
--------------------
Expand All @@ -144,6 +144,7 @@ To disable the robot server, open a Jupyter terminal session by going to **New >
Command Line
------------

.. TODO update with separate links to OT-2 and Flex setup, when new Flex process is in manual or on help site
The robot's command line is accessible either by going to **New > Terminal** in Jupyter or `via SSH <https://support.opentrons.com/s/article/Connecting-to-your-OT-2-with-SSH>`_.

To execute a protocol from the robot's command line, copy the protocol file to the robot with ``scp`` and then run the protocol with ``opentrons_execute``:
Expand Down
26 changes: 21 additions & 5 deletions api/docs/v2/new_pipette.rst
Original file line number Diff line number Diff line change
Expand Up @@ -310,34 +310,50 @@ The single- and multi-channel P50 GEN1 pipettes are the exceptions here. If your
Volume Modes
============

The Flex 1-Channel 50 µL and Flex 8-Channel 50 µL pipettes must operate in a low-volume mode to accurately dispense 1 µL of liquid. Set low-volume mode by calling :py:meth:`.InstrumentContext.configure_for_volume` with the amount of liquid you plan to aspirate, in µL::
The Flex 1-Channel 50 µL and Flex 8-Channel 50 µL pipettes must operate in a low-volume mode to accurately dispense very small volumes of liquid. Set the volume mode by calling :py:meth:`.InstrumentContext.configure_for_volume` with the amount of liquid you plan to aspirate, in µL::

pipette50.configure_for_volume(1)
pipette50.pick_up_tip()
pipette50.aspirate(1, plate["A1"])
.. versionadded:: 2.15

Passing different values to ``configure_for_volume()`` changes the minimum and maximum volume of Flex 50 µL pipettes as follows:

.. list-table::
:header-rows: 1
:widths: 2 3 3

* - Value
- Minimum Volume (µL)
- Maximum Volume (µL)
* - 1–4.9
- 1
- 30
* - 5–50
- 5
- 50

.. note::
The pipette must not contain liquid when you call ``configure_for_volume()``, or the API will raise an error.

Also, if the pipette is in a well location that may contain liquid, it will move upward to ensure it is not immersed in liquid before changing its mode.
Also, if the pipette is in a well location that may contain liquid, it will move upward to ensure it is not immersed in liquid before changing its mode. Calling ``configure_for_volume()`` *before* ``pick_up_tip()`` helps to avoid this situation.

In a protocol that handles many different volumes, it's a good practice to call this function immediately before each :py:meth:`.transfer` or :py:meth:`.aspirate`, specifying the volume that you are about to handle. When operating with a list of volumes, nest ``configure_for_volume()`` inside a ``for`` loop to ensure that the pipette is properly configured for each volume:
In a protocol that handles many different volumes, it's a good practice to call ``configure_for_volume()`` once for each :py:meth:`.transfer` or :py:meth:`.aspirate`, specifying the volume that you are about to handle. When operating with a list of volumes, nest ``configure_for_volume()`` inside a ``for`` loop to ensure that the pipette is properly configured for each volume:

.. code-block:: python
volumes = [1, 2, 3, 4, 1, 5, 2, 8]
sources = plate.columns()[0]
destinations = plate.columns()[1]
for i in range(8):
pipette50.pick_up_tip()
pipette50.configure_for_volume(volumes[i])
pipette50.pick_up_tip()
pipette50.aspirate(volume=volumes[i], location=sources[i])
pipette50.dispense(location=destinations[i])
pipette50.drop_tip()
If you know that all your liquid handling will take place in a specific mode, then you can call ``configure_for_volume()`` just once with a nominal volume. Or if all the volumes correspond to the pipette's default mode, you don't have to call ``configure_for_volume()`` at all.
If you know that all your liquid handling will take place in a specific mode, then you can call ``configure_for_volume()`` just once with a representative volume. Or if all the volumes correspond to the pipette's default mode, you don't have to call ``configure_for_volume()`` at all.


.. _new-plunger-flow-rates:
Expand Down
4 changes: 4 additions & 0 deletions app-shell-odd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,7 @@ dev: export NODE_ENV := development
dev:
webpack
$(electron)

.PHONY: test
test:
$(MAKE) -C .. test-js-app-shell-odd
15 changes: 15 additions & 0 deletions app-shell/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ PORT ?= 8090
# TODO(mc, 2018-08-07): figure out a better way to do this
ui_dir := ../app

# Path of source package
SRC_PATH = app-shell

# cross-platform noop command
noop := cd .

Expand All @@ -23,6 +26,14 @@ dist_files = $(if $(filter $(1),robot-stack),"dist/**/Opentrons-*","dist/**/Open
update_files := "dist/@(alpha|beta|latest)*.@(yml|json)"
publish_dir := dist/publish

# These variables can be overriden when make is invoked to customize the
# behavior of jest. For instance,
# make test tests=src/__tests__/http.test.ts would run only the
# specified test
tests ?= $(SRC_PATH)/src
cov_opts ?= --coverage=true --ci=true --collectCoverageFrom='app-shell/src/**/*.(js|ts|tsx)'
test_opts ?=

# Other SSH args for robot
ssh_opts ?= $(default_ssh_opts)

Expand Down Expand Up @@ -173,3 +184,7 @@ dev: export OPENTRONS_PROJECT := $(OPENTRONS_PROJECT)
dev: clean-dev-autoupdate ./dev-app-update.yml
webpack
$(electron)

.PHONY: test
test:
$(MAKE) -C .. test-js-app-shell
2 changes: 1 addition & 1 deletion app-shell/scripts/before-pack.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ module.exports = function beforeBuild(context) {
'install',
`--target=${path.join(PYTHON_DESTINATION, sitePackages)}`,
path.join(__dirname, '../../shared-data/python'),
path.join(__dirname, '../../hardware'),
path.join(__dirname, '../../hardware[flex]'),
path.join(__dirname, '../../api'),
'pandas==1.4.3',
])
Expand Down
18 changes: 18 additions & 0 deletions app/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ PATH := $(shell cd .. && yarn bin):$(PATH)
# dev server port
PORT ?= 8090

# Path of source package
SRC_PATH = app

OPENTRONS_PROJECT ?= robot-stack

# dependency directories for dev
Expand All @@ -18,6 +21,13 @@ discovery_client_dir := ../discovery-client

# override webpack's default hashing algorithm for node 18: https://github.com/webpack/webpack/issues/14532
export NODE_OPTIONS := --openssl-legacy-provider
# These variables can be overriden when make is invoked to customize the
# behavior of jest. For instance,
# make test tests=src/pages/Labware/__tests__/hooks.test.tsx would run only the
# specified test
tests ?=
cov_opts ?= --coverage=true --ci=true --collectCoverageFrom='app/src/**/*.(js|ts|tsx)'
test_opts ?=

# standard targets
#####################################################################
Expand Down Expand Up @@ -80,3 +90,11 @@ dev-shell-odd: export OT_APP_UI__HEIGHT := 600
dev-shell-odd:
wait-on http-get://localhost:$(PORT)
$(MAKE) -C $(shell_odd_dir) dev OPENTRONS_PROJECT=$(OPENTRONS_PROJECT)

.PHONY: test
test:
make -C .. test-js-app tests="$(tests)" test_opts="$(test_opts)"

.PHONY: test-cov
test-cov:
make -C .. test-js-app tests=$(tests) test_opts="$(test_opts)" cov_opts="$(cov_opts)"
Loading

0 comments on commit ce11535

Please sign in to comment.