Skip to content

Commit

Permalink
Fix anyoptimization#353: AttributeError: 'numpy.int64' object has no …
Browse files Browse the repository at this point in the history
…attribute 'get'
  • Loading branch information
blankjul committed Jan 31, 2023
1 parent b55e53a commit 41c7fa9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pymoo/core/selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def do(self, problem, pop, n_select, n_parents, to_pop=True, **kwargs):
ret = self._do(problem, pop, n_select, n_parents, **kwargs)

# if some selections return indices they are used to create the individual list
if to_pop and isinstance(ret, np.ndarray) and ret.dtype == int:
if to_pop and isinstance(ret, np.ndarray) and np.issubdtype(ret.dtype, np.integer):
ret = pop[ret]

return ret
Expand Down

0 comments on commit 41c7fa9

Please sign in to comment.