Skip to content

Commit

Permalink
Merge branch 'edge' into refactor_react-api-client-host-object
Browse files Browse the repository at this point in the history
  • Loading branch information
ncdiehl11 committed May 15, 2024
2 parents e154752 + 643a9dd commit 94800cc
Show file tree
Hide file tree
Showing 675 changed files with 7,301 additions and 2,608 deletions.
1 change: 0 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ module.exports = {
'@typescript-eslint/no-unnecessary-type-assertion': 'warn',
'@typescript-eslint/no-unnecessary-boolean-literal-compare': 'warn',
'@typescript-eslint/no-unsafe-argument': 'warn',
'@typescript-eslint/consistent-type-imports': 'warn',
'@typescript-eslint/consistent-indexed-object-style': 'warn',
'@typescript-eslint/no-confusing-void-expression': 'warn',
'@typescript-eslint/ban-types': 'warn',
Expand Down
2 changes: 1 addition & 1 deletion api-client/src/calibration/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Mount } from '../pipettes'
import type { Mount } from '../pipettes'

export interface PipOffsetDeletionParams {
calType: 'pipetteOffset'
Expand Down
8 changes: 5 additions & 3 deletions api-client/src/modules/api-types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { ModuleType } from '@opentrons/shared-data'

import type { Coordinates, ModuleModel } from '@opentrons/shared-data'
import type {
ModuleType,
Coordinates,
ModuleModel,
} from '@opentrons/shared-data'

type PortGroup = 'main' | 'left' | 'right' | 'front' | 'unknown'
interface PhysicalPort {
Expand Down
6 changes: 2 additions & 4 deletions api-client/src/modules/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,14 @@ import type {
ThermocyclerModuleModel,
MagneticModuleModel,
HeaterShakerModuleModel,
} from '@opentrons/shared-data'

import {
TEMPERATURE_MODULE_TYPE,
MAGNETIC_MODULE_TYPE,
THERMOCYCLER_MODULE_TYPE,
HEATERSHAKER_MODULE_TYPE,
} from '@opentrons/shared-data'

import * as ApiTypes from './api-types'
import type * as ApiTypes from './api-types'

export * from './api-types'

// common types
Expand Down
2 changes: 1 addition & 1 deletion api-client/src/protocols/__tests__/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
} from '../utils'
import { simpleAnalysisFileFixture } from '../__fixtures__'

import { RunTimeCommand } from '@opentrons/shared-data'
import type { RunTimeCommand } from '@opentrons/shared-data'

const mockRunTimeCommands: RunTimeCommand[] = simpleAnalysisFileFixture.commands as any
const mockLoadLiquidRunTimeCommands = [
Expand Down
18 changes: 14 additions & 4 deletions api-client/src/request.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import axios, { AxiosRequestConfig } from 'axios'

import type { Method, AxiosPromise, AxiosResponse } from 'axios'
import Axios from 'axios'

import type {
AxiosRequestConfig,
Method,
AxiosPromise,
AxiosResponse,
} from 'axios'
import type { HostConfig } from './types'

export type ResponsePromise<Data> = AxiosPromise<Data>
Expand All @@ -26,7 +31,12 @@ export function request<ResData, ReqData = null>(
config: HostConfig,
params?: AxiosRequestConfig['params']
): ResponsePromise<ResData> {
const { hostname, port, requestor = axios.request, token } = config
const {
hostname,
port,
requestor = (...args) => Axios.request(...args),
token,
} = config

const tokenHeader = token != null ? { authenticationBearer: token } : {}
const headers = { ...DEFAULT_HEADERS, ...tokenHeader }
Expand Down
2 changes: 1 addition & 1 deletion api-client/src/sessions/createSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { POST, request } from '../request'
import type { ResponsePromise } from '../request'
import type { HostConfig } from '../types'
import type { Session } from './types'
import { SessionType } from '.'
import type { SessionType } from '.'

export interface CreateSessionData {
sessionType: SessionType
Expand Down
1 change: 1 addition & 0 deletions api/Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ opentrons-shared-data = { editable = true, path = "../shared-data/python" }
opentrons = { editable = true, path = "." }
opentrons-hardware = { editable = true, path = "./../hardware", extras=["FLEX"] }
numpy = "==1.22.3"
pyusb = "==1.2.1"

[dev-packages]
# atomicwrites and colorama are pytest dependencies on windows,
Expand Down
201 changes: 45 additions & 156 deletions api/Pipfile.lock

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions api/src/opentrons/drivers/absorbance_reader/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from .abstract import AbstractAbsorbanceReaderDriver
from .driver import AbsorbanceReaderDriver
from .simulator import SimulatingDriver
from .hid_protocol import AbsorbanceHidInterface

__all__ = [
"AbstractAbsorbanceReaderDriver",
"AbsorbanceReaderDriver",
"SimulatingDriver",
"AbsorbanceHidInterface",
]
45 changes: 45 additions & 0 deletions api/src/opentrons/drivers/absorbance_reader/abstract.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
from abc import ABC, abstractmethod
from typing import Dict, List
from opentrons.drivers.types import AbsorbanceReaderLidStatus


class AbstractAbsorbanceReaderDriver(ABC):
@abstractmethod
async def connect(self) -> None:
"""Connect to absorbance reader"""
...

@abstractmethod
async def disconnect(self) -> None:
"""Disconnect from absorbance reader"""
...

@abstractmethod
async def is_connected(self) -> bool:
"""Check connection to absorbance reader"""
...

@abstractmethod
async def get_lid_status(self) -> AbsorbanceReaderLidStatus:
...

@abstractmethod
async def get_available_wavelengths(self) -> List[int]:
...

@abstractmethod
async def get_single_measurement(self, wavelength: int) -> List[float]:
...

@abstractmethod
async def initialize_measurement(self, wavelength: int) -> None:
...

@abstractmethod
async def get_status(self) -> None:
...

@abstractmethod
async def get_device_info(self) -> Dict[str, str]:
"""Get device info"""
...
Loading

0 comments on commit 94800cc

Please sign in to comment.