Skip to content

Commit 85b482e

Browse files
committed
Added import warning to python hypervolume
1 parent b46dde2 commit 85b482e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

deap/tools/_hypervolume/pyhv.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,14 @@
2323
# License along with DEAP. If not, see <http://www.gnu.org/licenses/>.
2424

2525
from math import log, floor
26-
2726
import random
27+
import warnings
2828

2929
import numpy
3030

31+
warnings.simplefilter("once", ImportWarning)
32+
warnings.warn("Falling back to the python version of hypervolume "
33+
"module. Expect this to be very slow.", ImportWarning)
3134

3235
def hypervolume(pointset, ref):
3336
"""Compute the absolute hypervolume of a *pointset* according to the

0 commit comments

Comments
 (0)