@@ -37,15 +37,6 @@ from typing import List, Any, Dict, Union, Set, Tuple, Optional
3737import numpy as np
3838cimport numpy as np
3939
40- # We now need to fix a datatype for our arrays. I've used the variable
41- # DTYPE for this, which is assigned to the usual NumPy runtime
42- # type info object.
43- # DTYPE = np.float
44- # "ctypedef" assigns a corresponding compile-time type to DTYPE_t. For
45- # every type in the numpy module there's a corresponding compile-time
46- # type with a _t-suffix.
47- # ctypedef np.float_t DTYPE_t
48-
4940
5041cdef class Hyperparameter(object ):
5142
@@ -877,7 +868,7 @@ cdef class UniformIntegerHyperparameter(IntegerHyperparameter):
877868 if self.log:
878869 repr_str.write(", on log-scale")
879870 if self.q is not None:
880- repr_str.write(", Q: %s" % repr(np.int( self.q ) ))
871+ repr_str.write(", Q: %s" % repr(self.q ))
881872 repr_str.seek(0)
882873 return repr_str.getvalue()
883874
@@ -913,7 +904,7 @@ cdef class UniformIntegerHyperparameter(IntegerHyperparameter):
913904 return self.ufhp._inverse_transform(vector )
914905
915906 def is_legal(self , value: int ) -> bool:
916- if not (isinstance(value , (int , np.int , np. int32 , np.int64 ))):
907+ if not (isinstance(value , (int , np.int32 , np.int64 ))):
917908 return False
918909 elif self .upper >= value >= self .lower:
919910 return True
@@ -1174,7 +1165,7 @@ cdef class NormalIntegerHyperparameter(IntegerHyperparameter):
11741165 q = self .q, log = self .log)
11751166
11761167 def is_legal(self , value: int ) -> bool:
1177- return isinstance(value , (int , np.int , np. int32 , np.int64 ))
1168+ return isinstance(value , (int , np.int32 , np.int64 ))
11781169
11791170 cpdef bint is_legal_vector(self , DTYPE_t value ):
11801171 return isinstance (value, float ) or isinstance (value, int )
0 commit comments