Skip to content

Commit

Permalink
fix: Make sure to use NotSet in simple api
Browse files Browse the repository at this point in the history
  • Loading branch information
eddiebergman committed Apr 16, 2024
1 parent e5ccadb commit 21488fb
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/ConfigSpace/api/types/categorical.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from typing_extensions import TypeAlias

from ConfigSpace.hyperparameters import CategoricalHyperparameter, OrdinalHyperparameter
from ConfigSpace.types import NotSet, _NotSet

# We only accept these types in `items`
T: TypeAlias = Union[str, int, float]
Expand All @@ -16,7 +17,7 @@ def Categorical(
name: str,
items: Sequence[T],
*,
default: T | None = None,
default: T | _NotSet = NotSet,
weights: Sequence[float] | None = None,
ordered: Literal[False],
meta: dict | None = None,
Expand All @@ -29,7 +30,7 @@ def Categorical(
name: str,
items: Sequence[T],
*,
default: T | None = None,
default: T | _NotSet = NotSet,
weights: Sequence[float] | None = None,
ordered: Literal[True],
meta: dict | None = None,
Expand All @@ -42,7 +43,7 @@ def Categorical(
name: str,
items: Sequence[T],
*,
default: T | None = None,
default: T | _NotSet = NotSet,
weights: Sequence[float] | None = None,
ordered: bool = ...,
meta: dict | None = None,
Expand All @@ -53,7 +54,7 @@ def Categorical(
name: str,
items: Sequence[T],
*,
default: T | None = None,
default: T | _NotSet = NotSet,
weights: Sequence[float] | None = None,
ordered: bool = False,
meta: dict | None = None,
Expand Down

0 comments on commit 21488fb

Please sign in to comment.