From 177b51cc3564f68316d633175add5e700b20395d Mon Sep 17 00:00:00 2001 From: Mainak Kundu <94432368+mkundu1@users.noreply.github.com> Date: Thu, 2 Jan 2025 11:39:09 -0500 Subject: [PATCH 1/5] ci: Use stable image version for 25.2 (#3608) * ci: Use stable image version for 25.2 * fix: disable failing tests --- .github/workflows/ci.yml | 15 ++++++--------- tests/test_datamodel_service.py | 2 ++ tests/test_flobject.py | 1 + 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ef0187821db..7e889ee34bd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -442,7 +442,6 @@ jobs: cat src/ansys/fluent/core/generated/fluent_version_251.py python -c "from ansys.fluent.core.generated.solver.settings_251 import SHASH; print(f'SETTINGS_HASH = {SHASH}')" - # Replace v25.2.0 with ${{ vars.FLUENT_STABLE_IMAGE_DEV }} after the first successful nightly test run - name: Cache 25.2 API Code uses: actions/cache@v4 id: cache-252-api-code @@ -453,25 +452,25 @@ jobs: doc/source/api/core/meshing/datamodel doc/source/api/core/solver/tui doc/source/api/core/solver/datamodel - key: API-Code-v${{ env.API_CODE_CACHE }}-${{ steps.version.outputs.PYFLUENT_VERSION }}-v25.2.0-${{ hashFiles('src/ansys/fluent/core/codegen/**') }} - restore-keys: API-Code-v${{ env.API_CODE_CACHE }}-${{ steps.version.outputs.PYFLUENT_VERSION }}-v25.2.0 + key: API-Code-v${{ env.API_CODE_CACHE }}-${{ steps.version.outputs.PYFLUENT_VERSION }}-${{ vars.FLUENT_STABLE_IMAGE_DEV }}-${{ hashFiles('src/ansys/fluent/core/codegen/**') }} + restore-keys: API-Code-v${{ env.API_CODE_CACHE }}-${{ steps.version.outputs.PYFLUENT_VERSION }}-${{ vars.FLUENT_STABLE_IMAGE_DEV }} - name: Pull 25.2 Fluent docker image if: steps.cache-251-api-code.outputs.cache-hit != 'true' run: make docker-pull env: - FLUENT_IMAGE_TAG: v25.2.0 + FLUENT_IMAGE_TAG: ${{ vars.FLUENT_STABLE_IMAGE_DEV }} - name: Run 25.2 API codegen if: steps.cache-252-api-code.outputs.cache-hit != 'true' run: make api-codegen env: - FLUENT_IMAGE_TAG: v25.2.0 + FLUENT_IMAGE_TAG: ${{ vars.FLUENT_STABLE_IMAGE_DEV }} - name: Print 25.2 Fluent version info run: | cat src/ansys/fluent/core/generated/fluent_version_252.py - python -c "from ansys.fluent.core.generated.solver.settings_251 import SHASH; print(f'SETTINGS_HASH = {SHASH}')" + python -c "from ansys.fluent.core.generated.solver.settings_252 import SHASH; print(f'SETTINGS_HASH = {SHASH}')" - name: Install again after codegen run: | @@ -517,9 +516,7 @@ jobs: version: 252 timeout-minutes: 120 env: - # Enable this after the first successful nightly test run - # FLUENT_IMAGE_TAG: ${{ matrix.version == 252 && vars.FLUENT_STABLE_IMAGE_DEV || matrix.image-tag }} - FLUENT_IMAGE_TAG: ${{ matrix.image-tag }} + FLUENT_IMAGE_TAG: ${{ matrix.version == 252 && vars.FLUENT_STABLE_IMAGE_DEV || matrix.image-tag }} steps: diff --git a/tests/test_datamodel_service.py b/tests/test_datamodel_service.py index 289c5bc8a0e..c7e30f916b1 100644 --- a/tests/test_datamodel_service.py +++ b/tests/test_datamodel_service.py @@ -42,6 +42,7 @@ def test_convert_value_to_variant_to_value(value, expected): assert expected == _convert_variant_to_value(variant) +@pytest.mark.skip(reason="https://github.com/ansys/pyfluent/issues/3609") @pytest.mark.fluent_version(">=23.2") @pytest.mark.codegen_required def test_event_subscription(new_meshing_session): @@ -643,6 +644,7 @@ def test_on_affected_at_type_path_lifetime(new_solver_session): assert "/test/affected/A:A1/B-1" not in solver._se_service.subscriptions +@pytest.mark.skip(reason="https://github.com/ansys/pyfluent/issues/3609") @pytest.mark.fluent_version(">=24.2") def test_on_command_executed_lifetime(new_solver_session): solver = new_solver_session diff --git a/tests/test_flobject.py b/tests/test_flobject.py index 6e18db0b350..91ca0248962 100644 --- a/tests/test_flobject.py +++ b/tests/test_flobject.py @@ -814,6 +814,7 @@ def test_find_children_from_fluent_solver_session(static_mixer_settings_session) } +@pytest.mark.skip(reason="https://github.com/ansys/pyfluent/issues/3609") @pytest.mark.fluent_version(">=24.1") def test_settings_wild_card_access(new_solver_session) -> None: solver = new_solver_session From 1641414b4924ef671d5adc20f886bf43d20c830a Mon Sep 17 00:00:00 2001 From: Roberto Pastor Muela <37798125+RobPasMue@users.noreply.github.com> Date: Thu, 2 Jan 2025 18:37:42 +0100 Subject: [PATCH 2/5] feat: allow for pyansys-units dev version (0.4.dev0) (#3606) --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 7905c548519..e8df377dec1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,7 +43,7 @@ python = ">=3.10,<4.0" ansys-api-fluent = "^0.3.30" ansys-platform-instancemanagement = "~=1.0" ansys-tools-filetransfer = ">=0.1,<0.3" -ansys-units = "^0.3.3" +ansys-units = ">=0.3.3,<0.5" docker = ">=7.1.0" grpcio = "^1.30.0" grpcio-health-checking = "^1.30.0" From bc25f4d9564c13441bbfcb3ef886b105ab087501 Mon Sep 17 00:00:00 2001 From: Mainak Kundu <94432368+mkundu1@users.noreply.github.com> Date: Thu, 2 Jan 2025 13:28:37 -0500 Subject: [PATCH 3/5] fix: some issues in datamodel API tests (#3581) * fix: todo * fix: todo * fix: todo * fix: todo * fix: todo * fix: todo * fix: tests * fix: tests --- .../fluent/core/services/datamodel_se.py | 45 +++++++++++-- .../fluent/core/services/datamodel_tui.py | 3 +- src/ansys/fluent/core/solver/flobject.py | 6 +- .../streaming_services/events_streaming.py | 5 +- tests/test_datamodel_api.py | 4 +- tests/test_datamodel_service.py | 42 +++++++++---- tests/test_flobject.py | 1 - tests/test_mapped_api.py | 63 ++++++++----------- 8 files changed, 106 insertions(+), 63 deletions(-) diff --git a/src/ansys/fluent/core/services/datamodel_se.py b/src/ansys/fluent/core/services/datamodel_se.py index 1c6a5404762..7ea577184b3 100644 --- a/src/ansys/fluent/core/services/datamodel_se.py +++ b/src/ansys/fluent/core/services/datamodel_se.py @@ -807,7 +807,7 @@ def add_on_affected_at_type_path( self.event_streaming.register_callback(subscription.tag, obj, cb) return subscription - def add_on_command_executed( + def add_on_command_executed_old( self, rules: str, path: str, command: str, obj, cb: Callable ) -> EventSubscription: """Add on command executed.""" @@ -826,6 +826,24 @@ def add_on_command_executed( self.event_streaming.register_callback(subscription.tag, obj, cb) return subscription + def add_on_command_executed( + self, rules: str, path: str, obj, cb: Callable + ) -> EventSubscription: + """Add on command executed.""" + request_dict = { + "eventrequest": [ + { + "rules": rules, + "commandExecutedEventRequest": { + "path": path, + }, + } + ] + } + subscription = EventSubscription(self, path, request_dict) + self.event_streaming.register_callback(subscription.tag, obj, cb) + return subscription + def add_on_attribute_changed( self, rules: str, path: str, attribute: str, obj, cb: Callable ) -> EventSubscription: @@ -1326,13 +1344,15 @@ def add_on_affected_at_type_path( self.rules, convert_path_to_se_path(self.path), child_type, self, cb ) - def add_on_command_executed(self, command: str, cb: Callable) -> EventSubscription: + def add_on_command_executed_old( + self, command: str, cb: Callable + ) -> EventSubscription: """Register a callback for when a command is executed. Parameters ---------- command : str - command name + Command name cb : Callable Callback function @@ -1341,10 +1361,27 @@ def add_on_command_executed(self, command: str, cb: Callable) -> EventSubscripti EventSubscription EventSubscription instance which can be used to unregister the callback """ - return self.service.add_on_command_executed( + return self.service.add_on_command_executed_old( self.rules, convert_path_to_se_path(self.path), command, self, cb ) + def add_on_command_executed(self, cb: Callable) -> EventSubscription: + """Register a callback for when a command is executed. + + Parameters + ---------- + cb : Callable + Callback function + + Returns + ------- + EventSubscription + EventSubscription instance which can be used to unregister the callback + """ + return self.service.add_on_command_executed( + self.rules, convert_path_to_se_path(self.path), self, cb + ) + class PyParameter(PyStateContainer): """Object class using StateEngine based DatamodelService as backend. diff --git a/src/ansys/fluent/core/services/datamodel_tui.py b/src/ansys/fluent/core/services/datamodel_tui.py index 97a3eeb7f3d..4d10f7a3278 100644 --- a/src/ansys/fluent/core/services/datamodel_tui.py +++ b/src/ansys/fluent/core/services/datamodel_tui.py @@ -172,7 +172,8 @@ def get_static_info(self, path: str): request = DataModelProtoModule.GetStaticInfoRequest() request.path = path response = self._impl.get_static_info(request) - return MessageToDict(response.info, including_default_value_fields=True) + # Note: MessageToDict's parameter names are different in different protobuf versions + return MessageToDict(response.info, True) class PyMenu: diff --git a/src/ansys/fluent/core/solver/flobject.py b/src/ansys/fluent/core/solver/flobject.py index f12645dc7ef..c89d5f6dc91 100644 --- a/src/ansys/fluent/core/solver/flobject.py +++ b/src/ansys/fluent/core/solver/flobject.py @@ -1165,7 +1165,7 @@ def __getattr__(self, name: str): except KeyError as ex: raise AttributeError( allowed_name_error_message( - context=self._state_cls.__name__, + context=self._state_cls._python_name, trial_name=name, allowed_values=self.get_active_child_names(), ) @@ -1366,7 +1366,7 @@ def __getitem__(self, name: str) -> ChildTypeT: ) raise KeyError( allowed_name_error_message( - context=self.__class__.__name__, + context=self.__class__._python_name, trial_name=name, allowed_values=self.get_object_names(), ) @@ -1910,7 +1910,7 @@ def __setitem__(self, name: str, value): else: raise KeyError( allowed_name_error_message( - context=self.__class__.__name__, + context=self.__class__._python_name, trial_name=name, allowed_values=self.get_object_names(), ) diff --git a/src/ansys/fluent/core/streaming_services/events_streaming.py b/src/ansys/fluent/core/streaming_services/events_streaming.py index c0f11dd4879..57f04e5b39f 100644 --- a/src/ansys/fluent/core/streaming_services/events_streaming.py +++ b/src/ansys/fluent/core/streaming_services/events_streaming.py @@ -398,9 +398,8 @@ def _construct_event_info( self, response: EventsProtoModule.BeginStreamingResponse, event: TEvent ): event_info_msg = getattr(response, event.value.lower()) - event_info_dict = MessageToDict( - event_info_msg, including_default_value_fields=True - ) + # Note: MessageToDict's parameter names are different in different protobuf versions + event_info_dict = MessageToDict(event_info_msg, True) solver_event = SolverEvent(event.value) event_info_cls = EventInfoBase.derived_classes.get(solver_event) # Key names can be different, but their order is the same diff --git a/tests/test_datamodel_api.py b/tests/test_datamodel_api.py index a78b4fca9fa..9d08fc138bc 100644 --- a/tests/test_datamodel_api.py +++ b/tests/test_datamodel_api.py @@ -339,7 +339,7 @@ def cb(obj, cmd, args): executed += 1 # TODO: In C++ API, we don't need to pass the command name - subscription = service.add_on_command_executed(app_name, "/", "C", root, cb) + subscription = service.add_on_command_executed(app_name, "/", root, cb) assert executed == 0 assert command is None assert arguments is None @@ -437,7 +437,7 @@ def test_datamodel_api_on_bad_input( app_name, "/", "CC", "isActive", root, lambda _: None ) with pytest.raises(RuntimeError if new_api else SubscribeEventError): # TODO: issue - service.add_on_command_executed(app_name, "/BB", "C", root, lambda _: None) + service.add_on_command_executed(app_name, "/BB", root, lambda _: None) @pytest.mark.fluent_version(">=25.2") diff --git a/tests/test_datamodel_service.py b/tests/test_datamodel_service.py index c7e30f916b1..e92d3f4979d 100644 --- a/tests/test_datamodel_service.py +++ b/tests/test_datamodel_service.py @@ -18,6 +18,7 @@ ) from ansys.fluent.core.streaming_services.datamodel_streaming import DatamodelStream from ansys.fluent.core.utils.execution import timeout_loop +from ansys.fluent.core.utils.fluent_version import FluentVersion @pytest.mark.parametrize( @@ -42,7 +43,6 @@ def test_convert_value_to_variant_to_value(value, expected): assert expected == _convert_variant_to_value(variant) -@pytest.mark.skip(reason="https://github.com/ansys/pyfluent/issues/3609") @pytest.mark.fluent_version(">=23.2") @pytest.mark.codegen_required def test_event_subscription(new_meshing_session): @@ -56,8 +56,13 @@ def test_event_subscription(new_meshing_session): "/workflow/affected/TaskObject", "/workflow/attribute_changed/TaskObject:TaskObject1/TaskList/isActive", "/workflow/command_attribute_changed/InitializeWorkflow/arguments", - "/workflow/command_executed/InitializeWorkflow", ] + version = session.get_fluent_version() + if version < FluentVersion.v252: + tags.append("/workflow/command_executed/InitializeWorkflow") + else: + # TODO: path should be appended to the tag + tags.append("/workflow/command_executed") request = datamodel_se_pb2.SubscribeEventsRequest() e1 = request.eventrequest.add(rules="workflow") e1.createdEventRequest.parentpath = "" @@ -231,9 +236,15 @@ def test_add_on_affected_at_type_path(new_meshing_session): def test_add_on_command_executed(new_meshing_session): meshing = new_meshing_session data = [] - subscription = meshing.meshing.add_on_command_executed( - "ImportGeometry", lambda obj, command, args: data.append(True) - ) + version = meshing.get_fluent_version() + if version < FluentVersion.v252: + subscription = meshing.meshing.add_on_command_executed_old( + "ImportGeometry", lambda obj, command, args: data.append(True) + ) + else: + subscription = meshing.meshing.add_on_command_executed( + lambda obj, command, args: data.append(True) + ) assert data == [] meshing.workflow.InitializeWorkflow(WorkflowType="Watertight Geometry") import_file_name = examples.download_file( @@ -644,7 +655,6 @@ def test_on_affected_at_type_path_lifetime(new_solver_session): assert "/test/affected/A:A1/B-1" not in solver._se_service.subscriptions -@pytest.mark.skip(reason="https://github.com/ansys/pyfluent/issues/3609") @pytest.mark.fluent_version(">=24.2") def test_on_command_executed_lifetime(new_solver_session): solver = new_solver_session @@ -653,16 +663,24 @@ def test_on_command_executed_lifetime(new_solver_session): root = create_root_using_datamodelgen(solver._se_service, app_name) root.A["A1"] = {} data = [] - _ = root.A["A1"].add_on_command_executed("C", lambda *args: data.append(1)) - root.A["A1"].add_on_command_executed("C", lambda *args: data.append(2)) + version = solver.get_fluent_version() + if version < FluentVersion.v252: + _ = root.A["A1"].add_on_command_executed_old("C", lambda *args: data.append(1)) + root.A["A1"].add_on_command_executed_old("C", lambda *args: data.append(2)) + tags = ["/test/command_executed/A:A1/C", "/test/command_executed/A:A1/C-1"] + else: + _ = root.A["A1"].add_on_command_executed(lambda *args: data.append(1)) + root.A["A1"].add_on_command_executed(lambda *args: data.append(2)) + # TODO: path should be appended to the tag + tags = ["/test/command_executed", "/test/command_executed-1"] gc.collect() - assert "/test/command_executed/A:A1/C" in solver._se_service.subscriptions - assert "/test/command_executed/A:A1/C-1" in solver._se_service.subscriptions + for tag in tags: + assert tag in solver._se_service.subscriptions root.A["A1"].C() assert timeout_loop(lambda: data == [1, 2], 5) del root.A["A1"] - assert "/test/command_executed/A:A1/C" not in solver._se_service.subscriptions - assert "/test/command_executed/A:A1/C-1" not in solver._se_service.subscriptions + for tag in tags: + assert tag not in solver._se_service.subscriptions @pytest.mark.fluent_version(">=24.2") diff --git a/tests/test_flobject.py b/tests/test_flobject.py index 91ca0248962..6e18db0b350 100644 --- a/tests/test_flobject.py +++ b/tests/test_flobject.py @@ -814,7 +814,6 @@ def test_find_children_from_fluent_solver_session(static_mixer_settings_session) } -@pytest.mark.skip(reason="https://github.com/ansys/pyfluent/issues/3609") @pytest.mark.fluent_version(">=24.1") def test_settings_wild_card_access(new_solver_session) -> None: solver = new_solver_session diff --git a/tests/test_mapped_api.py b/tests/test_mapped_api.py index 6132bcc33f0..a2f82f81598 100644 --- a/tests/test_mapped_api.py +++ b/tests/test_mapped_api.py @@ -529,7 +529,7 @@ def cb(obj, cmd, args): arguments = args executed = True - subscription = service.add_on_command_executed(app_name, "/", "C", root, cb) + subscription = service.add_on_command_executed(app_name, "/", root, cb) assert not executed assert command is None assert arguments is None @@ -554,13 +554,13 @@ def cb(obj, cmd, args): api_name_rules_str = ( "RULES:\n" - " STRING: __X\n" + " STRING: X__\n" " allowedValues = yes, no\n" " logicalMapping = True, False\n" " attr1 = 42.0\n" " APIName = xxx\n" " END\n" - " STRING: __Y\n" + " STRING: Y__\n" ' allowedValues = \\"1\\", \\"2\\", \\"3\\"\n' ' default = \\"2\\"\n' " isNumerical = True\n" @@ -569,26 +569,26 @@ def cb(obj, cmd, args): " INTEGER: Z\n" " END\n" " SINGLETON: ROOT\n" - " members = __A, B, __E\n" - " commands = __C, D\n" - " SINGLETON: __A\n" - " members = __X\n" + " members = A__, B, E__\n" + " commands = C__, D\n" + " SINGLETON: A__\n" + " members = X__\n" " APIName = aaa\n" " END\n" " OBJECT: B\n" - " members = __Y, Z\n" + " members = Y__, Z\n" " END\n" - " OBJECT: __E\n" - " members = __Y\n" + " OBJECT: E__\n" + " members = Y__\n" " APIName = eee\n" " END\n" - " COMMAND: __C\n" - " arguments = __X\n" + " COMMAND: C__\n" + " arguments = X__\n" " functionName = CFunc\n" " APIName = ccc\n" " END\n" " COMMAND: D\n" - " arguments = __X\n" + " arguments = X__\n" " functionName = CFunc\n" " END\n" " END\n" @@ -618,22 +618,15 @@ def test_datamodel_api_with_mapped_names(datamodel_api_version_new, new_solver_s command_args = [ { - "helpstring": "", "name": "xxx", "type": "Logical", } ] command_args = [sorted(x.items()) for x in command_args] - ccc_args = get_static_info_value( # noqa: F841 - static_info, "/commands/ccc/commandinfo/args" - ) - # TODO: helpstring is not being set - # assert command_args == [sorted(x.items()) for x in ccc_args] - d_args = get_static_info_value( # noqa: F841 - static_info, "/commands/D/commandinfo/args" - ) - # TODO: helpstring is not being returned - # assert command_args == [sorted(x.items()) for x in d_args] + ccc_args = get_static_info_value(static_info, "/commands/ccc/commandinfo/args") + assert command_args == [sorted(x.items()) for x in ccc_args] + d_args = get_static_info_value(static_info, "/commands/D/commandinfo/args") + assert command_args == [sorted(x.items()) for x in d_args] # TODO: what are the equivalent of following tests in Python? @@ -651,7 +644,7 @@ def test_datamodel_api_root_get_and_set_state_with_mapped_names( create_datamodel_root_in_server(solver, api_name_rules_str, app_name) service = solver._se_service assert service.get_state(app_name, "/") == {"aaa": {"xxx": None}} - service.set_state(app_name, "/__A/__X", "yes") + service.set_state(app_name, "/A__/X__", "yes") assert service.get_state(app_name, "/") == {"aaa": {"xxx": True}} service.set_state(app_name, "/", {"aaa": {"xxx": False}}) assert service.get_state(app_name, "/") == {"aaa": {"xxx": False}} @@ -679,12 +672,12 @@ def test_datamodel_api_cmd_args_op_with_mapped_names( create_datamodel_root_in_server(solver, api_name_rules_str, app_name) service = solver._se_service c_name = service.create_command_arguments(app_name, "/", "ccc") - x_path_str = f"/__C:{c_name}/xxx" # noqa: F841 + x_path_str = f"/C__:{c_name}/xxx" # noqa: F841 # TODO: issue # service.set_state(app_name, x_path_str, True) - service.set_state(app_name, f"/__C:{c_name}", {"xxx": True}) - assert service.get_state(app_name, f"/__C:{c_name}") == {"xxx": True} - assert service.get_attribute_value(app_name, f"/__C:{c_name}", "xxx/attr1") == 42.0 + service.set_state(app_name, f"/C__:{c_name}", {"xxx": True}) + assert service.get_state(app_name, f"/C__:{c_name}") == {"xxx": True} + assert service.get_attribute_value(app_name, f"/C__:{c_name}", "xxx/attr1") == 42.0 @pytest.mark.fluent_version(">=25.2") @@ -715,7 +708,6 @@ def test_datamodel_api_delete_object_with_mapped_names( service.delete_object(app_name, "/B:b") -@pytest.mark.skip @pytest.mark.fluent_version(">=25.2") def test_datamodel_api_on_created_on_changed_on_deleted_with_mapped_names( datamodel_api_version_new, new_solver_session @@ -740,23 +732,20 @@ def changed_cb(value): changes.append(value()) service.add_on_child_created(app_name, "/", "eee", root, create_cb) - # TODO: fails at event streaming callback of on_child_created - # as the name "eee" is not available in the PyFluent side. service.set_state(app_name, "/", {"eee:b": {}}) service.set_state(app_name, "/", {"eee:c": {}}) service.set_state(app_name, "/", {"B:d": {}}) service.add_on_deleted(app_name, "/eee:b", root, delete_cb) service.add_on_deleted(app_name, "/eee:c", root, delete_cb) - # TODO: Affected by name mangling of dunder members - service.add_on_changed(app_name, "/eee:b/yyy", root.__E["b"].__Y, changed_cb) + service.add_on_changed(app_name, "/eee:b/yyy", root.eee["b"].yyy, changed_cb) service.delete_object(app_name, "/eee:c") service.set_state(app_name, "/", {"eee:b": {"yyy": 42}}) + timeout_loop(lambda: len(changes) == 1, timeout=5) assert called_paths == ["/eee:b", "/eee:c"] assert delete_count == 1 assert changes == [42] -@pytest.mark.skip @pytest.mark.fluent_version(">=25.2") def test_datamodel_api_on_changed_with_mapped_names( datamodel_api_version_new, new_solver_session @@ -772,9 +761,9 @@ def changed_cb(value): changes.append(value()) service.set_state(app_name, "/", {"eee:b": {}}) - # TODO: Can't get this working due to name mangling of dunder members - service.add_on_changed(app_name, "/eee:b/yyy", root.__E["b"].__Y, changed_cb) + service.add_on_changed(app_name, "/eee:b/yyy", root.eee["b"].yyy, changed_cb) service.set_state(app_name, "/", {"eee:b": {"yyy": 42}}) + timeout_loop(lambda: len(changes) == 1, timeout=5) assert changes == [42] From eea0b1ca268b5966deb5c356206c58fe224d5f41 Mon Sep 17 00:00:00 2001 From: Prithwish Mukherjee <109645853+prmukherj@users.noreply.github.com> Date: Fri, 3 Jan 2025 00:32:12 +0530 Subject: [PATCH 4/5] docs: Update field_info docs. (#3605) --- doc/source/cheatsheet/cheat_sheet.qmd | 2 +- doc/source/user_guide/fields/field_info.rst | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/doc/source/cheatsheet/cheat_sheet.qmd b/doc/source/cheatsheet/cheat_sheet.qmd index 8c6fbc9bdc7..ad017bb4a0d 100644 --- a/doc/source/cheatsheet/cheat_sheet.qmd +++ b/doc/source/cheatsheet/cheat_sheet.qmd @@ -619,7 +619,7 @@ field_info = solver.fields.field_info ### Get fields info and range ```{python} -field_info.get_fields_info() +field_info.get_scalar_fields_info() field_info.get_range("velocity") field_info.get_range("cell-weight") ``` diff --git a/doc/source/user_guide/fields/field_info.rst b/doc/source/user_guide/fields/field_info.rst index 3d38bc5e2e9..f27a0deb4c9 100644 --- a/doc/source/user_guide/fields/field_info.rst +++ b/doc/source/user_guide/fields/field_info.rst @@ -29,19 +29,19 @@ Sample requests Here are the methods for requesting field information: -- ``get_fields_info`` for getting fields information. +- ``get_scalar_fields_info`` for getting fields information. - ``get_range`` for getting the range of the field. - ``get_vector_fields_info`` for getting vector fields information. - ``get_surfaces_info`` for getting the surfaces information. -Get fields info -~~~~~~~~~~~~~~~ +Get scalar fields info +~~~~~~~~~~~~~~~~~~~~~~ You can request the fields information (field name, domain, and section) by -calling the ``get_fields_info`` method. +calling the ``get_scalar_fields_info`` method. .. code-block:: python - >>> field_info.get_fields_info() + >>> field_info.get_scalar_fields_info() {'pressure': {'display_name': 'Static Pressure', 'section': 'Pressure...', 'domain': 'mixture'}, 'pressure-coefficient': {'display_name': 'Pressure Coefficient', 'section': 'Pressure...', 'domain': 'mixture'}, 'dynamic-pressure': {'display_name': 'Dynamic Pressure', 'section': 'Pressure...', 'domain': 'mixture'}, @@ -52,7 +52,7 @@ Get range ~~~~~~~~~ You can request the range (minimum and maximum values) for a given ``field`` by calling the ``get_range`` method. It takes a ``field`` argument which can be obtained -from the keys of the dictionary returned by ``get_fields_info`` method. +from the keys of the dictionary returned by ``get_scalar_fields_info`` method. .. code-block:: python From 7a8f248de78d9c7ccce9f683769484c69aabe275 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 2 Jan 2025 14:03:52 -0500 Subject: [PATCH 5/5] build(deps-dev): update quarto-cli requirement from ==1.6.37 to ==1.6.39 (#3599) Updates the requirements on [quarto-cli](https://github.com/quarto-dev/quarto-cli) to permit the latest version. - [Release notes](https://github.com/quarto-dev/quarto-cli/releases) - [Changelog](https://github.com/quarto-dev/quarto-cli/blob/main/dev-docs/checklist-make-a-new-quarto-release.md) - [Commits](https://github.com/quarto-dev/quarto-cli/compare/v1.6.37...v1.6.39) --- updated-dependencies: - dependency-name: quarto-cli dependency-type: direct:development ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Prithwish Mukherjee <109645853+prmukherj@users.noreply.github.com> --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index e8df377dec1..295c8d17773 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -78,7 +78,7 @@ beautifulsoup4 = "==4.12.3" openpyxl = { version = ">=3.1.5", optional = true } plotly = { version = ">=5.22.0", optional = true } python-pptx = { version = ">=0.6.23", optional = true } -quarto-cli = "==1.6.37" +quarto-cli = "==1.6.39" pdf2image = "==1.17.0" seaborn = { version = ">=0.13.2", optional = true } tensorflow = { version = ">=2.17.0", optional = true }