Skip to content

Commit

Permalink
Merge branch 'main' into feat/app-lib-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dipinknair authored Apr 11, 2024
2 parents f4c7d67 + 5144c27 commit 4d3abde
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 4 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,9 @@ jobs:
# Make the pdf doc & validate results
make_doc pdf
# Make the pdf doc & validate results
make_doc linkcheck
- name: Upload HTML Documentation
uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -517,6 +520,13 @@ jobs:
name: combined-coverage-results
path: .coverage-combined
retention-days: 7
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: .coverage-combined/xml


package:
name: Package library
Expand Down
2 changes: 0 additions & 2 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
ignore:

comment:
layout: "diff"
behavior: default
Expand Down
1 change: 1 addition & 0 deletions doc/changelog.d/692.changed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Maint: Add code cov report
1 change: 1 addition & 0 deletions doc/changelog.d/693.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Feat: Add link check
1 change: 1 addition & 0 deletions doc/changelog.d/695.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
work around instability in 2024R1
19 changes: 17 additions & 2 deletions src/ansys/mechanical/core/embedding/initializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
SUPPORTED_MECHANICAL_EMBEDDING_VERSIONS_WINDOWS = {241: "2024R1", 232: "2023R2", 231: "2023R1"}


def __add_sys_path(version) -> str:
def __add_sys_path(version: int) -> str:
install_path = Path(os.environ[f"AWP_ROOT{version}"])
platform_string = "winx64" if os.name == "nt" else "linx64"
bin_path = install_path / "aisol" / "bin" / platform_string
Expand All @@ -52,6 +52,19 @@ def __disable_sec() -> None:
os.environ["ANSYS_MECHANICAL_EMBEDDING_NO_SEC"] = "1"


def __workaround_material_server(version: int) -> None:
"""Workaround material server bug in 2024 R1.
A REST server is used as a backend for the material model GUI.
In 2024 R1, this GUI is used even in batch mode. The server
starts by default on a background thread, which may lead to
a race condition on shutdown.
"""
# TODO - remove 242 when that is fixed
if version in [241, 242]:
os.environ["ENGRDATA_SERVER_SERIAL"] = "1"


def _get_default_linux_version() -> int:
"""Try to get the active linux version from the environment.
Expand Down Expand Up @@ -96,7 +109,7 @@ def __check_python_interpreter_architecture():
raise Exception("Mechanical Embedding requires a 64-bit Python environment.")


def initialize(version=None):
def initialize(version: int = None):
"""Initialize Mechanical embedding."""
__check_python_interpreter_architecture() # blocks 32 bit python

Expand All @@ -112,6 +125,8 @@ def initialize(version=None):

__disable_sec()

__workaround_material_server(version)

# need to add system path in order to import the assembly with the resolver
__add_sys_path(version)

Expand Down

0 comments on commit 4d3abde

Please sign in to comment.