Skip to content

Commit

Permalink
Update precommit file
Browse files Browse the repository at this point in the history
  • Loading branch information
nabenabe0928 committed Mar 9, 2024
1 parent 9a7473d commit 70517db
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
1 change: 0 additions & 1 deletion .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ jobs:
- name: Install pre-commit
run: |
pip install pre-commit
pip install mypy
pre-commit install
- name: Run pre-commit
run: |
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
repos:
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.761
rev: v1.8.0
hooks:
- id: mypy
args: [--show-error-codes]
name: mypy check
files: tpe
- repo: https://github.com/pycqa/flake8
rev: 3.8.3
rev: 7.0.0
hooks:
- id: flake8
name: flake8 check
Expand Down
1 change: 1 addition & 0 deletions tpe/optimizer/base_optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ def optimize(
"""
use_logger = logger_name is not None
logger_name = logger_name if use_logger else "temp"
assert isinstance(logger_name, str), "MyPy redefinition."
logger = get_logger(logger_name, logger_name, disable=(not use_logger))
best_config, best_loss, t = {}, np.inf, 0

Expand Down
2 changes: 1 addition & 1 deletion tpe/optimizer/tpe_optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def __init__(
min_bandwidth_factor: float = 1e-1,
top: float = 1.0,
# TODO: Make dict of percentile_func_maker
percentile_func_maker: PercentileFuncMaker = default_percentile_maker,
percentile_func_maker: PercentileFuncMaker = default_percentile_maker, # type: ignore[assignment]
):
"""
Args:
Expand Down
2 changes: 1 addition & 1 deletion tpe/utils/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
NumericType = Union[float, int]
SQR2, SQR2PI = np.sqrt(2), np.sqrt(2 * np.pi)

CategoricalHPType = CSH.CategoricalHyperparameter
CategoricalHPType = Union[CSH.CategoricalHyperparameter]
NumericalHPType = Union[CSH.UniformIntegerHyperparameter, CSH.UniformFloatHyperparameter, CSH.OrdinalHyperparameter]
HPType = Union[CategoricalHPType, NumericalHPType]

Expand Down
2 changes: 1 addition & 1 deletion tpe/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def get_args_from_parser(Choices: Enum, opts: dict) -> Namespace:
parser.add_argument("--exp_id", type=int, default=0)
parser.add_argument("--max_evals", type=int, default=100)

default_choice = getattr(Choices, Choices._member_names_[0]).name
default_choice = getattr(Choices, Choices._member_names_[0]).name # type: ignore[attr-defined]
parser.add_argument("--dataset", choices=list([c.name for c in Choices]), default=default_choice) # type: ignore

args = parser.parse_args()
Expand Down

0 comments on commit 70517db

Please sign in to comment.