You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is with ConfigSpace 0.7.1, which is the latest one installable with pip, so my apology if this was fixed already.
It seems I just cannot create an Integer parameter:
>>> from ConfigSpace import Integer
>>> Integer("x", (1, 42))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/ubuntu/Code/spack/var/spack/environments/bedrock-env/.spack-env/view/lib/python3.11/site-packages/ConfigSpace/api/types/integer.py", line 159, in Integer
return UniformIntegerHyperparameter(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "ConfigSpace/hyperparameters/uniform_integer.pyx", line 48, in ConfigSpace.hyperparameters.uniform_integer.UniformIntegerHyperparameter.__init__
TypeError: Argument 'default_value' has incorrect type (expected int, got NoneType)
>>> Integer("x", (1, 42), default=1)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/ubuntu/Code/spack/var/spack/environments/bedrock-env/.spack-env/view/lib/python3.11/site-packages/ConfigSpace/api/types/integer.py", line 159, in Integer
return UniformIntegerHyperparameter(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "ConfigSpace/hyperparameters/uniform_integer.pyx", line 82, in ConfigSpace.hyperparameters.uniform_integer.UniformIntegerHyperparameter.__init__
File "ConfigSpace/hyperparameters/uniform_float.pyx", line 62, in ConfigSpace.hyperparameters.uniform_float.UniformFloatHyperparameter.__init__
TypeError: Argument 'default_value' has incorrect type (expected float, got int)
>>> Integer("x", (1, 42), default=1.0)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/ubuntu/Code/spack/var/spack/environments/bedrock-env/.spack-env/view/lib/python3.11/site-packages/ConfigSpace/api/types/integer.py", line 159, in Integer
return UniformIntegerHyperparameter(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "ConfigSpace/hyperparameters/uniform_integer.pyx", line 48, in ConfigSpace.hyperparameters.uniform_integer.UniformIntegerHyperparameter.__init__
TypeError: Argument 'default_value' has incorrect type (expected int, got float)
Not specifying the default? It complains that default_value isn't provided. Passing default=1? It complains that it wants a float. Passing default=1.0? It complains that it wants an int.
If this was corrected already, could you publish version 0.7.2 to pypi?
The text was updated successfully, but these errors were encountered:
I tried several versions as well as the main branch and figured out that it's caused by the version of cython used. I had Cython 3.0.10. When I switched to Cython 0.29.36, these kind of type conversion bug disappeared.
I think Cython became more strict about type conversions in version 3+, you might want to go through the code and test it with Cython 3. I tried adding the missing conversion in uniform_integer.pyx but ended up with another conversion error (from float to a numpy float or something like that) later down the line.
This is with ConfigSpace 0.7.1, which is the latest one installable with pip, so my apology if this was fixed already.
It seems I just cannot create an
Integer
parameter:Not specifying the default? It complains that
default_value
isn't provided. Passingdefault=1
? It complains that it wants afloat
. Passingdefault=1.0
? It complains that it wants anint
.If this was corrected already, could you publish version 0.7.2 to pypi?
The text was updated successfully, but these errors were encountered: