Skip to content

Commit

Permalink
Fix: Remove disable sec check (#776)
Browse files Browse the repository at this point in the history
Co-authored-by: pyansys-ci-bot <[email protected]>
  • Loading branch information
dipinknair and pyansys-ci-bot authored Jun 18, 2024
1 parent d44a32b commit 0fca484
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 14 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions doc/changelog.d/776.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix: Remove disable sec check
6 changes: 4 additions & 2 deletions doc/source/_templates/autoapi/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <path.html>`_.
to interact with them programmatically.

.. toctree::
:titlesonly:
Expand All @@ -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 <path.html>`_ .


.. vale on
2 changes: 1 addition & 1 deletion doc/source/api/path.rst
Original file line number Diff line number Diff line change
@@ -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
Expand Down
11 changes: 0 additions & 11 deletions src/ansys/mechanical/core/embedding/initializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
48 changes: 48 additions & 0 deletions tests/embedding/test_remote_solve.py
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit 0fca484

Please sign in to comment.