I am using numpy 2.4.1 and get:
Traceback (most recent call last):
File ".../site-packages/pydream/Dream.py", line 468, in estimate_crossover_probabilities
m_loc = int(np.where(self.CR_values == CR)[0])
TypeError: only 0-dimensional arrays can be converted to Python scalars
With NumPy ≥ 2.0, np.where(...)[0] returns a 1-D array (e.g. array([1])), and int(array([1])) raises:
TypeError: only 0-dimensional arrays can be converted to Python scalars
Proposed fix:
- m_loc = int(np.where(self.CR_values == CR)[0])
- m_loc = np.where(self.CR_values == CR)[0].item()