Skip to content

Commit

Permalink
MAINT: Update for 24R2 (#810)
Browse files Browse the repository at this point in the history
Co-authored-by: pyansys-ci-bot <[email protected]>
Co-authored-by: Kerry McAdams <[email protected]>
  • Loading branch information
3 people authored Jul 16, 2024
1 parent 1cee148 commit c4bf5e2
Show file tree
Hide file tree
Showing 22 changed files with 83 additions and 83 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
- '242'
- '241'
description: 'The Mechanical revision number to run tests on.'
default: '241' #stable version is 241, must match $stable_container
default: '242' #stable version is 242, must match $stable_container
schedule:
- cron: '00 22 * * *' # UTC time, may start 5-15 mins later than scheduled time
# registry_package:
Expand Down Expand Up @@ -106,13 +106,13 @@ jobs:
name: Save variations of revn
runs-on: ubuntu-latest
outputs:
# ghcr.io/ansys/mechanical:24.1.0
# ghcr.io/ansys/mechanical:24.2.0
stable_container: ${{ steps.save-versions.outputs.stable_container }}
# '241' or '242'
# '242' or '251'
test_revn: '${{ steps.save-versions.outputs.test_revn }}'
# ghcr.io/ansys/mechanical:24.1.0 or ghcr.io/ansys/mechanical:24.2.0
# ghcr.io/ansys/mechanical:24.2.0 or ghcr.io/ansys/mechanical:25.1.0
test_container: ${{ steps.save-versions.outputs.test_container }}
# '24.1.0' or '24.2.0'
# '24.2.0' or '25.1.0'
test_docker_image_version: '${{ steps.save-versions.outputs.test_docker_image_version }}'
steps:
- id: save-versions
Expand All @@ -126,19 +126,19 @@ jobs:
echo "test_docker_image_version=${{ env.DEV_DOCKER_IMAGE_VERSION }}" >> $GITHUB_OUTPUT
else
if [[ -z "${{inputs.revn}}" ]]; then
export mech_revn=241
export mech_revn=242
else
export mech_revn=${{inputs.revn}}
fi
export mech_image_version=${mech_revn:0:2}.${mech_revn:2}.0
echo "test_revn=$mech_revn" >> $GITHUB_OUTPUT
# ghcr.io/ansys/mechanical:24.1.0
# ghcr.io/ansys/mechanical:24.2.0
echo "test_container=${{ env.DOCKER_PACKAGE }}:$mech_image_version" >> $GITHUB_OUTPUT
# 24.1.0
# 24.2.0
echo "test_docker_image_version=$mech_image_version" >> $GITHUB_OUTPUT
fi
echo "stable_container=${{ env.DOCKER_PACKAGE }}:24.1.0" >> $GITHUB_OUTPUT
echo "stable_container=${{ env.DOCKER_PACKAGE }}:24.2.0" >> $GITHUB_OUTPUT
config-matrix:
runs-on: ubuntu-latest
Expand All @@ -150,9 +150,9 @@ jobs:
run: |
# Run all stable mechanical versions release tags
# For nightly scheduled runs use pre-release (25.1_candidate)
# For pull requests and merges use latest stable version (241)
# For pull requests and merges use latest stable version (242)
if ${{ github.event_name == 'push' }} && ${{ contains(github.ref, 'refs/tags') }}; then
echo "matrix={\"mechanical-version\":['23.1.0', '23.2.0', '24.1.0'],\"experimental\":[false]}" >> $GITHUB_OUTPUT
echo "matrix={\"mechanical-version\":['23.2.0', '24.1.0', '24.2.0'],\"experimental\":[false]}" >> $GITHUB_OUTPUT
else
echo "matrix={\"mechanical-version\":['${{ needs.revn-variations.outputs.test_docker_image_version }}'],\"experimental\":[false]}" >> $GITHUB_OUTPUT
fi
Expand Down
7 changes: 3 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,14 @@ Getting started

PyMechanical uses the built-in scripting capabilities of Mechanical. For information on the
scripting APIs available, see the `Scripting in Mechanical Guide
<https://ansyshelp.ansys.com/Views/Secured/corp/v241/en/act_script/act_script.html>`_ in the
<https://ansyshelp.ansys.com/Views/Secured/corp/v242/en/act_script/act_script.html>`_ in the
Ansys Help.

Configuring the mechanical installation
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

On a Windows system, the environment variable ``AWP_ROOT<ver>`` is configured when Mechanical is
installed, where ``<ver>`` is the Mechanical release number, such as ``231`` for release 2023 R1.
installed, where ``<ver>`` is the Mechanical release number, such as ``242`` for release 2024 R2.
PyMechanical automatically uses this environment variable (or variables if there are multiple
installations of different versions) to locate the latest Mechanical installation. On a Linux
system, you must configure the ``AWP_ROOT<ver>`` environment variable to point to the
Expand Down Expand Up @@ -112,8 +112,7 @@ Using an embedded instance of Mechanical as a Python object

PyMechanical also supports directly embedding an instance of Mechanical as a Python object.
In this mode, there is no externally running instance of Mechanical. This feature is supported
on Windows for version 2023 R1 and later, and on Linux for version 2023 R2
and later. Here is an example:
on Windows and Linux for version 2023 R2 and later. Here is an example:

.. code:: python
Expand Down
1 change: 1 addition & 0 deletions doc/changelog.d/810.changed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
MAINT: Update for 24R2
6 changes: 3 additions & 3 deletions doc/source/getting_started/docker.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Launch Mechanical with this code:
.. code::
[email protected]
VERSION=v23.1.0
VERSION=v24.2.0
IMAGE=ghcr.io/ansys/pymechanical/mechanical:$VERSION
docker run -e ANSYSLMD_LICENSE_FILE=$LICENSE_SERVER -p ip:10000:10000 $IMAGE
Expand Down Expand Up @@ -93,8 +93,8 @@ Verify your connection with this code:
>>> mechanical
Ansys Mechanical [Ansys Mechanical Enterprise]
Product Version:231
Software build date:Wednesday, August 10, 2022 4:28:15 PM
Product Version:242
Software build date: 06/03/2024 14:47:58
Additional considerations
-------------------------
Expand Down
20 changes: 10 additions & 10 deletions doc/source/getting_started/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ This package is required to use PyMechanical.
or
>>> find_mechanical(version=231) # for specific version
>>> find_mechanical(version=242) # for specific version
('C:/Program Files/ANSYS Inc/v231/aisol/bin/winx64/AnsysWBU.exe', 23.1) # windows
('/usr/ansys_inc/v231/aisol/.workbench', 23.1) # Linux
('C:/Program Files/ANSYS Inc/v242/aisol/bin/winx64/AnsysWBU.exe', 24.2) # windows
('/usr/ansys_inc/v242/aisol/.workbench', 24.2) # Linux
If you install Ansys in a directory other than the default or typical location,
you can save this directory path using the
Expand All @@ -84,15 +84,15 @@ and ``version_from_path`` functions to verify the path and version.
.. code:: pycon
>>> from ansys.tools.path import save_mechanical_path, find_mechanical
>>> save_mechanical_path("home/username/ansys_inc/v231/aisol/.workbench")
>>> save_mechanical_path("home/username/ansys_inc/v242/aisol/.workbench")
>>> path = get_mechanical_path()
>>> print(path)
/home/username/ansys_inc/v231/aisol/.workbench
/home/username/ansys_inc/v242/aisol/.workbench
>>> version = version_from_path("mechanical", path)
231
242
Verify a remote session
^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -106,8 +106,8 @@ Verify your installation by starting a remote session of Mechanical from Python:
>>> mechanical
Ansys Mechanical [Ansys Mechanical Enterprise]
Product Version:231
Software build date:Wednesday, August 10, 2022 4:28:15 PM
Product Version:242
Software build date: 06/03/2024 14:47:58
If you see a response from the server, you can begin using Mechanical
as a service.
Expand Down Expand Up @@ -137,8 +137,8 @@ Inside of Python, use the following commands to load an embedded instance:
>>> app = App()
>>> print(app)
Ansys Mechanical [Ansys Mechanical Enterprise]
Product Version:232
Software build date: 05/30/2023 15:25:53
Product Version:242
Software build date: 06/03/2024 14:47:58
.. LINKS AND REFERENCES
.. _ansys_tools_path_api: https://github.com/psf/black
Expand Down
16 changes: 8 additions & 8 deletions doc/source/getting_started/running_mechanical.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ Launch Mechanical locally with this code:
>>> mechanical
Ansys Mechanical [Ansys Mechanical Enterprise]
Product Version:231
Software build date:Wednesday, August 10, 2022 4:28:15 PM
Product Version:242
Software build date: 06/03/2024 14:47:58
Launch Mechanical from the command line
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand All @@ -67,7 +67,7 @@ usage, type the following command:
The following example demonstrates the main use of this tool:
$ ansys-mechanical -r 241 -g
$ ansys-mechanical -r 242 -g
Starting Ansys Mechanical version 2024R1 in graphical mode...
Expand Down Expand Up @@ -96,7 +96,7 @@ usage, type the following command:
application when in graphical mode.
--debug Show a debug dialog window at the start of the
process.
-r, --revision INTEGER Ansys Revision number, e.g. "241" or "232". If
-r, --revision INTEGER Ansys Revision number, e.g. "242" or "241". If
none is specified, uses the default from ansys-
tools-path
-g, --graphical Graphical mode
Expand Down Expand Up @@ -168,7 +168,7 @@ for the `launch_mechanical()`_ method.
from ansys.mechanical.core import launch_mechanical
exec_loc = "C:/Program Files/ANSYS Inc/v231/aisol/bin/winx64/AnsysWBU.exe"
exec_loc = "C:/Program Files/ANSYS Inc/v242/aisol/bin/winx64/AnsysWBU.exe"
mechanical = launch_mechanical(exec_loc)
**On Linux**
Expand All @@ -177,7 +177,7 @@ for the `launch_mechanical()`_ method.
from ansys.mechanical.core import launch_mechanical
exec_loc = "/usr/ansys_inc/v231/aisol/.workbench"
exec_loc = "/usr/ansys_inc/v242/aisol/.workbench"
mechanical = launch_mechanical(exec_loc)
If, when using the `launch_mechanical()`_
Expand Down Expand Up @@ -224,8 +224,8 @@ Python code
>>> mechanical = App()
>>> mechanical
Ansys Mechanical [Ansys Mechanical Enterprise]
Product Version:231
Software build date:Wednesday, August 10, 2022 4:28:15 PM
Product Version:242
Software build date: 06/03/2024 14:47:58
Additional information for Linux
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
2 changes: 1 addition & 1 deletion doc/source/links.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
.. _Chapter 7: https://ansyshelp.ansys.com/account/secured?returnurl=/Views/Secured/corp/%%VERSION%%/en/installation/win_silent.html

.. # Mechanical related
.. _ACT API Reference Guide: https://developer.ansys.com/docs/mechanical-scripting-interface/api/ansys/mechanical/stubs/%%VERSION%%/index.md
.. _ACT API Reference Guide: https://developer.ansys.com/docs/mechanical-scripting-interface/api/ansys/mechanical/stubs/v241/index.md #TODO this should be update to 241 when 24r2 api ref gets released
.. _Mechanical API known issues and limitations: https://ansyshelp.ansys.com/account/secured?returnurl=/Views/Secured/corp/%%VERSION%%/en/act_script/mech_apis_KIL.html?q=known%20issues
.. _ACT known issues and limitations: https://ansyshelp.ansys.com/account/secured?returnurl=/Views/Secured/corp/%%VERSION%%/en/act_dev/act_dev_knownissues.html
2 changes: 1 addition & 1 deletion doc/source/user_guide_embedding/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ versions can be specified using ``-r`` flag. Use ``-h`` for more information.

.. code::
"C:/Program Files/ANSYS Inc/v241/aisol/bin/winx64/AnsysWBU.exe -DSApplet -AppModeMech -script file.py"
"C:/Program Files/ANSYS Inc/v242/aisol/bin/winx64/AnsysWBU.exe -DSApplet -AppModeMech -script file.py"
PowerShell users can run the preceding command without including the opening and
closing quotation marks.
Expand Down
4 changes: 2 additions & 2 deletions doc/source/user_guide_embedding/libraries.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ To use the above function, run the following:
from ansys.mechanical.core import App
from ansys.mechanical.core.embedding import add_mechanical_python_libraries
app = App(version=241)
app = App(version=242)
add_mechanical_python_libraries(app)
import materials # This is materials.py that's shipped with Mechanical v241
import materials # This is materials.py that's shipped with Mechanical v242
.. warning::

Expand Down
4 changes: 2 additions & 2 deletions doc/source/user_guide_session/pool.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This code shows how to create a pool with 10 instances:
.. code:: pycon
>>> from ansys.mechanical.core import LocalMechanicalPool
>>> pool = LocalMechanicalPool(10, version="231")
>>> pool = LocalMechanicalPool(10, version="242")
'Mechanical Pool with 10 active instances'
When you are creating a pool, you can supply additional keyword arguments.
Expand All @@ -22,7 +22,7 @@ For example, to restart failed instances, you can set ``restart_failed=True``:
>>> import os
>>> my_path = os.getcmd()
>>> pool = LocalMechanicalPool(10, version="231", restart_failed=True)
>>> pool = LocalMechanicalPool(10, version="242", restart_failed=True)
Creating Pool: 100%|########| 10/10 [00:01<00:00, 1.43it/s]
You can access each individual instance of Mechanical with this code:
Expand Down
12 changes: 6 additions & 6 deletions doc/source/user_guide_session/server-launcher.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ Mechanical executable file.

.. code::
Enter location of Mechanical executable: /usr/ansys_inc/v231/aisol/.workbench
Enter location of Mechanical executable: /usr/ansys_inc/v242/aisol/.workbench
**On Windows**

.. code::
Enter location of Mechanical executable: C:/Program Files/ANSYS Inc/v231/aisol/bin/winx64/AnsysWBU.exe
Enter location of Mechanical executable: C:/Program Files/ANSYS Inc/v242/aisol/bin/winx64/AnsysWBU.exe
The settings file for Mechanical is stored locally. You do not need to enter
the path again. If you must change the path, perhaps to change the default
Expand All @@ -40,7 +40,7 @@ version of Mechanical, run the following:
from ansys.mechanical import core as pymechanical
new_path = "C:/Program Files/ANSYS Inc/v231/aisol/bin/winx64/AnsysWBU.exe"
new_path = "C:/Program Files/ANSYS Inc/v242/aisol/bin/winx64/AnsysWBU.exe"
pymechanical.change_default_mechanical_path(new_path)
For more information, see the `change_default_mechanical_path() <../api/_autosummary/ansys.tools.path.change_default_mechanical_path.html#ansys.tools.path.change_default_mechanical_path>`_
Expand All @@ -55,7 +55,7 @@ Mechanical executable file.
from ansys.mechanical.core import launch_mechanical
mechanical = launch_mechanical(exec_file="/usr/ansys_inc/v231/aisol/.workbench")
mechanical = launch_mechanical(exec_file="/usr/ansys_inc/v242/aisol/.workbench")
**On Windows**

Expand All @@ -64,7 +64,7 @@ Mechanical executable file.
from ansys.mechanical.core import launch_mechanical
mechanical = launch_mechanical(
exec_file="C:\\Program File\\ANSYS Inc\\v231\\aisol\\bin\\winx64\\AnsysWBU.exe"
exec_file="C:\\Program File\\ANSYS Inc\\v242\\aisol\\bin\\winx64\\AnsysWBU.exe"
)
You can use the ``additional_switches`` keyword argument to specify additional arguments.
Expand All @@ -73,7 +73,7 @@ You can use the ``additional_switches`` keyword argument to specify additional a
from ansys.mechanical.core import launch_mechanical
custom_exec = "/usr/ansys_inc/v231/aisol/.workbench"
custom_exec = "/usr/ansys_inc/v242/aisol/.workbench"
add_switch = f"-featureflags mechanical.material.import;"
mechanical = launch_mechanical(additional_switches=add_switch)
Expand Down
10 changes: 5 additions & 5 deletions docker/make_container.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ Requirements

* These files are provided:

* `Dockerfile <https://github.com/ansys/pymechanical/tree/main/docker/231/Dockerfile>`_
* `.dockerignore <https://github.com/ansys/pymechanical/tree/main/docker/231/.dockerignore>`_
* `Dockerfile <https://github.com/ansys/pymechanical/tree/main/docker/242/Dockerfile>`_
* `.dockerignore <https://github.com/ansys/pymechanical/tree/main/docker/242/.dockerignore>`_


Procedure
Expand Down Expand Up @@ -91,7 +91,7 @@ which you should modify to adapt it to your needs.
export ANS_VERSION=${ANS_MAJOR_VERSION}${ANS_MINOR_VERSION}
export TAG=mechanical:${ANS_MAJOR_VERSION}.${ANS_MINOR_VERSION}
# example: if Mechanical v231 is installed under /install/ansys_inc/v231
# example: if Mechanical v242 is installed under /install/ansys_inc/v242
# use /install for path_to_mechanical_installation
export MECHANICAL_INSTALL_LOCATION=/path_to_mechanical_installation/
Expand All @@ -116,10 +116,10 @@ Take note of the these paths:
* ``path_to_mechanical_installation`` is the path to where you have locally installed Mechanical.

Not all installation files are copied. In fact, the files ignored during the copying
are described in the `.dockerignore file <https://github.com/ansys/pymechanical/tree/main/docker/231/.dockerignore>`_.
are described in the `.dockerignore file <https://github.com/ansys/pymechanical/tree/main/docker/242/.dockerignore>`_.

The Docker container configuration needed to build the container is described in the
`Dockerfile <https://github.com/ansys/pymechanical/tree/main/docker/231/Dockerfile>`_.
`Dockerfile <https://github.com/ansys/pymechanical/tree/main/docker/242/Dockerfile>`_.


Summary
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/mechanical/core/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
__version__ = importlib_metadata.version("ansys-mechanical-core")

SUPPORTED_MECHANICAL_VERSIONS = {
242: "2024R2",
241: "2024R1",
232: "2023R2",
231: "2023R1",
}
"""Supported mechanical versions in descending order."""
4 changes: 2 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 @@
INITIALIZED_VERSION = None
"""Constant for the initialized version."""

SUPPORTED_MECHANICAL_EMBEDDING_VERSIONS_WINDOWS = {241: "2024R1", 232: "2023R2", 231: "2023R1"}
SUPPORTED_MECHANICAL_EMBEDDING_VERSIONS_WINDOWS = {242: "2024R2", 241: "2024R1", 232: "2023R2"}
"""Supported Mechanical embedding versions on Windows."""


Expand Down Expand Up @@ -70,7 +70,7 @@ def _get_default_linux_version() -> int:
does not provide a version, the ``find_mechanical()`` function from the ``ansys-tools-path``
package is used to find a version of Mechanical.
"""
supported_versions = [232, 241]
supported_versions = [232, 241, 242]
awp_roots = {ver: os.environ.get(f"AWP_ROOT{ver}", "") for ver in supported_versions}
installed_versions = {
ver: path for ver, path in awp_roots.items() if path and os.path.isdir(path)
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/mechanical/core/embedding/logger/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
from ansys.mechanical.core.embedding.logger import Configuration, Logger
Configuration.configure(level=logging.INFO, to_stdout=True, base_directory=None)
app = mech.App(version=241)
app = mech.App(version=242)
Then, the :class:`Logger <ansys.mechanical.core.embedding.logger.Logger>` class can be used to write messages to the log:
Expand Down
Loading

0 comments on commit c4bf5e2

Please sign in to comment.