diff --git a/queens/iterators/sobol_index_iterator.py b/queens/iterators/sobol_index_iterator.py index 49b673ef..2a121634 100644 --- a/queens/iterators/sobol_index_iterator.py +++ b/queens/iterators/sobol_index_iterator.py @@ -1,6 +1,6 @@ # # SPDX-License-Identifier: LGPL-3.0-or-later -# Copyright (c) 2024, QUEENS contributors. +# Copyright (c) 2025, QUEENS contributors. # # This file is part of QUEENS. # @@ -40,6 +40,8 @@ class SobolIndexIterator(Iterator): seed (int): Seed for random number generator. num_samples (int): Number of samples. calc_second_order (bool): Whether to calculate second-order sensitivities. + skip_values (int or None): Number of points in Sobol' sequence to skip, ideally a value of + base 2 (default: 1024). num_bootstrap_samples (int): Number of bootstrap samples for confidence intervals. confidence_level (float): Confidence level for the intervals. result_description (dict): Description of the desired results. @@ -63,6 +65,7 @@ def __init__( num_bootstrap_samples, confidence_level, result_description, + skip_values=None, ): """Initialize Saltelli SALib iterator object. @@ -76,12 +79,17 @@ def __init__( num_bootstrap_samples (int): Number of bootstrap samples. confidence_level (float): Confidence level for intervals. result_description (dict): Description of the desired results. + skip_values (int or None): Number of points in Sobol' sequence to skip, ideally a value + of base 2. None triggers the SALib default value: + a power of 2 >= N, or 16; whichever is greater. + (default: None). """ super().__init__(model, parameters, global_settings) self.seed = seed self.num_samples = num_samples self.calc_second_order = calc_second_order + self.skip_values = skip_values self.num_bootstrap_samples = num_bootstrap_samples self.confidence_level = confidence_level self.result_description = result_description @@ -117,7 +125,7 @@ def pre_run(self): self.salib_problem, self.num_samples, calc_second_order=self.calc_second_order, - skip_values=1024, + skip_values=self.skip_values, ) _logger.debug(self.samples) diff --git a/tests/integration_tests/python/test_sobol_indices_borehole.py b/tests/integration_tests/python/test_sobol_indices_borehole.py index f7936618..09b37ac6 100644 --- a/tests/integration_tests/python/test_sobol_indices_borehole.py +++ b/tests/integration_tests/python/test_sobol_indices_borehole.py @@ -1,6 +1,6 @@ # # SPDX-License-Identifier: LGPL-3.0-or-later -# Copyright (c) 2024, QUEENS contributors. +# Copyright (c) 2025, QUEENS contributors. # # This file is part of QUEENS. # @@ -53,6 +53,7 @@ def test_sobol_indices_borehole(global_settings): model=model, parameters=parameters, global_settings=global_settings, + skip_values=1024, ) # Actual analysis diff --git a/tests/integration_tests/python/test_sobol_indices_ishigami.py b/tests/integration_tests/python/test_sobol_indices_ishigami.py index 8e9c692d..14c87d22 100644 --- a/tests/integration_tests/python/test_sobol_indices_ishigami.py +++ b/tests/integration_tests/python/test_sobol_indices_ishigami.py @@ -1,6 +1,6 @@ # # SPDX-License-Identifier: LGPL-3.0-or-later -# Copyright (c) 2024, QUEENS contributors. +# Copyright (c) 2025, QUEENS contributors. # # This file is part of QUEENS. # @@ -49,6 +49,7 @@ def test_sobol_indices_ishigami(global_settings): model=model, parameters=parameters, global_settings=global_settings, + skip_values=1024, ) # Actual analysis diff --git a/tests/integration_tests/python/test_sobol_indices_ishigami_gp.py b/tests/integration_tests/python/test_sobol_indices_ishigami_gp.py index f0531b52..692900b7 100644 --- a/tests/integration_tests/python/test_sobol_indices_ishigami_gp.py +++ b/tests/integration_tests/python/test_sobol_indices_ishigami_gp.py @@ -1,6 +1,6 @@ # # SPDX-License-Identifier: LGPL-3.0-or-later -# Copyright (c) 2024, QUEENS contributors. +# Copyright (c) 2025, QUEENS contributors. # # This file is part of QUEENS. # @@ -68,6 +68,7 @@ def test_sobol_indices_ishigami_gp(global_settings): model=gpflow_regression_model, parameters=parameters, global_settings=global_settings, + skip_values=1024, ) # Actual analysis diff --git a/tests/integration_tests/python/test_sobol_indices_sobol.py b/tests/integration_tests/python/test_sobol_indices_sobol.py index 20d781be..e4063373 100644 --- a/tests/integration_tests/python/test_sobol_indices_sobol.py +++ b/tests/integration_tests/python/test_sobol_indices_sobol.py @@ -1,6 +1,6 @@ # # SPDX-License-Identifier: LGPL-3.0-or-later -# Copyright (c) 2024, QUEENS contributors. +# Copyright (c) 2025, QUEENS contributors. # # This file is part of QUEENS. # @@ -61,6 +61,7 @@ def test_sobol_indices_sobol(global_settings): model=model, parameters=parameters, global_settings=global_settings, + skip_values=1024, ) # Actual analysis diff --git a/tests/unit_tests/iterators/test_sobol_index_iterator.py b/tests/unit_tests/iterators/test_sobol_index_iterator.py index b33461d0..7b6cb99b 100644 --- a/tests/unit_tests/iterators/test_sobol_index_iterator.py +++ b/tests/unit_tests/iterators/test_sobol_index_iterator.py @@ -1,6 +1,6 @@ # # SPDX-License-Identifier: LGPL-3.0-or-later -# Copyright (c) 2024, QUEENS contributors. +# Copyright (c) 2025, QUEENS contributors. # # This file is part of QUEENS. # @@ -37,6 +37,7 @@ def fixture_default_sobol_index_iterator( num_bootstrap_samples=1000, confidence_level=0.95, result_description={}, + skip_values=1024, ) return my_iterator