Skip to content

Commit

Permalink
Replace deprecated saltelli with sobol SALib 1.4.6+. (#211)
Browse files Browse the repository at this point in the history
Replace deprecated saltelli with sobol SALib 1.4.6+. Behind the scenes the Sobol method will call SciPy scipy.stats.qmc.Sobol.

Part of #201.
  • Loading branch information
quaquel authored Oct 28, 2022
1 parent ff21348 commit 6deab9c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions ema_workbench/em_framework/salib_samplers.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
from .samplers import DefaultDesigns

try:
from SALib.sample import saltelli
from SALib.sample import sobol
from SALib.sample import morris
from SALib.sample import fast_sampler
except ImportError:
warnings.warn("SALib samplers not available", ImportWarning)
saltelli = morris = fast_sampler = None
sobol = morris = fast_sampler = None

# Created on 12 Jan 2017
#
Expand Down Expand Up @@ -134,7 +134,7 @@ def __init__(self, second_order=True):
super().__init__()

def sample(self, problem, size):
return saltelli.sample(problem, size, calc_second_order=self.second_order)
return sobol.sample(problem, size, calc_second_order=self.second_order)


class MorrisSampler(SALibSampler):
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ dependencies = [
"numpy",
"pandas",
"scikit-learn",
"salib",
"salib>=1.4.6",
"platypus-opt",
"matplotlib",
"statsmodels; python_version < '3.11'",
Expand Down

0 comments on commit 6deab9c

Please sign in to comment.