Closed mgharafi closed 1 year ago
The following shows that there is several variables that has numpy types which are limited.
type(self[idx][0])=<class 'numpy.float64'>
type(self[idx][1])=<class 'numpy.float64'>
type(x)=<class 'int'>
type(y)=<class 'numpy.intc'> # The bad type
They are also transferred to the Fraction
object.
type((Fc(y) - Fc(self[idx][1])).numerator)=<class 'numpy.int64'>
And in my code that calls the moarchiving module I found several places where changing the types, solved the problem.
old code (not working)
xopt = np.array([1, *[0 for _ in range(len(x) - 1)]]) # This is an list of int
fopt = fitness(xopt) # Also a list of int
The bad type comes from the objective function values when x is a list of int
type(fopt[0])=<class 'numpy.intc'>
type(fopt[1])=<class 'numpy.intc'>
new code (working)
xopt = np.array([1., *[0. for _ in range(len(x) - 1)]]) # This is an list of floats
fopt = fitness(xopt) # Also a list of floats
Will be fixed in the upcoming v0.7.1
.
see commit 8addc5f945bed32913c412584b30a804c1bee613
This happens when the NDA contains an optimal solution.
The case that generates this error is the following:
A log of the variables just before the error
Full output of the error
When computed outside the moarchiving module we get a positive value:
The ouput: