From 78f823b139fdf7b85f6e2afd759becda85dd2a1c Mon Sep 17 00:00:00 2001 From: Gustavo Paim Berned Date: Tue, 28 Nov 2023 15:11:26 -0300 Subject: [PATCH 1/4] Add constants to aggregator constanst file Adds two constants that contemplates the UQ results captions for their datasets. ASIM-5490 --- src/alfasim_sdk/result_reader/aggregator_constants.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/alfasim_sdk/result_reader/aggregator_constants.py b/src/alfasim_sdk/result_reader/aggregator_constants.py index c53b491d..730de103 100644 --- a/src/alfasim_sdk/result_reader/aggregator_constants.py +++ b/src/alfasim_sdk/result_reader/aggregator_constants.py @@ -1,5 +1,7 @@ TRENDS_GROUP_NAME = "trends" TRENDS_META_ATTR_NAME = "trends" +GLOBAL_SENSITIVITY_ANALYSIS_META_ATTR_NAME = "global_sensitivity_analysis" +GLOBAL_SENSITIVITY_ANALYSIS_GROUP_NAME = "global_sensitivity_analysis" TIME_SET_DSET_NAME = "time_set" From 17b18071767f4287069ec1563eec073c5bc66959 Mon Sep 17 00:00:00 2001 From: Rodrigo Neto Date: Thu, 21 Dec 2023 16:20:29 -0300 Subject: [PATCH 2/4] Add new field to NumericalOptionsDescription Add field enable_fast_compositional. ASIM-5231 --- CHANGELOG.rst | 1 + .../alfacase_definitions/NumericalOptionsDescription.txt | 2 ++ src/alfasim_sdk/_internal/alfacase/alfacase_to_case.py | 1 + src/alfasim_sdk/_internal/alfacase/case_description.py | 1 + src/alfasim_sdk/_internal/alfacase/schema.py | 3 ++- ...case_description_docstring_NumericalOptionsDescription_.txt | 2 ++ .../test_generate_schema_for_all_cases.txt | 1 + .../alfasim_sdk_common_testing/filled_case_descriptions.py | 1 + 8 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 7314dcb1..5a7493a9 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -6,6 +6,7 @@ CHANGELOG =================== * Added support for user plugins have multiple python source files, the "user plugin entry point" logic is unchanged, but extra python code could be placed in `alfasim_sdk_plugins.` and be imported at runtime; +* Added ``enable_fast_compositional`` attribute to ``NumericalOptionsDescription``. 0.18.0 (2023-10-13) diff --git a/docs/source/alfacase_definitions/NumericalOptionsDescription.txt b/docs/source/alfacase_definitions/NumericalOptionsDescription.txt index b4225b6c..fca6348e 100644 --- a/docs/source/alfacase_definitions/NumericalOptionsDescription.txt +++ b/docs/source/alfacase_definitions/NumericalOptionsDescription.txt @@ -18,6 +18,7 @@ caching_rtol: float = 0.01 caching_atol: float = 0.0001 always_repeat_timestep: bool = False + enable_fast_compositional: bool = True .. tab:: Schema @@ -36,3 +37,4 @@ caching_rtol: number # optional caching_atol: number # optional always_repeat_timestep: boolean # optional + enable_fast_compositional: boolean # optional diff --git a/src/alfasim_sdk/_internal/alfacase/alfacase_to_case.py b/src/alfasim_sdk/_internal/alfacase/alfacase_to_case.py index 68e00f45..c36b23e7 100644 --- a/src/alfasim_sdk/_internal/alfacase/alfacase_to_case.py +++ b/src/alfasim_sdk/_internal/alfacase/alfacase_to_case.py @@ -1930,6 +1930,7 @@ def load_numerical_options_description(document: DescriptionDocument) -> case_de 'caching_rtol': load_value, 'caching_atol': load_value, 'always_repeat_timestep': load_value, + 'enable_fast_compositional': load_value } case_values = to_case_values(document, alfacase_to_case_description) item_description = case_description.NumericalOptionsDescription(**case_values) diff --git a/src/alfasim_sdk/_internal/alfacase/case_description.py b/src/alfasim_sdk/_internal/alfacase/case_description.py index 786f452b..f0d93f86 100644 --- a/src/alfasim_sdk/_internal/alfacase/case_description.py +++ b/src/alfasim_sdk/_internal/alfacase/case_description.py @@ -3404,6 +3404,7 @@ class NumericalOptionsDescription: caching_rtol: float = attr.ib(default=1e-2) caching_atol: float = attr.ib(default=1e-4) always_repeat_timestep: bool = attr.ib(default=False, validator=instance_of(bool)) + enable_fast_compositional: bool = attr.ib(default=True, validator=instance_of(bool)) @attr.s() diff --git a/src/alfasim_sdk/_internal/alfacase/schema.py b/src/alfasim_sdk/_internal/alfacase/schema.py index 2a8283ec..c3210e96 100644 --- a/src/alfasim_sdk/_internal/alfacase/schema.py +++ b/src/alfasim_sdk/_internal/alfacase/schema.py @@ -377,6 +377,7 @@ Optional("caching_rtol"): Float(), Optional("caching_atol"): Float(), Optional("always_repeat_timestep"): Bool(), + Optional("enable_fast_compositional"): Bool(), } ) open_hole_description_schema = Map( @@ -1187,4 +1188,4 @@ Optional("walls"): Seq(wall_description_schema), } ) -# [[[end]]] (checksum: 03e5182a9b30c3759affd8fd4852c587) +# [[[end]]] (checksum: 1e7e310e1ec3e70295e333ccdf55e26e) diff --git a/tests/alfacase/test_generate_case_description_docstring/test_generate_case_description_docstring_NumericalOptionsDescription_.txt b/tests/alfacase/test_generate_case_description_docstring/test_generate_case_description_docstring_NumericalOptionsDescription_.txt index b4225b6c..fca6348e 100644 --- a/tests/alfacase/test_generate_case_description_docstring/test_generate_case_description_docstring_NumericalOptionsDescription_.txt +++ b/tests/alfacase/test_generate_case_description_docstring/test_generate_case_description_docstring_NumericalOptionsDescription_.txt @@ -18,6 +18,7 @@ caching_rtol: float = 0.01 caching_atol: float = 0.0001 always_repeat_timestep: bool = False + enable_fast_compositional: bool = True .. tab:: Schema @@ -36,3 +37,4 @@ caching_rtol: number # optional caching_atol: number # optional always_repeat_timestep: boolean # optional + enable_fast_compositional: boolean # optional diff --git a/tests/alfacase/test_generate_case_schema/test_generate_schema_for_all_cases.txt b/tests/alfacase/test_generate_case_schema/test_generate_schema_for_all_cases.txt index 1b351572..637a8def 100644 --- a/tests/alfacase/test_generate_case_schema/test_generate_schema_for_all_cases.txt +++ b/tests/alfacase/test_generate_case_schema/test_generate_schema_for_all_cases.txt @@ -387,6 +387,7 @@ numerical_options_description_schema = Map( Optional("caching_rtol"): Float(), Optional("caching_atol"): Float(), Optional("always_repeat_timestep"): Bool(), + Optional("enable_fast_compositional"): Bool(), } ) diff --git a/tests/common_testing/alfasim_sdk_common_testing/filled_case_descriptions.py b/tests/common_testing/alfasim_sdk_common_testing/filled_case_descriptions.py index 88b1306d..ed1866d3 100644 --- a/tests/common_testing/alfasim_sdk_common_testing/filled_case_descriptions.py +++ b/tests/common_testing/alfasim_sdk_common_testing/filled_case_descriptions.py @@ -707,6 +707,7 @@ caching_rtol=3e-3, caching_atol=4e-4, always_repeat_timestep=False, + enable_fast_compositional=True, ) TRACER_MODEL_CONSTANT_COEFFICIENTS_DESCRIPTION = ( case_description.TracerModelConstantCoefficientsDescription( From 23d653199323c86cbe47808e94d7507b1c943f9c Mon Sep 17 00:00:00 2001 From: Rodrigo Neto Date: Thu, 28 Dec 2023 16:33:27 -0300 Subject: [PATCH 3/4] Update CHANGELOG about release 0.19.0 --- CHANGELOG.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 5a7493a9..806b0bab 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -2,7 +2,7 @@ CHANGELOG ========= -0.19.0 (UNRELEASED) +0.19.0 (2024-01-02) =================== * Added support for user plugins have multiple python source files, the "user plugin entry point" logic is unchanged, but extra python code could be placed in `alfasim_sdk_plugins.` and be imported at runtime; From f7e0b66198e1dc6011c02045925e97b7b39b597c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 8 Jan 2024 16:44:10 +0000 Subject: [PATCH 4/4] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/PyCQA/flake8: 6.1.0 → 7.0.0](https://github.com/PyCQA/flake8/compare/6.1.0...7.0.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5449b27b..dd75236c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -31,7 +31,7 @@ repos: - id: end-of-file-fixer - id: debug-statements - repo: https://github.com/PyCQA/flake8 - rev: 6.1.0 + rev: 7.0.0 hooks: - id: flake8 additional_dependencies: