Skip to content

Commit

Permalink
more enum fixups
Browse files Browse the repository at this point in the history
  • Loading branch information
bpkroth committed Jan 21, 2025
1 parent f83ac30 commit 0dcd8c0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions mlos_bench/mlos_bench/optimizers/mlos_core_optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ def _to_df(self, configs: Sequence[dict[str, TunableValue]]) -> pd.DataFrame:
(special_name, type_name) = special_param_names(tunable.name)
tunables_names += [special_name, type_name]
is_special = df_configs[tunable.name].apply(tunable.special.__contains__)
df_configs[type_name] = TunableValueKind.RANGE
df_configs.loc[is_special, type_name] = TunableValueKind.SPECIAL
df_configs[type_name] = TunableValueKind.RANGE.value
df_configs.loc[is_special, type_name] = TunableValueKind.SPECIAL.value
if tunable.type == "int":
# Make int column NULLABLE:
df_configs[tunable.name] = df_configs[tunable.name].astype("Int64")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ def configuration_space() -> ConfigurationSpace:
),
CategoricalHyperparameter(
name=kernel_sched_migration_cost_ns_type,
choices=[TunableValueKind.SPECIAL, TunableValueKind.RANGE],
choices=[TunableValueKind.SPECIAL.value, TunableValueKind.RANGE.value],
weights=[0.5, 0.5],
default_value=TunableValueKind.SPECIAL,
default_value=TunableValueKind.SPECIAL.value,
),
]
)
Expand All @@ -98,12 +98,12 @@ def configuration_space() -> ConfigurationSpace:
EqualsCondition(
spaces[kernel_sched_migration_cost_ns_special],
spaces[kernel_sched_migration_cost_ns_type],
TunableValueKind.SPECIAL,
TunableValueKind.SPECIAL.value,
),
EqualsCondition(
spaces["kernel_sched_migration_cost_ns"],
spaces[kernel_sched_migration_cost_ns_type],
TunableValueKind.RANGE,
TunableValueKind.RANGE.value,
),
]
)
Expand Down

0 comments on commit 0dcd8c0

Please sign in to comment.