Skip to content

Commit

Permalink
Fix type error
Browse files Browse the repository at this point in the history
  • Loading branch information
nabenabe0928 committed Mar 9, 2024
1 parent 98ccc9b commit bba4948
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions tpe/utils/constants.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
from __future__ import annotations

from collections.abc import Callable
from typing import Any, Protocol
from typing import Any, Protocol, Union

import ConfigSpace.hyperparameters as CSH

import numpy as np


EPS = 1.0e-300
NumericType = float | int
NumericType = Union[float, int]
SQR2, SQR2PI = np.sqrt(2), np.sqrt(2 * np.pi)

CategoricalHPType = CSH.CategoricalHyperparameter
NumericalHPType = CSH.UniformIntegerHyperparameter | CSH.UniformFloatHyperparameter | CSH.OrdinalHyperparameter

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

config2type = {
"UniformFloatHyperparameter": float,
Expand Down

0 comments on commit bba4948

Please sign in to comment.