Skip to content

Commit

Permalink
changed pre commit, so all errors get caught
Browse files Browse the repository at this point in the history
  • Loading branch information
KrissiHub committed Oct 10, 2023
1 parent bce1de4 commit 8baf7fc
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 4 deletions.
24 changes: 22 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,32 @@ repos:
additional_dependencies: ["tomli"] # Needed to parse pyproject.toml

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.2.0
rev: v1.5.1
hooks:
- id: mypy
name: mypy deepcave
files: deepcave
args: ["--check-untyped-defs", "--install-types", "--non-interactive", "--ignore-missing-imports"]
args: [--check-untyped-defs, --ignore-missing-imports]
additional_dependencies: [
'wheel',
'setuptools',
'absl-py>=1.0.0',
'jsonlines>=3.0.0',
'pandas>=1.3.4',
'numpy>=1.22.2',
'matplotlib>=3.5.1',
'pyyaml',
'ConfigSpace',
'pyrfr>=0.9.0',
'hpbandster==0.7.4',
'dash==2.0.0',
'dash-extensions==0.0.71',
'dash-bootstrap-components==1.0.3',
'redis>=4.1.4',
'rq>=1.10.1',
'werkzeug==2.0.3',
'pyPDPPartitioner'
]

- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ check-pydocstyle:
$(PYDOCSTYLE) ${SOURCE_DIR} || :

check-mypy:
$(MYPY) --check-untyped-defs ${SOURCE_DIR} || :
$(MYPY) --check-untyped-defs --install-types --non-interactive --ignore-missing-imports ${SOURCE_DIR} || :

check-flake8:
$(FLAKE8) ${SOURCE_DIR} || :
Expand Down
3 changes: 2 additions & 1 deletion deepcave/utils/styled_plotty.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ def get_hyperparameter_ticks(
tickvals and ticktext.
"""
# This is basically the inverse of `encode_config`.
tickvals: List[Union[float, int]]
if isinstance(hp, CategoricalHyperparameter):
ticktext = hp.choices
if len(ticktext) == 1:
Expand All @@ -256,7 +257,7 @@ def get_hyperparameter_ticks(
min_v = 0
max_v = 1

values = [min_v]
values: List[Union[float, int]] = [min_v]

# Get values for each tick
factors = [i / (ticks - 1) for i in range(1, ticks - 1)]
Expand Down

0 comments on commit 8baf7fc

Please sign in to comment.