Skip to content

Commit

Permalink
MAINT: Add type annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinThoma committed Apr 26, 2020
1 parent 944acc2 commit 9d7d86a
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 14 deletions.
21 changes: 11 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ repos:
- id: trailing-whitespace
- id: mixed-line-ending

# - repo: https://github.com/pre-commit/mirrors-mypy
# rev: v0.730
# hooks:
# - id: mypy
# args: [--ignore-missing-imports]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.730
hooks:
- id: mypy
args: [--ignore-missing-imports]
- repo: https://github.com/asottile/seed-isort-config
rev: v1.9.3
hooks:
Expand All @@ -30,10 +30,11 @@ repos:
rev: v4.3.21
hooks:
- id: isort
# - repo: https://github.com/psf/black
# rev: 19.3b0
# hooks:
# - id: black
- repo: https://github.com/psf/black
rev: 19.10b0
hooks:
- id: black
language_version: python3.6
- repo: https://github.com/asottile/pyupgrade
rev: v2.1.0
hooks:
Expand All @@ -43,4 +44,4 @@ repos:
rev: v1.6.0
hooks:
- id: blacken-docs
additional_dependencies: [black==19.3b0]
additional_dependencies: [black==19.10b0]
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.7.6
4 changes: 2 additions & 2 deletions bin/merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# Core Library modules
import pickle
from typing import Dict
from typing import Any, Dict

# Third party modules
import click
Expand Down Expand Up @@ -49,7 +49,7 @@ def merge(d1: Dict, d2: Dict) -> Dict:
Dict
"""
if d1["formula_id2latex"] is None:
formula_id2latex = {}
formula_id2latex: Dict[str, Any] = {}
else:
formula_id2latex = d1["formula_id2latex"].copy()
formula_id2latex.update(d2["formula_id2latex"])
Expand Down
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# type: ignore
#
# hwrt documentation build configuration file, created by
# sphinx-quickstart on Mon Oct 20 16:23:32 2014.
Expand Down
4 changes: 2 additions & 2 deletions hwrt/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ def get_features(model_description_features: List[Dict[str, Any]]):
)


def print_featurelist(feature_list):
def print_featurelist(feature_list: List):
"""
Print the feature_list in a human-readable form.
Parameters
----------
feature_list : list
feature_list : List
feature objects
"""
input_features = sum([n.get_dimension() for n in feature_list])
Expand Down

0 comments on commit 9d7d86a

Please sign in to comment.