Skip to content

Commit

Permalink
Indentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
SyntaxColoring committed Aug 6, 2024
1 parent ccfe399 commit 85a30d9
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 63 deletions.
74 changes: 37 additions & 37 deletions api/src/opentrons/execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,23 +142,23 @@ def get_protocol_api(
When this function is called, modules and instruments will be recached.
:param version: The API version to use. This must be lower than
``opentrons.protocol_api.MAX_SUPPORTED_VERSION``.
It may be specified either as a string (``'2.0'``) or
as a ``protocols.types.APIVersion``
(``APIVersion(2, 0)``).
``opentrons.protocol_api.MAX_SUPPORTED_VERSION``.
It may be specified either as a string (``'2.0'``) or
as a ``protocols.types.APIVersion``
(``APIVersion(2, 0)``).
:param bundled_labware: If specified, a mapping from labware names to
labware definitions for labware to consider in the
protocol. Note that if you specify this, _only_
labware in this argument will be allowed in the
protocol. This is preparation for a beta feature
and is best not used.
labware definitions for labware to consider in the
protocol. Note that if you specify this, _only_
labware in this argument will be allowed in the
protocol. This is preparation for a beta feature
and is best not used.
:param bundled_data: If specified, a mapping from filenames to contents
for data to be available in the protocol from
:py:obj:`opentrons.protocol_api.ProtocolContext.bundled_data`.
for data to be available in the protocol from
:py:obj:`opentrons.protocol_api.ProtocolContext.bundled_data`.
:param extra_labware: A mapping from labware load names to custom labware definitions.
If this is ``None`` (the default), and this function is called on a robot,
it will look for labware in the ``labware`` subdirectory of the Jupyter
data directory.
If this is ``None`` (the default), and this function is called on a robot,
it will look for labware in the ``labware`` subdirectory of the Jupyter
data directory.
:return: The protocol context.
"""
if isinstance(version, str):
Expand Down Expand Up @@ -313,18 +313,18 @@ def execute(
:param protocol_file: The protocol file to execute
:param protocol_name: The name of the protocol file. This is required
internally, but it may not be a thing we can get
from the protocol_file argument.
internally, but it may not be a thing we can get
from the protocol_file argument.
:param propagate_logs: Whether this function should allow logs from the
Opentrons stack to propagate up to the root handler.
This can be useful if you're integrating this
function in a larger application, but most logs that
occur during protocol simulation are best associated
with the actions in the protocol that cause them.
Default: ``False``
Opentrons stack to propagate up to the root handler.
This can be useful if you're integrating this
function in a larger application, but most logs that
occur during protocol simulation are best associated
with the actions in the protocol that cause them.
Default: ``False``
:param log_level: The level of logs to emit on the command line:
``"debug"``, ``"info"``, ``"warning"``, or ``"error"``.
Defaults to ``"warning"``.
``"debug"``, ``"info"``, ``"warning"``, or ``"error"``.
Defaults to ``"warning"``.
:param emit_runlog: A callback for printing the run log. If specified, this
will be called whenever a command adds an entry to the
run log, which can be used for display and progress
Expand Down Expand Up @@ -353,17 +353,17 @@ def execute(
``KeyError``.
:param custom_labware_paths: A list of directories to search for custom labware.
Loads valid labware from these paths and makes them available
to the protocol context. If this is ``None`` (the default), and
this function is called on a robot, it will look in the ``labware``
subdirectory of the Jupyter data directory.
Loads valid labware from these paths and makes them available
to the protocol context. If this is ``None`` (the default), and
this function is called on a robot, it will look in the ``labware``
subdirectory of the Jupyter data directory.
:param custom_data_paths: A list of directories or files to load custom
data files from. Ignored if the apiv2 feature
flag if not set. Entries may be either files or
directories. Specified files and the
non-recursive contents of specified directories
are presented by the protocol context in
``ProtocolContext.bundled_data``.
data files from. Ignored if the apiv2 feature
flag if not set. Entries may be either files or
directories. Specified files and the
non-recursive contents of specified directories
are presented by the protocol context in
``ProtocolContext.bundled_data``.
"""
stack_logger = logging.getLogger("opentrons")
stack_logger.propagate = propagate_logs
Expand Down Expand Up @@ -457,10 +457,10 @@ def main() -> int:
"""Handler for command line invocation to run a protocol.
:param argv: The arguments the program was invoked with; this is usually
:py:obj:`sys.argv` but if you want to override that you can.
:py:obj:`sys.argv` but if you want to override that you can.
:returns int: A success or failure value suitable for use as a shell
return code passed to :py:obj:`sys.exit` (0 means success,
anything else is a kind of failure).
return code passed to :py:obj:`sys.exit` (0 means success,
anything else is a kind of failure).
"""
parser = argparse.ArgumentParser(
prog="opentrons_execute", description="Run an OT-2 protocol"
Expand Down
51 changes: 25 additions & 26 deletions api/src/opentrons/simulate.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,36 +477,36 @@ def simulate(
:param protocol_file: The protocol file to simulate.
:param file_name: The name of the file
:param custom_labware_paths: A list of directories to search for custom labware.
Loads valid labware from these paths and makes them available
to the protocol context. If this is ``None`` (the default), and
this function is called on a robot, it will look in the ``labware``
subdirectory of the Jupyter data directory.
Loads valid labware from these paths and makes them available
to the protocol context. If this is ``None`` (the default), and
this function is called on a robot, it will look in the ``labware``
subdirectory of the Jupyter data directory.
:param custom_data_paths: A list of directories or files to load custom
data files from. Ignored if the apiv2 feature
flag if not set. Entries may be either files or
directories. Specified files and the
non-recursive contents of specified directories
are presented by the protocol context in
``protocol_api.ProtocolContext.bundled_data``.
data files from. Ignored if the apiv2 feature
flag if not set. Entries may be either files or
directories. Specified files and the
non-recursive contents of specified directories
are presented by the protocol context in
``protocol_api.ProtocolContext.bundled_data``.
:param hardware_simulator_file_path: A path to a JSON file defining a
hardware simulator.
hardware simulator.
:param duration_estimator: For internal use only.
Optional duration estimator object.
Optional duration estimator object.
:param propagate_logs: Whether this function should allow logs from the
Opentrons stack to propagate up to the root handler.
This can be useful if you're integrating this
function in a larger application, but most logs that
occur during protocol simulation are best associated
with the actions in the protocol that cause them.
Default: ``False``
Opentrons stack to propagate up to the root handler.
This can be useful if you're integrating this
function in a larger application, but most logs that
occur during protocol simulation are best associated
with the actions in the protocol that cause them.
Default: ``False``
:param log_level: The level of logs to capture in the run log:
``"debug"``, ``"info"``, ``"warning"``, or ``"error"``.
Defaults to ``"warning"``.
``"debug"``, ``"info"``, ``"warning"``, or ``"error"``.
Defaults to ``"warning"``.
:returns: A tuple of a run log for user output, and possibly the required
data to write to a bundle to bundle this protocol. The bundle is
only emitted if bundling is allowed
and this is an unbundled Protocol API
v2 python protocol. In other cases it is None.
data to write to a bundle to bundle this protocol. The bundle is
only emitted if bundling is allowed
and this is an unbundled Protocol API
v2 python protocol. In other cases it is None.
"""
stack_logger = logging.getLogger("opentrons")
stack_logger.propagate = propagate_logs
Expand Down Expand Up @@ -639,8 +639,7 @@ def get_arguments(parser: argparse.ArgumentParser) -> argparse.ArgumentParser:
Useful if you want to use this module as a component of another CLI program
and want to add its arguments.
:param parser: A parser to add arguments to. If not specified, one will be
created.
:param parser: A parser to add arguments to. If not specified, one will be created.
:returns argparse.ArgumentParser: The parser with arguments added.
"""
parser.add_argument(
Expand Down

0 comments on commit 85a30d9

Please sign in to comment.