Skip to content

Commit

Permalink
Update PD Staging Beta (#2646)
Browse files Browse the repository at this point in the history
* refactor(app): Add state for API update file (#2364)

* feat(api): Add skeleton of new Labware class (#2363)

Closes #2261

* fix(api): Change api update ignore route to be accessible to client (#2368)

Closes #2367

* feat(api): change tempdeck temperature resolution,fix temp in docs (#2359)

Closes #2358

* feat(app): Add upgrade and downgrade logic to robot updates (#2376)

* chore(api): Add 'TODO's to labware-related tests (#2372)

* chore(api): Add 'TODO's to labware-related tests. Closes #2259

* chore(api): Fix some mypy typing errors (#2387)

* feat(app): Prompt user to update app in robot update modal (#2386)

closes #2354

* feat(api): add hardware control move_to(), move_rel() (#2389)

Closes #2234

* feat(api): Add new protocol API stubs (#2375)

The protocol API will be the way for protocols to interact with the OT2 system.
It will allow users to run protocols locally and simulate them as well as
allowing the higher level system to run the protocols on a robot. It will couple
to the hardware controller.

This commit introduces the structure of the API. It is conceptually similar to
the robot API we currently use, but explicitly notes that what you manipulate
are contexts rather than exact hardware representations.

The required changes to current protocols are minimal and are only in fact
required to run a simulation with the protocol as an entrypoint.

Closes #2233

* feat(api): Add top, bottom, and center methods to Well (#2379)

* feat(api): Add top, bottom, and center methods to Well

Add top, bottom, and center methods to Well, and add internal methods for referencing an abstract position relative to the center of a well using cartesian coordinates (all methods return a point in absolute deck coordinates). Also moves the new labware module to `opentrons.protocol_api.labware`

Closes #2369

* feat(shared-data): Add generator function to create regular labware defs (#2380)

* feat(shared-data): Add generator function to create regular labware defs

* feat(components): create new tab-styled vertical nav bar (#2371)

Closes #1923

* feat(labware-designer): set up labware-designer skeleton for use in browser console (#2392)

* fix(api): Bind jupyter notebook to 0.0.0.0 (#2398)

The jupyter notebook package has a bug in 5.7.0 where specifying the notebook
application’s listening ip as ’*’ causes it to fail to boot:
jupyter/notebook#3946

The workaround listed there is to bind the server to 0.0.0.0 instead, so we do
that here.

Closes #2394

* feat(app): Add release notes to robot update modals (#2397)

closes #2353

* perf(app): Upgrade Electron to v3 and remove Node in renderer (#2374)

* feat(api): add instrument cache to hardware control (#2402)

Closes #2236

* refactor(api): Add protocol API back-compatibility layer (#2395)

* feat(api): Add back compat  shim for new protocol API and restructure old

This commit puts the components of the old protocol api (robot, instruments, etc) into a new `legacy_api` subpackage. It moves the singletons previously defined in`opentrons/__init__` into a file in `legacy_api`, and creates similar ones in `protocol_api/back_compat`. Then, `opentrons/__init__` now conditionally imports the right one based on a feature flag.

This means it is now possible (using the feature flag) to import opentrons without the robot singleton being instantiated. It also means it is now possible to import components of the legacy API without actually instantiating them.

In addition, this commit adds a new file, `simulate_protocol.py`, that will be the frontend for simulating protocols without a robot.

Closes #2246

* feat(app): Only display instrument settings for selected robot (#2406)

closes #2362

* chore(api): Fix more mypy type errors (#2399)

* chore(api): Require mypy pass for lint pass and fix type errors

* refactor(protocol-designer): refactor PD labware components for readability (#2390)

* test(api): fix test errors (#2417)

* feat(protocol-designer): implement "metadata.created" in JSON file (#2403)

Closes #2189

* fix(discovery-client): Ensure IPs are actually de-duped (#2404)

*  feat(protocol-designer): add substep level liquid tracking and expose in tooltip (#2400)

Restructure the return value of compound step generators such that their constituent atomic aspirate and dispense actions are not reduced to one step. With the new substep specific intermediate liquid states reshape the way that the steplist generated StepListItems and its children SubstepRows to rely on mid step liquid state, as opposed to initial liquid state of the entire parent step. Instead of passing down a boolean flag to substep rows for presence or absence of liquid in source and destination wells, give them a map of all well liquids and their individual volumes. Display all of this in a HoverTooltip on IngredPill.

Closes #2286

* chore(api): Add README on using generator function (#2411)

* feat(protocol-designer): modify the "name new labware" overlay for new design (#2422)

Closes #2410

* chore(flow): Upgrade flow / most npm typedefs and fix type failures (#2431)

* fix(discovery-client): Monkeypatch uncatchable throw from mdns-js (#2433)

* feat(discovery-client): Add mdns flag and health responses to services (#2420)

* feat(api): Add function for p1000 ul-to-millimeter conversions (#2425)

* feat(app): Display unreachable robots in list (#2434)

Closes #2344

* feat(api): Add accessor functions in new labware class (#2418)

* feat(protocol-designer): implement selective redux persistence (#2436)

* introduce subscriber-based mechanism to sync selected redux substates to localStorage
* refactor PD analytics to use this persistence mechanism

* fix(app): Allow portal to re-check for root element (#2440)

If the portal modal was used during the first render (e.g. for the analytics
opt-in modal), the modal root would not be present in the DOM (since the root
itself is created by the App component), causing the modal to not appear. This
change allows the Portal component to:

- Cache the root instead of getting it from the document on every render
- Retry getting the root after mounting, when we're (pretty) sure the root is
  also actually mounted in the DOM

* fix(app): Use type for labware table, not name (#2441)

Closes #2407

* feat(components): change default border width to 1px (#2385)

* API: add module support to hardware control (#2423)

* refactor(api): Move old module package into legacy_api

* feat(api): Add modules api to hardware_control

Closes #2237

* refactor(app): Organize robots by connectable, reachable, unreachable (#2449)

* feat(api): Add a displayName field to EAP types in /wifi/eap-options (#2448)

Closes #2439

* fix(api): Remove unnecessary return in hardware controller (#2450)

This should not have been merged.

* feat(protocol-designer): add liquids tab and sidebar (#2454)

* liquids page stub + tab
* refactor nav.json, replace strings with i18n

Closes #2426

* docs(api): Fix whitespace in code block for delete_container docs (#2456)

* feat(app): Display reachable but non-connectable robots (#2455)

Closes #2345

* feat(app): Remove 'opentrons-' prefix in robot displayNames (#2459)

closes #2357

* feat(protocol-designer): refactor and performance audit of labware components (#2442)

In the 4 main places we are using, or will use, the SelectablePlate component, there are shared
aspects of the abstraction that weigh down the application in places where the extra information is
not needed or used. This branch begins to separate our implementations by first creating a
SelectableLabware component which is used in the WellSelectionModal and maintains local state. The
LabwareOnDeck is also not rendering with select and hover handlers. The IngredientSelectionModal,
will use SelectableLabware or a similar component once the ingredient form sustains upcoming
changes.

Closes #2285

* refactor(app): Switch completely over to new discovery selectors (#2462)

* feat(protocol-designer): show hints as modal (#2447)

* persist only remembered hint dismissals
* transform before persisting
* move try/catch from configureStore.js to lower down

* perf(api): P1000 pick-up-tip shake and drop-tip plunger (#2446)

* perf(api): behavioral and config changes for p1000 to consistently pick-up and drop tips

* chore(release): 3.5.0-beta.0 (#2467)

* feat(api): Store pipette function params as data (#2466)

* feat(api): Store pipette function params as data

Modify pipette config system to include pipetting function parameters as data so they can be
recalibrated by users or during experiments

* feat(api): Add newly formatted labware defs and update labware schema (#2457)

* fix(api): Fix docs build failure after move to legacy_api (#2469)

Closes #2468

* feat(app): Move deck calibration to robot controls (#2470)

closes #2377

* build(api): Add shared-data to wheel (#2464)

* build(api): Add shared-data to wheel

And do it in a way that doesn’t require copying it into the source tree.

By overriding the build_py subcommand of distutils, which is a core element of
basically all the following distutils commands like sdist or install or (most
crucially) bdist_wheel, we can insert our shared-data into the build directory
which means it will be present in all the following artifacts.

Closes #2452

* feat(api): Add /networking/status endpoint to get all interface info (#2471)

Closes #2445

* feat(protocol-designer): create view to browse final liquid state (#2451)

Build the ability to drill down into a labware from the final deck state in order to inspect the
resulting liquid state of your protocol.

Closes #2335

* feat(api): Add labware load to protocol API (#2472)

Closes #2240

* feat(components): Add wifi connectivity icons (#2473)

* refactor(app): Rework client state for /networking/status endpoint (#2480)

* feat(protocol-designer): add tooltips on hover of final result wells (#2479)

Add mouse anchored tooltips on hover of wells with ingredients in the final results labware
drilldown including the same information as the ingredient pill tooltips in the side bar.

Closes #2409

* fix(repo): fix gitattributes hex crlf bug (#2482)

* fix bug where hex files were treated as text and auto-converted to unix endings
* pre-emptive fix for .bat files as well

* feat(protocol-designer): implement rounding properly (#2458)

* fix(protocol-designer): use proper rounding fn to avoid rounding errors

Closes #2405

* feat(protocol-designer): implement liquids page interactivity (#2478)

* liquids form & sidebar interactivity
* ingredients/liquids flow type cleanups

Closes #2427

* refactor(app): Add new ConnectionCard with interface and Wi-Fi details (#2484)

* fix(app): Check semver validity of API returned version strings (#2492)

* fix(protocol-designer): unhighlight wells on deselect in well selection modal (#2491)

Closes #2463

* fix(api): Filter out missing SSIDs from network list (#2493)

Closes #2489

* chore(release): 3.5.0-beta.1 (#2496)

* chore(api): Update pipenv and use pipenv sync (#2501)

Pipenv sync was added here: pypa/pipenv#1463 and had a
subsequent bug in it where it would sometimes update pipfile.lock, but that’s
fixed now.

There’s now a solid three part workflow to pipenv, as there should be:

- If you want to change the dependencies of a project, you use pipenv
  install/uninstall or edit Pipfile
- When you want to crystallize those dependencies and check in, you use pipenv
  lock to generate the lockfile
- When you want to install the dependencies, as in when you checkout from scm,
  you use pipenv sync

* feat(api): Add error checking on generated labware def (#2476)

* refactor(components): Add AlertModal header icon override (#2508)

* refactor(app): Allow ConnectionCard to connect to unsecured networks (#2504)

Closes #2383, closes #2348

* feat(api): Add ability to save new delta from calibrating labware (#2503)

* feat(protocol-designer): add tooltip for labware name/type on steplist (#2497)

Because of the cramped space on the step list, it is often the case that the labware name is
truncated. For enhanced context, this adds a tooltip that launches on hover of the labware name and
displays the full name and labware type. Also create interface for tooltips to render into a given portal.

Closes #2421

* fix(protocol-designer): fix localization refactor mistakes (#2499)

* feat(api): Use deck-absolute coords in hardware_control (#2502)

* refactor(api): Move robot_configs.py to config
* feat(api): hardware_control uses deck absolute coordinates

Closes #2238

* fix(api): Make the Makefile have more real prerequisites/targets (#2510)

* fix(api): Make the Makefile have more real prerequisites/targets

Instead of using all phony targets, the makefile now pulls the version out of
package.json so it can find the name of the wheel that will be built and can use
it as a normal Makefile target. Then, we can use that as the prereq for wheel
instead of having wheel contain the commands directly, which means that all the
stuff that now depends on wheel won’t rerun it every single time it’s called.

* fix(api): Write .env with absolute path for conf on make install (#2500)

The old checked-in .env had a relative path into tests/ for the development
index.json file that drives settings. This makes it impossible to import
opentrons from outside the api directory. One way to fix this would be to add correct, sane, and not duplicated
logic to the way we load settings; another is to write the .env and the
index.json with absolute paths when you run make install.

Also, this fixes an issue where ‘make local-install’ worked on appveyor (because
appveyor uses mingw make) but doesn’t work on other dev setups that install make
using e.g. chocolatey into the windows shell or powershell, which do not do
wildcard expansion.

Also, a mkdir in discovery-client needs to be shx

Closes #2495

* feat(protocol-designer): use formik for liquid edit form (#2512)

* use formik + yup for liquid edit form
* also add instructional content to liquids page

Closes #2460

* feat(api): Clear labware calibrations in new labware system (#2513)

Closes #2276

* fix(repo): increase flow merge timeout (#2514)

attempt to fix timeout in Travis by increasing flow merge timeout from 100s to 300s

* refactor(app): Add WPA2 personal auth modal to new connection UI (#2515)

Closes #2507

* refactor(api): refactor aspirate/dispense (#2481)

Closes #2235

* feat(protocol-designer): replace liquid placement form (#2518)

* implement new simpler liquid placement form
* remove old IngredientPropertiesForm

Closes #2429

* feat(protocol-designer): allow user to delete entire liquid groups (#2524)

* refactor liquid deletion actions/reducers
* show confirmation modal when deleting a liquid that was placed on the deck

Closes #2437

* feat(app): Show all labware of same type as confirmed (#2525)

Closes #2523

* feat(protocol-designer): implement "clear wells" button (#2528)

Closes #2430

* refactor(app): Match wifi dropdown styles to design (#2522)

* feature(api): pipette critical points (#2526)

* refactor(api): Move pipette state in hardware_control to single file

* feat(api): Add critical point tracking to hardware control

The hardware control API now tracks whether a pipette has a tip or not and
considers its "critical point", the point moved in a move command, to be either
the end of the tip, the end of the nozzle, or the mount depending on the status
of the pipette.

Closes #2239

* feat(protocol-designer): liquid tooltips on well selection, popper and portal (#2521)

Add functionality to allow users to view contents of wells on hover via a tooltip while selecting
wells to dispense or aspirate from/to in the step forms. To allow reliable positioning of tooltips
in the future, these targets and references are placed inside portals that render them at the page
level, unbound by any intermediate DOM element and the possibility of overly cascading styles. We
can now mend the edge case rendering of large tooltips that exceed the viewport by tapping into the
geometry calculations that Popper uses to flip and reposition if close to boundaries.

Closes #2487

* fix(api): Correct GET /wifi/keys response to match documentation (#2532)

* refactor(app): Support 802.1X networks in new Wi-Fi form (#2527)

Closes #2412, closes #2413

* fix(shared-data): Fix corner offset from slot logic; add in container offset to well coordinates (#2519)

* feat(protocol-designer): continue to liquids not design page (#2539)

Closes #2534

* fix(protocol-designer): close liquid placement form when clear wells is clicked (#2533)

Related to #2528

* refactor(app): Move react-select into generic SelectField component (#2543)

* fix(protocol-designer): fix LiquidPlacementForm onBlur typo (#2546)

* fix onBlur typo in LiquidPlacementForm - this makes it so you see errors before clicking "save"

* fix(protocol-designer): do not add __air__ on blowout (#2545)

Closes #2498

* fix(api): Fix height of p1000 tip rack definition (#2547)

Increase height of p1000 tip rack to 101 and remove unsupported definitions left over from OT1

* feat(protocol-designer): add 4-in-1 15-50 tuberack to PD (#2530)

* rename existing tuberack
* add 'opentrons-tuberack-15_50ml'
* include labware diagram images in protocol-designer src and include in bundle.js as data URLs, instead of just linking to docs.opentrons.com/_images/

Closes #2453

* chore(release): 3.5.0 (#2554)

* chore(release): 3.5.0

* fixup: Update app-shell release notes

* fix(app): Show the correct release notes for robot update (#2560)

* refactor(api): Add a back-compat shim for ways of accessing wells (#2561)

* refactor(api): Add a back-compat shim for ways of accessing wells in a labware

* refactor(app): Add validation to network auth forms (#2559)

closes #2416

* Release 3.5.1 (#2571)

* fix(build): Root package.json needs new api workspace path

* chore(release): 3.5.1

* fix(api): Fix bug where drop-tip current is not used while actually dropping tip (#2572)

* API: hardware_control/protocol api integration (#2573)

* refactor(api): Allow specification of instruments after init

We can now pass "expected instruments" into hardware_control.cache_instruments.
This lets us fail fast if the hardware layout does not match the requested
instruments and also lets the simulator adapt to the requested instruments.

* refactor(api): Add retract() to hardware_control

This is used for protocol-api level motion to ensure the pipette that is not
actively under control does not collide with labware on the deck.

* build(js): Upgrade webpack and consolidate build configuration (#2568)

* feat(docs): Add opentrons container defs and images (#2531)

* feat(protocol-designer): collapse all step items on newly loaded file (#2549)

Closes #2541

* feat(api): Pipette id included in GET /pipettes (#2564)

* feat(api): Pipette id included in GET /pipettes

Closes #2148

* refactor(api): add blow_out, pick_up_tip, drop_tip (#2578)

Closes #2483

* refactor(app): Enable certificate usage with 802.1x (#2576)

* feat(api): support offset in json protocol touch-tip command (#2566)

* update step-generation & JSON schema to support new optional field
* add default-values param for touch-tip offset

* API: Add motion to protocol API (#2577)

* refactor(api): Split out protocol_api.__init__ to submodules

This file was getting a bit out of hand and promising to get much worse.

The context classes are now in contexts and the deck is in geometry. Other
geometry-related, context-free utilities should be placed there as well.

* refactor(api): Add instrument load, aspirate, dispense to protocol_api

Closes #2243

* refactor(components): Update error and caption styles (#2580)

* refactor(api): add calibrate_plunger (#2584)

* feat(protocol-designer): add labware details card (#2490)

* add labware details card component & container
* add EditableTextField component
* remove old LabwareNameEditForm and its reducers + actions + selectors
* replace overly-imperative MODIFY_CONTAINER action with RENAME_LABWARE action
* (components) modify type of InputField's units to be Node, not just string

Closes #2428

* feat(app): Home pipette after tip probe confirmed (#2586)

closes #2544

* refactor(app): Allow user to specify wifi security type if unknown (#2581)

Closes #2553

* refactor(app): Reorganize ConnectForm to support hidden SSIDs (#2594)

Closes #2182

* refactor(api): Change motion target locations and add arcs (#2598)

* refactor(api): Change motion target locations and add arcs

The motion commands in the protocol API take a new type, Location, which has a
reference to a labware or well it is related to. This labware or well is used by
a new function, geometry.plan_arc, to break down individual motion commands into
either arc or direct moves depending on if the target is in the same well or
labware as the target of the last move.

In addition, change the Well class position accessors (top(), bottom(),
center()) to return a Location instead of just a Point, and build Wells with
references to their parent Labwares.

* refactor(protocol-designer): gate timeline generation with form and field validation (#2574)

Consolidate step error logic to formLevel and fieldLevel error getters. Remove error block from
stepFormToArgs functions. Clean up hydration pathways.

* feat(protocol-designer): add well tooltip to liquid placement modal (#2550)

Use the existing WellTooltip component in the LiquidPlacementModal. Note: this does not include
refactoring and deprecating stale redux connections in the SelectablePlate component, so UI
performance is still stifled.

Closes #2486

* API: consolidate motion functions and fix some small design issues (#2606)

* refactor(api): aspirate and dispense can be given wells as position

You can now do aspirate(2.0, lw.wells()[0]) instead of aspirate(2.0, lw.wells()[0].top()).

* refactor(api): hardware_control handles retracting the last mount

The protocol api now always refreshes its location cache with the gantry
position for the specified mount to catch moves made either automatically by the
hardware control (like a retract) or a user.

* refactor(api): Check moves for oob in hardware control (#2612)

Hardware control now checks that incoming gantry moves are in acceptable bounds.
That means less than the home position and > 0, for XYZA. If the move is outside
bounds, hardware_control raises a RuntimeError.

This bounds checking is applied in deck coordinates after the mount offset and
critical points are applied, which means that top level move calls may succeed
or fail based on the state of the rest of the system. For instance, with no
pipette attached to the right mount, move_to(RIGHT, Point(50, 50, 0)) will
fail (because the mount on its own cannot descend to 0); but with a P300 single
with tip attached in the right mount, that move will move the end of the tip to
the deck.

* fix(api): Correct well ordering for custom labware (#2633)

Fixes #2631

* feat(app): Implement new connectivity card (#2608)

Closes #2555

* feat(protocol-designer): add more labware options to PD (#2634)

* add 48-well-plate
* remove 24-vial-rack; clarify 0.2mL PCR strip name
* fix labware typo in API docs

Closes #2583

* feat(shared-data): support unversioned pipettes in JSON protocols (#2605)

* separate name-level vs model-level pipette specs in shared-data
* support unversioned pipettes in JSON protocol execution in Python API
* drop versioning from PD (strip out from loaded files)
* update Run App to use new shared-data getters
* Python API loads newly-split pipettes config
* rename nominalMaxVolume to maxVolume
* rename aspirateFlowRate to defaultAspirateFlowRate (same for dispenseFlowRate)

* add JSON schemas and consistency checks for pipette data
* remove underscore from _retrieve_version_number fn
* add README for pipette data

* for backwards compatibility, always include 'model' field with hard-coded "_v1.3" suffix in JSON protocols, in addition to 'name'

* refactor(api): tiplength from tiprack (#2637)

* refactor(api): Make pipette get tip length from tip rack

* Sneaky key combo for hidden step reordering feature (#2575)

* implement Alt-Up / Alt-Down key combos to reorder steps

* feat(protocol-designer): clean up navigation and modal hierarchy (#2638)

Partition views within tabs, so that forms and modals do not appear outside of their home tab.
Properly restrict tab navigation, when in blocking state(e.g. analytics modal, splash). Preserve
form state when navigating between liquids and design tabs.

Closes #2198

* feat(protocol-designer): allow user to change pipette selection (#2548)

Instead of locking users into their initial pipette selection, we now allow users to select and
change their pipette while designing their protocol. In the best case, the change will happen
silently and will not effect the protocol at all. In the worst case, changing pipettes might require
users fixing invalidated parts of many affected steps and adding more tipracks to accommodate the
change.

Closes #2474, #2475, #2477, #2632

* build(webpack): Add cache-busting to default bundle.js output filename (#2643)

* style(js): Re-enable indent and prop-type lint rules  (#2585)

* feat(app): Track restart status in discovery state for better alerts (#2639)

Closes #2516

* fix(protocol-designer): add vertical spacing back to form fields (#2644)

Fix the field spacing regression introduced in #2580

Closes #2597
  • Loading branch information
b-cooper committed Nov 8, 2018
1 parent b3f4b45 commit 644944a
Show file tree
Hide file tree
Showing 762 changed files with 32,689 additions and 13,306 deletions.
17 changes: 14 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,32 @@ module.exports = {
'camelcase': 'off',
'comma-dangle': ['error', 'always-multiline'],
'flowtype/delimiter-dangle': ['error', 'always-multiline'],
// TODO(mc, 2018-09-04): enable this rule and fix lint failures
'react/prop-types': 'off',
},

globals: {},

env: {
node: true,
browser: true,
jest: true,
},

settings: {
react: {
version: '16.2',
},
},

overrides: [
{
files: [
'**/test/**.js',
'**/test-with-flow/**.js',
'**/__tests__/**.js',
'**/__mocks__/**.js',
],
env: {
jest: true,
},
},
],
}
1 change: 1 addition & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ update-server/.*
[options]
module.name_mapper='^default\-containers\.json$' -> '@opentrons/components/interfaces/default-containers.json.js'
module.name_mapper.extension='css' -> '@opentrons/components/interfaces/CSSModule.js'
merge_timeout=300

[strict]
4 changes: 3 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Set the default behavior, in case people don't have core.autocrlf set.
* text=auto
api/opentrons/resources/smoothie*.hex -text
# These files are binary and line endings should be left untouched
*.hex binary
*.bat binary
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,15 @@ venv/
env/
.env/

# Generated files for local API server config paths
api/.env
api/index.json

# MyPy caches
.mypy_cache

build/
!app-shell/build
api/docs/build/
develop-eggs/
dist/
Expand Down Expand Up @@ -78,8 +83,10 @@ target/

# Testing
api/tests/opentrons/data/configs/
api/tests/opentrons/data/labware-def/
api/opentrons/config/*.json
sample_protocol.py
api/opentrons/server/endpoints/ignore.json

# Local Calibration Data
calibrations/
Expand Down
8 changes: 5 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ matrix:

- os: osx
language: generic
if: type != pull_request AND (tag IS present OR branch IN (master, edge))
if: |
type != pull_request AND \
(tag IS present OR branch =~ ^(edge|release_.+)$)
env:
LINT=false
BUILD_APP=true
Expand Down Expand Up @@ -57,8 +59,8 @@ script:
- make test
- make coverage
- if [[ $LINT = true ]]; then make lint; fi
- if [[ $BUILD_COMPONENTS = true ]]; then make -C components build; fi
- if [[ $BUILD_PD = true ]]; then make -C protocol-designer build; fi
- if [[ $BUILD_COMPONENTS = true ]]; then make -C components; fi
- if [[ $BUILD_PD = true ]]; then make -C protocol-designer; fi
- if [[ $BUILD_APP = true ]]; then make -C app-shell dist-$APP_OS_TARGET; fi
- if [[ $BUILD_API_DOCS = true ]]; then (make -C api docs > /dev/null); fi

Expand Down
136 changes: 136 additions & 0 deletions CHANGELOG.md

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@ install: install-py install-js

.PHONY: install-py
install-py:
$(OT_PYTHON) -m pip install pipenv==11.6.8
$(OT_PYTHON) -m pip install pipenv==2018.10.9
$(MAKE) -C $(API_DIR) install
$(MAKE) -C $(UPDATE_SERVER_DIR) install

# front-end dependecies handled by yarn
.PHONY: install-js
install-js:
yarn
$(MAKE) -C $(SHARED_DATA_DIR) build
$(MAKE) -C $(DISCOVERY_CLIENT_DIR)
$(MAKE) -j 1 -C $(SHARED_DATA_DIR)
$(MAKE) -j 1 -C $(DISCOVERY_CLIENT_DIR)

# uninstall all project dependencies
# TODO(mc, 2018-03-22): API uninstall via pipenv --rm in api/Makefile
Expand Down
13 changes: 13 additions & 0 deletions __mocks__/setup-mock-globals.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// sets up a mock global available to all tests
'use strict'

const mockElectron = require('./electron')

global.APP_SHELL = {
__mockElectron: mockElectron,
ipcRenderer: mockElectron.ipcRenderer,
apiUpdate: mockElectron.remote.require('./api-update'),
config: mockElectron.remote.require('./config'),
discovery: mockElectron.remote.require('./discovery'),
update: mockElectron.remote.require('./update'),
}
15 changes: 7 additions & 8 deletions api/.coveragerc
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
[run]
omit =
*/python?.?/*
*/lib-python/?.?/*.py
*/lib_pypy/_*.py
*/site-packages/ordereddict.py
*/site-packages/nose/*
*/tests/*
opentrons/_version.py
include =
*/site-packages/opentrons/*

[paths]
source =
src/opentrons
*/site-packages/opentrons
1 change: 0 additions & 1 deletion api/.env

This file was deleted.

11 changes: 3 additions & 8 deletions api/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
include opentrons/package.json
include opentrons/config/containers/default-containers.json
include opentrons/config/smoothie/smoothie-defaults.ini
include opentrons/config/smoothie/config_one_pro_plus
include opentrons/config/modules/avrdude.conf
include opentrons/config/modules/95-opentrons-modules.rules
include opentrons/config/pipette-config.json
recursive-include opentrons/resources *
include src/opentrons/package.json
graft src/opentrons/config
graft src/opentrons/resources
92 changes: 63 additions & 29 deletions api/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,47 +3,79 @@
SHELL := /bin/bash

# add yarn CLI dev deps to PATH (for cross platform POSIX commands via shx)
# and also make an explicit version for shx for use in the shell function,
# where PATH won’t be propagated
PATH := $(shell cd .. && yarn bin):$(PATH)
SHX := npx shx

# make push wheel file (= rather than := to expand at every use)
wheel = $(wildcard dist/*.whl)
firmware = $(wildcard smoothie/*.hex)

# python and pipenv config
python := pipenv run python
pip := pipenv run pip
pytest := pipenv run py.test
pipenv_opts := --dev
pipenv_opts += $(and $(CI),--ignore-pipfile)
pipenv_opts += $(and $(CI),--keep-outdated)

# Find the version of the wheel from package.json using a helper script. We
# use python here so we can use the same version normalization that will be
# used to create the wheel.
wheel_file = dist/opentrons-$(shell $(python) build_tools.py normalize_version)-py2.py3-none-any.whl
wheel_pattern := dist/opentrons-%-py2.py3-none-any.whl

# These variables can be overriden when make is invoked to customize the
# behavior of pytest. For instance,
# make test tests=tests/opentrons/tools/test_qc_scripts.py would run only the
# specified test
tests ?= tests
test_opts ?=

# Source discovery
# For the python sources
ot_py_sources := $(filter %.py,$(shell $(SHX) find src/opentrons/))
# And the out of tree shared data
ot_shared_data_sources := $(filter %.json,$(shell $(SHX) find ../shared-data/))
# And the arbitrary stuff in resources
ot_resources := $(filter %,$(shell $(SHX) find src/opentrons/resources))
ot_sources := $(ot_py_sources) $(ot_shared_data_sources) $(ot_resources)

# Defined separately than the clean target so the wheel file doesn’t have to
# depend on a PHONY target
clean_cmd = shx rm -rf build dist .coverage coverage.xml '*.egg-info' '**/__pycache__' '**/*.pyc'

.PHONY: install
install:
pipenv install $(pipenv_opts)
pipenv sync $(pipenv_opts)
@$(python) build_tools.py write_local_env

.PHONY: all
all: lint test

.PHONY: clean
clean:
shx rm -rf \
build \
dist \
.coverage \
coverage.xml \
'*.egg-info' \
'**/__pycache__' \
'**/*.pyc'
$(clean_cmd)

$(wheel_pattern): setup.py $(ot_sources)
$(clean_cmd)
$(python) setup.py bdist_wheel
shx rm -rf build
shx ls dist

.PHONY: wheel
wheel: $(wheel_file)

.PHONY: test
test:
$(python) -m pytest \
--cov=opentrons \
--cov-report term-missing:skip-covered \
--cov-report xml:coverage.xml \
tests
test: local-install
$(pytest) $(tests) $(test_opts)

.PHONY: lint
lint:
-$(python) -m mypy opentrons
$(python) -m pylama opentrons tests
lint: $(ot_py_sources)
$(python) -m mypy src/opentrons
$(python) -m pylama src/opentrons tests

.PHONY: docs
docs:
docs: local-install
pipenv run sphinx-build -b html -d docs/build/doctrees docs/source docs/build/html
pipenv run sphinx-build -b doctest -d docs/build/doctrees docs/source docs/build/doctest
shx mkdir -p docs/dist
Expand All @@ -55,20 +87,22 @@ publish:

.PHONY: dev
dev: export ENABLE_VIRTUAL_SMOOTHIE := true
dev:
$(python) opentrons/main.py -P 31950
dev: local-install
$(python) -m opentrons.main -P 31950

.PHONY: wheel
wheel: clean
$(python) setup.py bdist_wheel
shx rm -rf build
shx ls dist
.PHONY: local-install
local-install: wheel
$(pip) install --ignore-installed --no-deps $(wildcard dist/opentrons-*.whl)

.PHONY: local-shell
local-shell: local-install
pipenv shell

.PHONY: push
push: wheel
curl -X POST \
-H "Content-Type: multipart/form-data" \
-F "whl=@$(wheel)" \
-F "whl=@$(wildcard dist/opentrons-*.whl)" \
http://$(host):31950/server/update

.PHONY: flash
Expand Down
1 change: 0 additions & 1 deletion api/Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,4 @@ mypy = "*"

[packages]

"e1839a8" = {path = ".", editable = true}
pytest = "*"
7 changes: 7 additions & 0 deletions api/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,10 @@ Below is a short protocol that will pick up a tip and use it to move 100ul volum
p300.dispense(plate[i + 1])
p300.return_tip()
Using This Repo Outside Of A Robot
----------------------------------

The code in this subdirectory can be used outside of a robot to check protocols; however, because the code requires extra shared data files and dependencies, you cannot simply run a python interpreter.

To use the opentrons API locally, please run ``make install`` to set up your system. Then, running ``make local-shell`` will give you a shell with the opentrons module all set up and ready to be imported.
64 changes: 64 additions & 0 deletions api/build_tools.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
""" Tools to bridge the Makefile and the python build environment
(or provide utilities)
"""

import argparse
import json
import os

# Pipenv requires setuptools >= 36.2.1. Since 36.2.1, setuptools changed
# the way they vendor dependencies, like the packaging module that
# provides the way to normalize version numbers for wheel file names. So
# we try all the possible ways to find it.
try:
# new way
from setuptools.extern import packaging
except ImportError:
# old way
from pkg_resources.extern import packaging


def normalize_version():
pkg_json_path = os.path.join('src', 'opentrons', 'package.json')
old_ver = json.load(open(pkg_json_path))['version']
vers_obj = packaging.version.Version(old_ver)
return str(vers_obj)


def write_local_env():

here = os.getcwd()

with open('./.env', 'w') as dotenv:
dotenv.write('OVERRIDE_SETTINGS_DIR={}'.format(here))

shared_data = os.path.join(here, os.pardir, 'shared-data')
test_data = os.path.join(here, 'tests', 'opentrons', 'data')
local_index = {
"labware": {
"baseDefinitionDir": os.path.join(shared_data, 'definitions'),
"userDefinitionDir": os.path.join(test_data, 'labware-def',
'definitions'),
"offsetDir": os.path.join(test_data, 'labware-def', 'offsets')
},
"pipetteConfigFile": os.path.join(shared_data, 'robot-data',
'pipette-config.json'),
"featureFlagFile": os.path.join(shared_data, 'settings.json'),
"deckCalibrationFile": os.path.join(test_data,
'configs',
'deckCalibration.json'),
"robotSettingsFile": os.path.join(test_data, 'configs',
'robotSettings.json')
}

with open('./index.json', 'w') as index:
index.write(json.dumps(local_index))


if __name__ == '__main__':
parser = argparse.ArgumentParser(
description='Perform one of several build-time tasks')
parser.add_argument(dest='task', metavar='TASK', type=str,
choices=['normalize_version', 'write_local_env'])
args = parser.parse_args()
print(locals()[args.task]())
2 changes: 2 additions & 0 deletions api/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fixes:
-"src/opentrons/"::"opentrons/"
8 changes: 4 additions & 4 deletions api/docs/source/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ Robot

All protocols are set up, simulated and executed using a Robot class.

.. autoclass:: Robot
.. autoclass:: opentrons.legacy_api.robot.Robot
:members: connect, home, reset, run, simulate, commands, move_to, disconnect, head_speed, pause, resume, stop, get_warnings, add_instrument, get_motor

Pipette
-----------------

.. module:: opentrons.instruments
.. module:: opentrons.legacy_api.instruments

.. autoclass:: Pipette
:members: aspirate, dispense, mix, delay, drop_tip, blow_out, touch_tip, pick_up_tip, return_tip, move_to, home, set_flow_rate
.. autoclass:: opentrons.legacy_api.instruments.Pipette
:members: aspirate, dispense, mix, delay, drop_tip, blow_out, touch_tip, pick_up_tip, return_tip, transfer, distribute, consolidate, move_to, home, set_flow_rate
Binary file added api/docs/source/img/labware_lib/15x15mL_ISO.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added api/docs/source/img/labware_lib/15x15mL_TOP.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added api/docs/source/img/labware_lib/24x1.5mL_ISO.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added api/docs/source/img/labware_lib/24x1.5mL_TOP.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added api/docs/source/img/labware_lib/6x50mL_ISO.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added api/docs/source/img/labware_lib/6x50mL_TOP.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 644944a

Please sign in to comment.