Skip to content

Commit

Permalink
pylint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
perlinm committed Aug 6, 2024
1 parent 232e524 commit 8c7b8d2
Show file tree
Hide file tree
Showing 21 changed files with 45 additions and 4 deletions.
2 changes: 1 addition & 1 deletion checks/pylint_.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
import checks_superstaq

if __name__ == "__main__":
exit(checks_superstaq.pylint_.run(*sys.argv[1:]))
exit(checks_superstaq.pylint_.run(*sys.argv[1:], exclude="checks/*.py"))
3 changes: 3 additions & 0 deletions experiments/bivariate_bicycle/collect_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
See the License for the specific language governing permissions and
limitations under the License.
"""

from __future__ import annotations

import os

import numpy as np
Expand Down
3 changes: 3 additions & 0 deletions experiments/bivariate_bicycle/run_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
See the License for the specific language governing permissions and
limitations under the License.
"""

from __future__ import annotations

import concurrent.futures
import itertools
import os
Expand Down
3 changes: 3 additions & 0 deletions experiments/quantum_tanner/collect_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
See the License for the specific language governing permissions and
limitations under the License.
"""

from __future__ import annotations

import ast
import glob
import os
Expand Down
3 changes: 3 additions & 0 deletions experiments/quantum_tanner/run_randomized_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
See the License for the specific language governing permissions and
limitations under the License.
"""

from __future__ import annotations

import concurrent.futures
import hashlib
import os
Expand Down
3 changes: 3 additions & 0 deletions experiments/quantum_tanner/verify_codes.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
See the License for the specific language governing permissions and
limitations under the License.
"""

from __future__ import annotations

import functools
import glob
import os
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ enable = [
"no-value-for-parameter",
"nonexistent-operator",
"not-in-loop",
"parameter_documentation",
# "parameter_documentation", # REPO-SPECIFIC CONFIG
"pointless-statement",
"redefined-builtin",
"relative-beyond-top-level",
Expand Down
2 changes: 1 addition & 1 deletion qldpc/abstract.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ class Element:
_group: Group
_vec: collections.defaultdict[GroupMember, galois.FieldArray]

def __init__(self, group: Group, *members: GroupMember):
def __init__(self, group: Group, *members: GroupMember) -> None:
self._group = group
self._vec = collections.defaultdict(lambda: self.field(0))
for member in members:
Expand Down
2 changes: 2 additions & 0 deletions qldpc/abstract_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
limitations under the License.
"""

from __future__ import annotations

import math
import unittest.mock

Expand Down
2 changes: 2 additions & 0 deletions qldpc/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
limitations under the License.
"""

from __future__ import annotations

import functools
import os
from collections.abc import Callable, Hashable
Expand Down
4 changes: 3 additions & 1 deletion qldpc/cache_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
limitations under the License.
"""

from __future__ import annotations

import unittest.mock

import qldpc.cache
Expand All @@ -24,7 +26,7 @@ def test_use_disk_cache() -> None:
"""Cache function outputs."""

@qldpc.cache.use_disk_cache("test")
def get_five(arg: str) -> int:
def get_five(_: str) -> int:
return 5

# use cache to save/retrieve results
Expand Down
2 changes: 2 additions & 0 deletions qldpc/codes/classical_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
limitations under the License.
"""

from __future__ import annotations

import networkx as nx
import pytest

Expand Down
2 changes: 2 additions & 0 deletions qldpc/codes/common_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
limitations under the License.
"""

from __future__ import annotations

import itertools
import unittest.mock

Expand Down
2 changes: 2 additions & 0 deletions qldpc/codes/quantum_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
limitations under the License.
"""

from __future__ import annotations

import io
import unittest.mock

Expand Down
2 changes: 2 additions & 0 deletions qldpc/decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
limitations under the License.
"""

from __future__ import annotations

import cvxpy
import ldpc
import numpy as np
Expand Down
2 changes: 2 additions & 0 deletions qldpc/decoder_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
limitations under the License.
"""

from __future__ import annotations

import numpy as np
import pytest

Expand Down
2 changes: 2 additions & 0 deletions qldpc/external/codes.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
limitations under the License.
"""

from __future__ import annotations

import ast
import re

Expand Down
2 changes: 2 additions & 0 deletions qldpc/external/codes_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
limitations under the License.
"""

from __future__ import annotations

import subprocess
import unittest.mock

Expand Down
2 changes: 2 additions & 0 deletions qldpc/external/groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
limitations under the License.
"""

from __future__ import annotations

import re
import subprocess
import urllib.error
Expand Down
2 changes: 2 additions & 0 deletions qldpc/external/groups_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
limitations under the License.
"""

from __future__ import annotations

import subprocess
import unittest.mock
import urllib
Expand Down
2 changes: 2 additions & 0 deletions qldpc/objects_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
limitations under the License.
"""

from __future__ import annotations

import galois
import numpy as np
import pytest
Expand Down

0 comments on commit 8c7b8d2

Please sign in to comment.