Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
laurencap committed Nov 7, 2023
1 parent 2245cbb commit 9db12d5
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 12 deletions.
3 changes: 0 additions & 3 deletions src/braket/experimental/autoqasm/operators/comparisons.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 0 additions & 3 deletions src/braket/experimental/autoqasm/operators/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""
Expand Down
2 changes: 1 addition & 1 deletion src/braket/experimental/autoqasm/program/program.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 5 additions & 5 deletions src/braket/experimental/autoqasm/types/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)

0 comments on commit 9db12d5

Please sign in to comment.