Skip to content

Commit

Permalink
Add mypy to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
gfrances committed Mar 9, 2022
1 parent 2ae9237 commit ed1478e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/style-docs-grammars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
matrix:
os: [ubuntu-latest]
python-version: ['3.10']
toxenv: ['docs', 'antlrgrammars', 'pylint', 'flake8']
toxenv: ['docs', 'antlrgrammars', 'pylint', 'flake8', 'mypy']

runs-on: ${{ matrix.os }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion src/tarski/fstrips/manipulation/simplify.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ class ExistentialQuantificationSimplifier(FOLWalker):
def visit(self, node): # pylint: disable-msg=E0102 # noqa: F811
return self.default_handler(node)

@dispatch(QuantifiedFormula)
@dispatch(QuantifiedFormula) # type: ignore
def visit(self, node: QuantifiedFormula): # pylint: disable-msg=E0102 # noqa: F811
if node.quantifier == Quantifier.Forall:
return node
Expand Down
22 changes: 11 additions & 11 deletions src/tarski/fstrips/ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# At the moment we're using the "multipledispatch" package to implement single-argument dispatching.
# Whenever we move to support Python 3.8+, we could directly use
# https://docs.python.org/3/library/functools.html#functools.singledispatchmethod
from multipledispatch import dispatch
from multipledispatch import dispatch # type: ignore

from .walker import ProblemWalker
from ..syntax import Predicate, Function, CompoundTerm, Atom
Expand Down Expand Up @@ -45,16 +45,16 @@ def __init__(self):
super().__init__()
self.symbols = set()

@dispatch(object)
@dispatch(object) # type: ignore
def visit(self, node): # pylint: disable-msg=E0102
return self.default_handler(node)

@dispatch(CompoundTerm)
@dispatch(CompoundTerm) # type: ignore
def visit(self, node): # pylint: disable-msg=E0102 # noqa: F811
self.symbols.add(node.symbol)
return node

@dispatch(Atom)
@dispatch(Atom) # type: ignore
def visit(self, node): # pylint: disable-msg=E0102 # noqa: F811
self.symbols.add(node.symbol)
return node
Expand All @@ -66,36 +66,36 @@ def __init__(self):
super().__init__()
self.symbols = set()

@dispatch(object)
@dispatch(object) # type: ignore
def visit(self, node): # pylint: disable-msg=E0102 # noqa: F811
return self.default_handler(node)

@dispatch(fs.AddEffect)
@dispatch(fs.AddEffect) # type: ignore
def visit(self, node): # pylint: disable-msg=E0102 # noqa: F811
self.symbols.add(node.atom.symbol)
return node

@dispatch(fs.DelEffect)
@dispatch(fs.DelEffect) # type: ignore
def visit(self, node): # pylint: disable-msg=E0102 # noqa: F811
self.symbols.add(node.atom.symbol)
return node

@dispatch(fs.FunctionalEffect)
@dispatch(fs.FunctionalEffect) # type: ignore
def visit(self, node): # pylint: disable-msg=E0102 # noqa: F811
self.symbols.add(node.lhs.symbol)
return node

@dispatch(fs.ChoiceEffect)
@dispatch(fs.ChoiceEffect) # type: ignore
def visit(self, node): # pylint: disable-msg=E0102 # noqa: F811
self.symbols.add(node.obj.symbol)
return node

@dispatch(fs.LinearEffect)
@dispatch(fs.LinearEffect) # type: ignore
def visit(self, node): # pylint: disable-msg=E0102 # noqa: F811
self.symbols.update(lhs.symbol for lhs in node.y[:, 0])
return node

@dispatch(Derived)
@dispatch(Derived) # type: ignore
def visit(self, node): # pylint: disable-msg=E0102 # noqa: F811
self.symbols.update(node.predicate)
return node
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ ignore_errors = True
[mypy-scipy.*]
ignore_missing_imports = True

[mypy-numpy]
[mypy-numpy.*]
ignore_missing_imports = True

[mypy-antlr4.*]
Expand Down

0 comments on commit ed1478e

Please sign in to comment.