Skip to content

Commit

Permalink
Show warning only if hypervolume is called
Browse files Browse the repository at this point in the history
  • Loading branch information
fmder authored May 30, 2018
1 parent bee1900 commit 42162f4
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions deap/tools/_hypervolume/pyhv.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,12 @@

import numpy

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

def hypervolume(pointset, ref):
"""Compute the absolute hypervolume of a *pointset* according to the
reference point *ref*.
"""
warnings.warn("Falling back to the python version of hypervolume "
"module. Expect this to be very slow.", RuntimeWarning)
hv = _HyperVolume(ref)
return hv.compute(pointset)

Expand Down

0 comments on commit 42162f4

Please sign in to comment.