Skip to content

Commit

Permalink
Merge branch 'develop' into gh1035_problem_startpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
dweindl committed Jul 12, 2023
2 parents 3d7fbff + daf47dd commit f8351ba
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
3 changes: 3 additions & 0 deletions pypesto/C.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,9 @@ class InnerParameterType(str, Enum):
ALL_CLUSTERED = 'all_clustered' # best + all that are in a cluster of size > 1
FIRST_CLUSTER = 'first_cluster' # all starts that belong to the first cluster

# waterfall max value
WATERFALL_MAX_VALUE = 1e100


###############################################################################
# ENVIRONMENT VARIABLES
Expand Down
4 changes: 2 additions & 2 deletions pypesto/visualize/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

from pypesto.util import delete_nan_inf

from ..C import RGBA
from ..C import RGBA, WATERFALL_MAX_VALUE
from ..result import Result
from .clust_color import assign_colors
from .misc import (
Expand Down Expand Up @@ -276,7 +276,7 @@ def parameters_lowlevel(
fvals=fvals,
x=xs,
xdim=len(ub) if ub is not None else 1,
magnitude_bound=1e100,
magnitude_bound=WATERFALL_MAX_VALUE,
)

if size is None:
Expand Down
9 changes: 7 additions & 2 deletions pypesto/visualize/waterfall.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

from pypesto.util import delete_nan_inf

from ..C import WATERFALL_MAX_VALUE
from ..result import Result
from .clust_color import RGBA, assign_colors
from .misc import (
Expand Down Expand Up @@ -121,7 +122,9 @@ def waterfall(
# parse input
if order_by_id:
start_ids = [s.id for s in results[j].optimize_result.list]
fvals_raw_is_finite = np.isfinite(fvals_raw)
fvals_raw_is_finite = np.isfinite(fvals_raw) & (
np.absolute(fvals_raw) < WATERFALL_MAX_VALUE
)

fvals = []
for start_id in start_id_ordering:
Expand All @@ -135,7 +138,9 @@ def waterfall(
# also remove extremely large values. These values result in `inf`
# values in the output of `scipy.cluster.hierarchy.linkage` in the
# method `pypesto.util.assign_clusters`, which raises errors.
_, fvals = delete_nan_inf(fvals=fvals_raw, magnitude_bound=1e100)
_, fvals = delete_nan_inf(
fvals=fvals_raw, magnitude_bound=WATERFALL_MAX_VALUE
)
fvals.sort()

# assign colors
Expand Down

0 comments on commit f8351ba

Please sign in to comment.