From 9db12d576cc738d02839f5d08f5d3f18eba103f9 Mon Sep 17 00:00:00 2001 From: Lauren Capelluto Date: Tue, 7 Nov 2023 17:08:39 -0500 Subject: [PATCH] lint --- .../experimental/autoqasm/operators/comparisons.py | 3 --- src/braket/experimental/autoqasm/operators/utils.py | 3 --- src/braket/experimental/autoqasm/program/program.py | 2 +- src/braket/experimental/autoqasm/types/types.py | 10 +++++----- 4 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/braket/experimental/autoqasm/operators/comparisons.py b/src/braket/experimental/autoqasm/operators/comparisons.py index ce98a7368..e838575fc 100644 --- a/src/braket/experimental/autoqasm/operators/comparisons.py +++ b/src/braket/experimental/autoqasm/operators/comparisons.py @@ -14,11 +14,8 @@ """Operators for comparison operators: <, <=, >, and >=.""" -from collections.abc import Callable from typing import Any, Union -import oqpy.base - from braket.experimental.autoqasm import program from braket.experimental.autoqasm import types as aq_types diff --git a/src/braket/experimental/autoqasm/operators/utils.py b/src/braket/experimental/autoqasm/operators/utils.py index 7e1e7fe05..1a72eaf6c 100644 --- a/src/braket/experimental/autoqasm/operators/utils.py +++ b/src/braket/experimental/autoqasm/operators/utils.py @@ -25,9 +25,6 @@ def _convert_parameters(*args: list[FreeParameter]) -> list[aq_types.FloatVar]: FloatVars are more compatible with the program conversion operations. - Args: - args (list[FreeParameter]): FreeParameter objects. - Returns: list[FloatVar]: FloatVars for program conversion. """ diff --git a/src/braket/experimental/autoqasm/program/program.py b/src/braket/experimental/autoqasm/program/program.py index b98e30811..82ec9d008 100644 --- a/src/braket/experimental/autoqasm/program/program.py +++ b/src/braket/experimental/autoqasm/program/program.py @@ -333,7 +333,7 @@ def register_parameter(self, parameter: FreeParameter) -> None: Only floats are currently supported. Args: - parameter (Freeparameter): The parameter to register with the program. + parameter (FreeParameter): The parameter to register with the program. """ if parameter.name not in self._free_parameters: self._free_parameters[parameter.name] = oqpy.FloatVar("input", name=parameter.name) diff --git a/src/braket/experimental/autoqasm/types/types.py b/src/braket/experimental/autoqasm/types/types.py index 25048b7cd..06e7f5b7d 100644 --- a/src/braket/experimental/autoqasm/types/types.py +++ b/src/braket/experimental/autoqasm/types/types.py @@ -68,14 +68,14 @@ def __init__(self, *args, **kwargs): "Arrays may only be declared at the root scope of an AutoQASM main function." ) super(ArrayVar, self).__init__(*args, **kwargs) - if not "name" in kwargs: + if "name" not in kwargs: self.name = program.get_program_conversion_context().next_var_name(oqpy.ArrayVar) class BitVar(oqpy.BitVar): def __init__(self, *args, **kwargs): super(BitVar, self).__init__(*args, **kwargs) - if not "name" in kwargs: + if "name" not in kwargs: self.name = program.get_program_conversion_context().next_var_name(oqpy.BitVar) if self.size: value = self.init_expression or 0 @@ -85,19 +85,19 @@ def __init__(self, *args, **kwargs): class BoolVar(oqpy.BoolVar): def __init__(self, *args, **kwargs): super(BoolVar, self).__init__(*args, **kwargs) - if not "name" in kwargs: + if "name" not in kwargs: self.name = program.get_program_conversion_context().next_var_name(oqpy.BoolVar) class FloatVar(oqpy.FloatVar): def __init__(self, *args, **kwargs): super(FloatVar, self).__init__(*args, **kwargs) - if not "name" in kwargs: + if "name" not in kwargs: self.name = program.get_program_conversion_context().next_var_name(oqpy.FloatVar) class IntVar(oqpy.IntVar): def __init__(self, *args, **kwargs): super(IntVar, self).__init__(*args, **kwargs) - if not "name" in kwargs: + if "name" not in kwargs: self.name = program.get_program_conversion_context().next_var_name(oqpy.IntVar)