(self)
Dynamically add available SALib samplers as ProblemSpec methods.
Dynamically add available SALib samplers as ProblemSpec methods.
Dynamically add available SALib samplers as ProblemSpec methods .
def _add_samplers(self):
        """Dynamically add available SALib samplers as ProblemSpec methods."""
        for sampler in avail_approaches(samplers):
            func = getattr(importlib.import_module('SALib.sample.{}'.format(sampler)), 'sample')
            method_name = "sample_{}".format(sampler.replace('_sampler', ''))

            self.__setattr__(method_name, MethodType(self._method_creator(func, 'sample'), self))
def _add_samplers ( self ) : for sampler in avail_approaches ( samplers ) : func = getattr ( importlib . import_module ( 'SALib.sample.{}' . format ( sampler ) ) , 'sample' ) method_name = "sample_{}" . format ( sampler . replace ( '_sampler' , '' ) ) self . __setattr__ ( method_name , MethodType ( self . _method_creator ( func , 'sample' ) , self ) )