Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError; Write Conditions with non-string values #79

Closed
mlindauer opened this issue Jun 12, 2018 · 1 comment
Closed

TypeError; Write Conditions with non-string values #79

mlindauer opened this issue Jun 12, 2018 · 1 comment
Labels

Comments

@mlindauer
Copy link
Contributor

from ConfigSpace.configuration_space import ConfigurationSpace
from ConfigSpace.hyperparameters import CategoricalHyperparameter
from ConfigSpace.conditions import InCondition
from ConfigSpace.read_and_write.pcs_new import write

cs = ConfigurationSpace(seed=12345)

p1 = CategoricalHyperparameter(name="p1", choices=[True, False], default_value=True)
p2 = CategoricalHyperparameter(name="p2", choices=[True, False], default_value=True)
cs.add_hyperparameters([p1,p2])
c1 = InCondition(child=p2, parent=p1, values=[True])
cs.add_condition(c1)

with open("test.pcs", "w") as fh:
    fh.write(write(cs))

Error:

Traceback (most recent call last):
  File "test.py", line 16, in <module>
    fh.write(write(cs))
  File "/home/lindauer/git/ConfigSpace/ConfigSpace/read_and_write/pcs_new.py", line 462, in write
    condition_lines.write(build_condition(condition))
  File "/home/lindauer/git/ConfigSpace/ConfigSpace/read_and_write/pcs_new.py", line 145, in build_condition
    ", ".join(condition.values))
TypeError: sequence item 0: expected str instance, bool found

In response to automl/SMAC3#442

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants