Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/Qiskit/qiskit-terra into si…
Browse files Browse the repository at this point in the history
…nce-deprecation
  • Loading branch information
Eric-Arellano committed Feb 20, 2023
2 parents 3ec3335 + 041877b commit f4deaa5
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 57 deletions.
89 changes: 38 additions & 51 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ unsafe-load-any-extension=no
# be loaded. Extensions are loading into the active Python interpreter and may
# run arbitrary code
extension-pkg-allow-list=retworkx, numpy, tweedledum, qiskit._accelerate, rustworkx
generated-modules=retworkx.visualization,retwork.visit
ignore-modules=retworkx,retworkx.visualization,retworkx.visit
generated-members=retworkx.visualization,retwork.visit
ignored-modules=retworkx,retworkx.visualization,retworkx.visit

[MESSAGES CONTROL]

Expand All @@ -59,7 +59,6 @@ enable=use-symbolic-message-instead
# no Warning level messages displayed, use"--disable=all --enable=classes
# --disable=W"
disable=spelling, # way too noisy
no-self-use, # disabled as it is too verbose
fixme, # disabled as TODOs would show up as warnings
protected-access, # disabled as we don't follow the public vs private
# convention strictly
Expand All @@ -73,11 +72,41 @@ disable=spelling, # way too noisy
no-else-return, # relax "elif" after a clause with a return
docstring-first-line-empty, # relax docstring style
import-outside-toplevel,
bad-continuation, bad-whitespace, # differences of opinion with black
import-error # overzealous with our optionals/dynamic packages



import-error, # overzealous with our optionals/dynamic packages

# TODO(#9614): these were added in modern Pylint. Decide if we want to enable them. If so,
# remove from here and fix the issues. Else, move it above this section and add a comment
# with the rationale.
arguments-renamed,
broad-exception-raised,
consider-iterating-dictionary,
consider-using-dict-items,
consider-using-enumerate,
consider-using-f-string,
consider-using-from-import,
modified-iterating-list,
nested-min-max,
no-member,
no-value-for-parameter,
non-ascii-name,
not-context-manager,
pointless-exception-statement,
superfluous-parens,
unknown-option-value,
unexpected-keyword-arg,
unnecessary-dict-index-lookup,
unnecessary-direct-lambda-call,
unnecessary-dunder-call,
unnecessary-ellipsis,
unnecessary-lambda-assignment,
unnecessary-list-index-lookup,
unspecified-encoding,
unsupported-assignment-operation,
use-dict-literal,
use-list-literal,
use-implicit-booleaness-not-comparison,
use-maxsplit-arg,
used-before-assignment,

[REPORTS]

Expand All @@ -86,12 +115,6 @@ disable=spelling, # way too noisy
# mypackage.mymodule.MyReporterClass.
output-format=text

# Put messages in a separate file for each module / package specified on the
# command line instead of printing them on stdout. Reports (if any) will be
# written in a file name "pylint_global.[txt|html]". This option is deprecated
# and it will be removed in Pylint 2.0.
files-output=no

# Tells whether to display a full report or only the messages
reports=yes

Expand Down Expand Up @@ -140,63 +163,33 @@ property-classes=abc.abstractproperty
# Regular expression matching correct module names
module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$

# Naming hint for module names
module-name-hint=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$

# Regular expression matching correct constant names
const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$

# Naming hint for constant names
const-name-hint=(([A-Z_][A-Z0-9_]*)|(__.*__))$

# Regular expression matching correct class names
class-rgx=[A-Z_][a-zA-Z0-9]+$

# Naming hint for class names
class-name-hint=[A-Z_][a-zA-Z0-9]+$

# Regular expression matching correct function names
function-rgx=[a-z_][a-z0-9_]{2,30}$

# Naming hint for function names
function-name-hint=[a-z_][a-z0-9_]{2,30}$

# Regular expression matching correct method names
method-rgx=(([a-z_][a-z0-9_]{2,49})|(assert[A-Z][a-zA-Z0-9]{2,43})|(test_[_a-zA-Z0-9]{2,}))$

# Naming hint for method names
method-name-hint=[a-z_][a-z0-9_]{2,30}$ or camelCase `assert*` in tests.

# Regular expression matching correct attribute names
attr-rgx=[a-z_][a-z0-9_]{2,30}$

# Naming hint for attribute names
attr-name-hint=[a-z_][a-z0-9_]{2,30}$

# Regular expression matching correct argument names
argument-rgx=[a-z_][a-z0-9_]{2,30}|ax|dt$

# Naming hint for argument names
argument-name-hint=[a-z_][a-z0-9_]{2,30}$

# Regular expression matching correct variable names
variable-rgx=[a-z_][a-z0-9_]{1,30}$

# Naming hint for variable names
variable-name-hint=[a-z_][a-z0-9_]{1,30}$

# Regular expression matching correct class attribute names
class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$

# Naming hint for class attribute names
class-attribute-name-hint=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$

# Regular expression matching correct inline iteration names
inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$

# Naming hint for inline iteration names
inlinevar-name-hint=[A-Za-z_][A-Za-z0-9_]*$

# Regular expression which should only match function or class names that do
# not require a docstring.
no-docstring-rgx=^_
Expand Down Expand Up @@ -224,12 +217,6 @@ ignore-long-lines=^\s*(# )?<?https?://\S+>?$
# else.
single-line-if-stmt=no

# List of optional constructs for which whitespace checking is disabled. `dict-
# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}.
# `trailing-comma` allows a space between comma and closing bracket: (a, ).
# `empty-line` allows space-only lines.
no-space-check=trailing-comma,dict-separator

# Maximum number of lines in a module
max-module-lines=1000

Expand Down Expand Up @@ -426,4 +413,4 @@ analyse-fallback-blocks=no

# Exceptions that will emit a warning when being caught. Defaults to
# "Exception"
overgeneral-exceptions=Exception
overgeneral-exceptions=builtins.Exception
4 changes: 3 additions & 1 deletion qiskit/opflow/converters/pauli_basis_change.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,9 @@ def get_diagonalizing_clifford(self, pauli: Union[Pauli, PauliOp]) -> OperatorBa
y_to_x_origin = tensorall(
[S if has_y else I for has_y in reversed(np.logical_and(pauli.x, pauli.z))]
).adjoint()
x_to_z_origin = tensorall([H if has_x else I for has_x in reversed(pauli.x)])
x_to_z_origin = tensorall( # pylint: disable=assignment-from-no-return
[H if has_x else I for has_x in reversed(pauli.x)]
)
return x_to_z_origin.compose(y_to_x_origin)

def pad_paulis_to_equal_length(
Expand Down
4 changes: 2 additions & 2 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ matplotlib>=3.3
pillow>=4.2.1
black[jupyter]~=22.0
pydot
astroid==2.5.6
pylint==2.8.3
astroid==2.14.2
pylint==2.16.2
stestr>=2.0.0,!=4.0.0
pylatexenc>=1.4
ddt>=1.2.0,!=1.4.0,!=1.4.3
Expand Down
10 changes: 7 additions & 3 deletions test/python/pulse/test_transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,9 @@ def test_padding_schedule(self):
| Delay(delay, DriveChannel(0))
| Delay(delay, DriveChannel(0)).shift(20)
| Delay(delay, DriveChannel(1))
| Delay(2 * delay, DriveChannel(1)).shift(20)
| Delay( # pylint: disable=unsupported-binary-operation
2 * delay, DriveChannel(1)
).shift(20)
)

self.assertEqual(transforms.pad(sched), ref_sched)
Expand All @@ -294,7 +296,9 @@ def test_padding_schedule_inverse_order(self):
| Delay(delay, DriveChannel(0))
| Delay(delay, DriveChannel(0)).shift(20)
| Delay(delay, DriveChannel(1))
| Delay(2 * delay, DriveChannel(1)).shift(20)
| Delay( # pylint: disable=unsupported-binary-operation
2 * delay, DriveChannel(1)
).shift(20)
)

self.assertEqual(transforms.pad(sched), ref_sched)
Expand All @@ -319,7 +323,7 @@ def test_padding_until_greater(self):
sched
| Delay(delay, DriveChannel(0))
| Delay(30, DriveChannel(0)).shift(20)
| Delay(40, DriveChannel(1)).shift(10)
| Delay(40, DriveChannel(1)).shift(10) # pylint: disable=unsupported-binary-operation
)

self.assertEqual(transforms.pad(sched, until=50), ref_sched)
Expand Down

0 comments on commit f4deaa5

Please sign in to comment.