Skip to content

Commit

Permalink
EFEFE
Browse files Browse the repository at this point in the history
  • Loading branch information
amit lissack committed Mar 30, 2022
1 parent b834c5a commit 8625a1c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 0 additions & 2 deletions api/src/opentrons/protocols/api_support/labware_like.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,12 @@ def __init__(self, labware_like: WrappableLabwareLike):
self._labware_like = labware_like

@property
@functools.lru_cache(1)
def object(self) -> WrappableLabwareLike:
if isinstance(self._labware_like, LabwareLike):
return self._labware_like.object
return self._labware_like

@property
@functools.lru_cache(1)
def object_type(self) -> LabwareLikeType:
# Import locally to avoid circular dependency
from opentrons.protocol_api.labware import Labware, Well
Expand Down
9 changes: 8 additions & 1 deletion api/src/opentrons/simulate.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import os
import pathlib
import queue
from datetime import datetime
from typing import (
Any,
Dict,
Expand All @@ -29,6 +30,9 @@
)
from opentrons.hardware_control.simulator_setup import load_simulator
from opentrons.protocol_api import MAX_SUPPORTED_VERSION
from opentrons.protocols.context.simulator.protocol_context import (
ProtocolContextSimulation,
)
from opentrons.protocols.duration import DurationEstimator
from opentrons.protocols.execution import execute
import opentrons.broker
Expand Down Expand Up @@ -217,7 +221,8 @@ def _build_protocol_context(
version specification for use with
:py:meth:`.protocol_api.execute.run_protocol`
"""
ctx_impl = ProtocolContextImplementation(
ctx_impl = ProtocolContextSimulation(
# ctx_impl = ProtocolContextImplementation(
bundled_labware=bundled_labware,
bundled_data=bundled_data,
api_version=version,
Expand Down Expand Up @@ -587,6 +592,7 @@ def main() -> int:

duration_estimator = DurationEstimator() if args.estimate_duration else None # type: ignore[no-untyped-call] # noqa: E501

dt = datetime.now()
runlog, maybe_bundle = simulate(
args.protocol,
args.protocol.name,
Expand All @@ -596,6 +602,7 @@ def main() -> int:
hardware_simulator_file_path=getattr(args, "custom_hardware_simulator_file"),
log_level=args.log_level,
)
print(f"TOOK {datetime.now()-dt}")

if maybe_bundle:
bundle_name = getattr(args, "bundle", None)
Expand Down

0 comments on commit 8625a1c

Please sign in to comment.