From 8b82efcfefbc9873cdf4ad8cf4ccc2ff6d788903 Mon Sep 17 00:00:00 2001 From: dkunhamb Date: Tue, 18 Jun 2024 13:18:57 -0500 Subject: [PATCH 1/3] remove sec check --- .gitignore | 7 +++++++ doc/source/_templates/autoapi/index.rst | 6 ++++-- doc/source/api/path.rst | 2 +- src/ansys/mechanical/core/embedding/initializer.py | 11 ----------- 4 files changed, 12 insertions(+), 14 deletions(-) diff --git a/.gitignore b/.gitignore index 62c7fb143..28551ae87 100644 --- a/.gitignore +++ b/.gitignore @@ -197,6 +197,13 @@ doc/source/examples/gallery_examples/*/*.rst doc/source/examples/gallery_examples/*/*.pickle doc/source/examples/gallery_examples/**/*.png doc/source/sg_execution_times.rst +# Ignore everything in the doc/source/api/ directory +doc/source/api/* +# This file is for the ansys-tools-path +!doc/source/api/path.rst + +# Examples files downloaded when building docs +examples/embedding_n_remote/download/* # pymechanical-specific mylocal.ip diff --git a/doc/source/_templates/autoapi/index.rst b/doc/source/_templates/autoapi/index.rst index 56e1b02b2..89e6df577 100644 --- a/doc/source/_templates/autoapi/index.rst +++ b/doc/source/_templates/autoapi/index.rst @@ -4,8 +4,7 @@ API reference ============= This section describes {{ project_name }} endpoints, their capabilities, and how -to interact with them programmatically. See the API reference for ``ansys-tools-path`` -`here `_. +to interact with them programmatically. .. toctree:: :titlesonly: @@ -17,4 +16,7 @@ to interact with them programmatically. See the API reference for ``ansys-tools- {% endif %} {% endfor %} +Additionally, see the API references for ``ansys-tools-path`` `here `_ . + + .. vale on \ No newline at end of file diff --git a/doc/source/api/path.rst b/doc/source/api/path.rst index 37351b7f7..db5cc7aad 100644 --- a/doc/source/api/path.rst +++ b/doc/source/api/path.rst @@ -1,6 +1,6 @@ .. _ref_ansys_tools_path_api: -Ansys path tools +Ansys tools path ================ These methods on the ``ansys-tools-path`` module provide helper functions for configuration and discovery diff --git a/src/ansys/mechanical/core/embedding/initializer.py b/src/ansys/mechanical/core/embedding/initializer.py index c92dcd3df..b46d78e2e 100644 --- a/src/ansys/mechanical/core/embedding/initializer.py +++ b/src/ansys/mechanical/core/embedding/initializer.py @@ -47,15 +47,6 @@ def __add_sys_path(version: int) -> str: sys.path.append(str(bin_path.resolve())) -def __disable_sec() -> None: - """SEC is part of RSM and is unstable with embedding. - - I'm not going to debug why that is since we are planning to support - DCS/REP in the future instead of RSM. - """ - os.environ["ANSYS_MECHANICAL_EMBEDDING_NO_SEC"] = "1" - - def __workaround_material_server(version: int) -> None: """Workaround material server bug in 2024 R1. @@ -137,8 +128,6 @@ def initialize(version: int = None): INITIALIZED_VERSION = version - __disable_sec() - __workaround_material_server(version) # need to add system path in order to import the assembly with the resolver From 7c31df165256d33a7fe0852ce0dc3c2aaff8834a Mon Sep 17 00:00:00 2001 From: pyansys-ci-bot Date: Tue, 18 Jun 2024 18:22:45 +0000 Subject: [PATCH 2/3] Adding changelog entry: 776.fixed.md --- doc/changelog.d/776.fixed.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 doc/changelog.d/776.fixed.md diff --git a/doc/changelog.d/776.fixed.md b/doc/changelog.d/776.fixed.md new file mode 100644 index 000000000..5b378ceab --- /dev/null +++ b/doc/changelog.d/776.fixed.md @@ -0,0 +1 @@ +Fix: Remove disable sec check \ No newline at end of file From b1e1b3d240b64685b3ef5efe4a3bad600a15c567 Mon Sep 17 00:00:00 2001 From: dkunhamb Date: Tue, 18 Jun 2024 13:42:37 -0500 Subject: [PATCH 3/3] rsm test --- tests/embedding/test_remote_solve.py | 48 ++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 tests/embedding/test_remote_solve.py diff --git a/tests/embedding/test_remote_solve.py b/tests/embedding/test_remote_solve.py new file mode 100644 index 000000000..afc098661 --- /dev/null +++ b/tests/embedding/test_remote_solve.py @@ -0,0 +1,48 @@ +# Copyright (C) 2022 - 2024 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +"""RSM test.""" + +import pytest + + +@pytest.mark.embedding +@pytest.mark.windows_only +def test_remote_solve(printer, embedded_app, graphics_test_mechdb_file): + """Test to check My Computer Background solve""" + printer(embedded_app) + embedded_app.update_globals(globals()) + embedded_app.open(graphics_test_mechdb_file) + solution = Model.Analyses[0].Solution + solution.ClearGeneratedData() + assert str(solution.Status) == "SolveRequired" + + printer(f"Test My Computer Solve") + solution.Solve(True, "My Computer") + assert str(solution.Status) == "Done" + solution.ClearGeneratedData() + assert str(solution.Status) == "SolveRequired" + + printer(f"Test My Computer Background Solve") + solution.Solve(True, "My Computer, Background") + solution.GetResults() + assert str(solution.Status) == "Done"