From 6deab9c60fa2285af3d238e9c17631e63b1d86fa Mon Sep 17 00:00:00 2001 From: Jan Kwakkel Date: Fri, 28 Oct 2022 15:25:22 +0200 Subject: [PATCH] Replace deprecated `saltelli` with `sobol` SALib 1.4.6+. (#211) 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. --- ema_workbench/em_framework/salib_samplers.py | 6 +++--- pyproject.toml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ema_workbench/em_framework/salib_samplers.py b/ema_workbench/em_framework/salib_samplers.py index 33d65dbaa..b36a4a1bc 100644 --- a/ema_workbench/em_framework/salib_samplers.py +++ b/ema_workbench/em_framework/salib_samplers.py @@ -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 # @@ -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): diff --git a/pyproject.toml b/pyproject.toml index 508cb8657..95b5ebf84 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,7 +20,7 @@ dependencies = [ "numpy", "pandas", "scikit-learn", - "salib", + "salib>=1.4.6", "platypus-opt", "matplotlib", "statsmodels; python_version < '3.11'",