Closed simoneliuzzo closed 7 months ago
this pull request would solve issue #705
The reason for this cast seems to be the fact that fsolve
works on an array variable (array of 1 element here). To convert an array of one element into a scalar, the clean solution is:
bl = bl0*fsolve(haissinski, numpy.array([1.0]), args=cst)[0]
Note that the initial value (1.0) should also be an array. Otherwise PyCharm gives a warning: Expected type 'ndarray', got 'tuple[int]' instead
Dear @swhite2401,
what is your opinion? You are the author of the code, may be there are good reasons for the cast instead of indexing proposed by @lfarv ?
thank you best regards Simone
Hello, sorry for the late reply, I have been very busy lately. I think I agree with @lfarv on this one, no need to cast. Indexing makes it clear to the reader that fsolve returns an array so it seems more logical to me.
The solution proposed by @lfarv is adopted. I tested on my side and it is ok.
use np.float64 instead of np.float in function get_bunch_length_espread of pyat/at/acceptance/touschek.py module
This solves an error of deprecation given by numpy (since numpy 1.20). An alternative is to upgrade the package requirement for scikit-learn