Skip to content

Commit

Permalink
Merge pull request #537 from SALib/triang-dist-bounds-fix
Browse files Browse the repository at this point in the history
Triang dist bounds fix
  • Loading branch information
ConnectedSystems committed Sep 25, 2022
2 parents a619d2d + 2f99011 commit 8ef425b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/SALib/util/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def _nonuniform_scale_samples(params, bounds, dists):
if len(b[i]) == 3:
loc_start = b[i][0] # loc start
b1 = b[i][1] # triangular distribution end
b2 = b[i][2] # 0-1 aka c
b2 = b[i][2] # 0-1 aka c (the peak)
elif len(b[i]) == 2:
msg = (
"Two-value format for triangular distributions detected.\n"
Expand All @@ -187,9 +187,9 @@ def _nonuniform_scale_samples(params, bounds, dists):
)

# checking for correct parameters
if b1 <= 0 or b2 <= 0 or b2 >= 1 or loc_start > b1:
if b1 < 0 or b2 < 0 or b2 >= 1 or loc_start > b1:
raise ValueError(
"""Triangular distribution: Scale must be
"""Triangular distribution bound error: Scale must be
greater than zero; peak on interval [0,1], triangular
start value must be smaller than end value"""
)
Expand Down

0 comments on commit 8ef425b

Please sign in to comment.