Skip to content

Commit

Permalink
Fix some mypy error
Browse files Browse the repository at this point in the history
  • Loading branch information
DeborahVolpe committed May 20, 2024
1 parent 38e7cb3 commit 95ff245
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 10 deletions.
18 changes: 18 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[flake8]
extend-select = B9
extend-ignore = E203, E231, E501, E722, W503, B950, B014, W504, E123, E126, E226, E121, B905, SIM113
per-file-ignores = __init__.py:F401
max-line-length = 120
show-source = true
exclude =
.git,
.idea,
.eggs,
__pycache__,
.tox,
docs/source/conf.py,
build,
.nox,
venv,
.venv
application-import-names = mqt.qao
7 changes: 7 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[mypy]
# Specify the source directory
mypy_path = src

# Alternatively, you can use this to explicitly tell mypy to look in the src directory
[mypy.src.*]
ignore_missing_imports = True
5 changes: 1 addition & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ filterwarnings = [
ignore = "W002"

[tool.coverage]
run.source = ["mqt.predictor"]
run.source = ["mqt.qao"]
report.exclude_also = [
'\.\.\.',
'if TYPE_CHECKING:',
Expand All @@ -134,9 +134,6 @@ warn_unreachable = true
explicit_package_bases = true
pretty = true

[[tool.mypy.overrides]]
module = ["mqt.qao.*"]
implicit_reexport = true

[[tool.mypy.overrides]]
module = ["qubovert.*", "sympy.*", "dwave.samplers.*", "dwave.system.*", "docplex.*", "qiskit.*", "qiskit_optimization.*", "qiskit_ibm_provider.*", "matplotlib.*", "pandas.*", "pypfopt.*", "sklearn.*"]
Expand Down
12 changes: 7 additions & 5 deletions src/mqt/qao/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,19 @@

import logging

from src.mqt.qao.constraints import Constraints
from src.mqt.qao.objectivefunction import ObjectiveFunction
from src.mqt.qao.problem import Problem
from src.mqt.qao.solvers import Solver
from src.mqt.qao.variables import Variables
from mqt.qao.constraints import Constraints
from mqt.qao.objectivefunction import ObjectiveFunction
from mqt.qao.problem import Problem
from mqt.qao.solvers import Solution, Solver
from mqt.qao.variables import Variable, Variables

__all__ = [
"Variable",
"Variables",
"Constraints",
"ObjectiveFunction",
"Problem",
"Solution",
"Solver",
]

Expand Down
3 changes: 2 additions & 1 deletion src/mqt/qao/problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

import numpy as np
from qubovert import PUBO
from src.mqt.qao import Constraints, ObjectiveFunction, Variables

from mqt.qao import Constraints, ObjectiveFunction, Variables


class Problem:
Expand Down

0 comments on commit 95ff245

Please sign in to comment.