Skip to content

Commit

Permalink
Run isort.
Browse files Browse the repository at this point in the history
  • Loading branch information
SyntaxColoring committed May 16, 2024
1 parent c829d84 commit e5345be
Show file tree
Hide file tree
Showing 691 changed files with 5,031 additions and 5,535 deletions.
6 changes: 4 additions & 2 deletions api/setup.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
# Inspired by:
# https://hynek.me/articles/sharing-your-labor-of-love-pypi-quick-and-dirty/
import sys
import codecs
import os
import os.path
import sys

from setuptools import find_packages, setup # type: ignore[import-untyped]

HERE = os.path.abspath(os.path.dirname(__file__))
sys.path.append(os.path.join(HERE, "..", "scripts"))

from python_build_utils import normalize_version # type: ignore[import-not-found] # noqa: E402
from python_build_utils import ( # type: ignore[import-not-found] # noqa: E402
normalize_version,
)

# make stdout blocking since Travis sets it to nonblocking
if os.name == "posix":
Expand Down
2 changes: 1 addition & 1 deletion api/src/opentrons/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ def __getattr__(attrname: str) -> None:
# Local imports for performance. This case is not hit frequently, and we
# don't want to drag these imports in any time anything is imported from
# anywhere in the `opentrons` package.
from opentrons.protocols.types import ApiDeprecationError
from opentrons.protocols.api_support.types import APIVersion
from opentrons.protocols.types import ApiDeprecationError

raise ApiDeprecationError(APIVersion(1, 0))
raise AttributeError(attrname)
Expand Down
2 changes: 1 addition & 1 deletion api/src/opentrons/_version.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import sys
import logging
import sys

_pyversion = sys.version_info[0:2]

Expand Down
30 changes: 14 additions & 16 deletions api/src/opentrons/calibration_storage/__init__.py
Original file line number Diff line number Diff line change
@@ -1,32 +1,30 @@
from .ot3 import gripper_offset
from .ot2 import mark_bad_calibration

from . import helpers, ot2, ot3
from .deck_configuration import (
serialize_deck_configuration,
deserialize_deck_configuration,
serialize_deck_configuration,
)
from .ot2 import mark_bad_calibration
from .ot2.deck_attitude import (
delete_robot_deck_attitude,
get_robot_deck_attitude,
save_robot_deck_attitude,
)
from .ot2.pipette_offset import get_all_pipette_offset_calibrations

# TODO these functions are only used in robot server. We should think about moving them and/or
# abstracting it away from a robot specific function. We should also check if the tip rack
# definition information is still needed.
from .ot2.tip_length import (
get_custom_tiprack_definition_for_tlc,
get_all_tip_length_calibrations,
_save_custom_tiprack_definition,
get_all_tip_length_calibrations,
get_custom_tiprack_definition_for_tlc,
)
from .ot2.pipette_offset import get_all_pipette_offset_calibrations
from .ot3 import gripper_offset
from .ot3.deck_attitude import (
save_robot_belt_attitude,
get_robot_belt_attitude,
delete_robot_belt_attitude,
get_robot_belt_attitude,
save_robot_belt_attitude,
)
from .ot2.deck_attitude import (
save_robot_deck_attitude,
get_robot_deck_attitude,
delete_robot_deck_attitude,
)

from . import ot2, ot3, helpers

__all__ = [
"helpers",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

import pydantic

from .types import CutoutFixturePlacement
from . import file_operators as io
from .types import CutoutFixturePlacement


class _CutoutFixturePlacementModel(pydantic.BaseModel):
Expand Down
2 changes: 1 addition & 1 deletion api/src/opentrons/calibration_storage/encoder_decoder.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
""" opentrons.calibration_storage.encoder_decoder: classes that
allow you to customize serialization to/from json.
"""
import json
import datetime
import json
from typing import Any, cast


Expand Down
3 changes: 1 addition & 2 deletions api/src/opentrons/calibration_storage/file_operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@

import pydantic

from .encoder_decoder import DateTimeEncoder, DateTimeDecoder

from .encoder_decoder import DateTimeDecoder, DateTimeEncoder

_log = logging.getLogger(__name__)

Expand Down
6 changes: 2 additions & 4 deletions api/src/opentrons/calibration_storage/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@
labware calibration to its designated file location.
"""
import json
from typing import Any, Union, List, Dict, TYPE_CHECKING, cast, Tuple
from dataclasses import is_dataclass, asdict


from dataclasses import asdict, is_dataclass
from hashlib import sha256
from typing import TYPE_CHECKING, Any, Dict, List, Tuple, Union, cast

from . import types as local_types

Expand Down
14 changes: 5 additions & 9 deletions api/src/opentrons/calibration_storage/ot2/__init__.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
from . import (
models,
mark_bad_calibration,
)
from . import mark_bad_calibration, models
from .pipette_offset import (
save_pipette_calibration,
clear_pipette_offset_calibrations,
get_pipette_offset,
delete_pipette_offset_file,
get_pipette_offset,
save_pipette_calibration,
)

from .tip_length import (
clear_tip_length_calibration,
create_tip_length_data,
delete_tip_length_calibration,
load_tip_length_calibration,
save_tip_length_calibration,
tip_lengths_for_pipette,
load_tip_length_calibration,
delete_tip_length_calibration,
)

__all__ = [
Expand Down
10 changes: 5 additions & 5 deletions api/src/opentrons/calibration_storage/ot2/deck_attitude.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import json
import logging
from pydantic import ValidationError
from typing import Optional, Union
from dataclasses import asdict
from typing import Optional, Union

from pydantic import ValidationError

from opentrons import config
from opentrons.util.helpers import utc_now


from .. import file_operators as io, types as local_types

from .. import file_operators as io
from .. import types as local_types
from .models import v1

log = logging.getLogger(__name__)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
from opentrons.util.helpers import utc_now

from .. import types as local_types

from .models import v1


CalibrationType = typing.TypeVar(
"CalibrationType",
v1.PipetteOffsetCalibration,
Expand Down
7 changes: 3 additions & 4 deletions api/src/opentrons/calibration_storage/ot2/models/v1.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import typing

from typing_extensions import Literal
from pydantic import BaseModel, Field, validator
from datetime import datetime

from opentrons_shared_data.pipette.dev_types import LabwareUri
from pydantic import BaseModel, Field, validator
from typing_extensions import Literal

from opentrons.types import Point
from opentrons.calibration_storage import types
from opentrons.types import Point


class CalibrationStatus(BaseModel):
Expand Down
14 changes: 7 additions & 7 deletions api/src/opentrons/calibration_storage/ot2/pipette_offset.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import json
import typing
import logging
from pydantic import ValidationError
import typing
from dataclasses import asdict

from opentrons import config, types

from .. import file_operators as io, types as local_types

from .models import v1
from pydantic import ValidationError

from opentrons import config, types
from opentrons.types import Mount, Point
from opentrons.util.helpers import utc_now

from .. import file_operators as io
from .. import types as local_types
from .models import v1

log = logging.getLogger(__name__)

# Delete Pipette Offset Calibrations
Expand Down
12 changes: 6 additions & 6 deletions api/src/opentrons/calibration_storage/ot2/tip_length.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import json
import typing
import logging
from pydantic import ValidationError
import typing
from dataclasses import asdict

from opentrons import config

from .. import file_operators as io, helpers, types as local_types
from opentrons_shared_data.pipette.dev_types import LabwareUri
from pydantic import ValidationError

from opentrons import config
from opentrons.protocols.api_support.constants import OPENTRONS_NAMESPACE
from opentrons.util.helpers import utc_now


from .. import file_operators as io
from .. import helpers
from .. import types as local_types
from .models import v1

if typing.TYPE_CHECKING:
Expand Down
22 changes: 10 additions & 12 deletions api/src/opentrons/calibration_storage/ot3/__init__.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
from . import (
models,
gripper_offset as gripper_offset,
)
from .pipette_offset import (
save_pipette_calibration,
clear_pipette_offset_calibrations,
get_pipette_offset,
delete_pipette_offset_file,
)
from . import gripper_offset as gripper_offset
from . import models
from .module_offset import (
save_module_calibration,
clear_module_offset_calibrations,
get_module_offset,
delete_module_offset_file,
get_module_offset,
load_all_module_offsets,
save_module_calibration,
)
from .pipette_offset import (
clear_pipette_offset_calibrations,
delete_pipette_offset_file,
get_pipette_offset,
save_pipette_calibration,
)

__all__ = [
Expand Down
10 changes: 5 additions & 5 deletions api/src/opentrons/calibration_storage/ot3/deck_attitude.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import json
import logging
from pydantic import ValidationError
from typing import Optional, Union, no_type_check
from dataclasses import asdict
from typing import Optional, Union, no_type_check

from pydantic import ValidationError

from opentrons import config
from opentrons.util.helpers import utc_now


from .. import file_operators as io, types as local_types

from .. import file_operators as io
from .. import types as local_types
from .models import v1

log = logging.getLogger(__name__)
Expand Down
11 changes: 5 additions & 6 deletions api/src/opentrons/calibration_storage/ot3/gripper_offset.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
import json
from pydantic import ValidationError
from dataclasses import asdict
from typing import Optional, Union

from pydantic import ValidationError

from opentrons import config, types
from dataclasses import asdict
from opentrons.util.helpers import utc_now


from .. import file_operators as io, types as local_types

from .. import file_operators as io
from .. import types as local_types
from .models import v1


# Delete Gripper Offset Calibrations


Expand Down
11 changes: 5 additions & 6 deletions api/src/opentrons/calibration_storage/ot3/models/v1.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import typing

from typing_extensions import Literal
from opentrons.hardware_control.modules.types import ModuleType
from opentrons.hardware_control.types import OT3Mount
from pydantic import BaseModel, Field, validator
from datetime import datetime

from opentrons_shared_data.pipette.dev_types import LabwareUri
from pydantic import BaseModel, Field, validator
from typing_extensions import Literal

from opentrons.types import Point
from opentrons.calibration_storage import types
from opentrons.hardware_control.modules.types import ModuleType
from opentrons.hardware_control.types import OT3Mount
from opentrons.types import Point


class CalibrationStatus(BaseModel):
Expand Down
14 changes: 7 additions & 7 deletions api/src/opentrons/calibration_storage/ot3/module_offset.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import json
import logging
import os
from dataclasses import asdict
from functools import lru_cache
from pathlib import Path
from opentrons.hardware_control.modules.types import ModuleType
from opentrons.hardware_control.types import OT3Mount
from pydantic import ValidationError
from typing import List, Optional, Union, no_type_check
from dataclasses import asdict

from opentrons import config, types

from pydantic import ValidationError

from .. import file_operators as io, types as local_types
from opentrons import config, types
from opentrons.hardware_control.modules.types import ModuleType
from opentrons.hardware_control.types import OT3Mount
from opentrons.util.helpers import utc_now

from .. import file_operators as io
from .. import types as local_types
from .models import v1

log = logging.getLogger(__name__)
Expand Down
10 changes: 5 additions & 5 deletions api/src/opentrons/calibration_storage/ot3/pipette_offset.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import json
import logging
from pydantic import ValidationError
from typing import Optional, Union, no_type_check
from dataclasses import asdict
from typing import Optional, Union, no_type_check

from opentrons import config, types

from pydantic import ValidationError

from .. import file_operators as io, types as local_types
from opentrons import config, types
from opentrons.util.helpers import utc_now

from .. import file_operators as io
from .. import types as local_types
from .models import v1

log = logging.getLogger(__name__)
Expand Down
Loading

0 comments on commit e5345be

Please sign in to comment.