Skip to content

Commit

Permalink
Merge branch 'main' into maint/intersphix
Browse files Browse the repository at this point in the history
  • Loading branch information
dipinknair authored Jul 18, 2024
2 parents 016ee2d + 54494d5 commit c8adad8
Show file tree
Hide file tree
Showing 63 changed files with 843 additions and 853 deletions.
47 changes: 20 additions & 27 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 All @@ -35,11 +35,13 @@ env:
DOCUMENTATION_CNAME: mechanical.docs.pyansys.com
MAIN_PYTHON_VERSION: '3.10'
# DEV_REVN & its Docker image are used in scheduled or registry package runs
DEV_REVN: '242'
DEV_DOCKER_IMAGE_VERSION: '24.2_candidate'
DEV_REVN: '251'
DEV_DOCKER_IMAGE_VERSION: '25.1_candidate'
MEILISEARCH_API_KEY: ${{ secrets.MEILISEARCH_API_KEY }}
MEILISEARCH_HOST_URL: ${{ vars.MEILISEARCH_HOST_URL }}
MEILISEARCH_PUBLIC_API_KEY: ${{ secrets.MEILISEARCH_PUBLIC_API_KEY }}
LICENSE_SERVER: ${{ secrets.LICENSE_SERVER }}
ANSYSLMD_LICENSE_FILE: 1055@${{ secrets.LICENSE_SERVER }}

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -104,39 +106,39 @@ 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
run: |
if ${{ github.event_name == 'schedule' }}; then
# 242
echo "test_revn=${{ inputs.mech_revn }}" >> $GITHUB_OUTPUT
# 251
echo "test_revn=${{ env.DEV_REVN}}" >> $GITHUB_OUTPUT
# ghcr.io/ansys/mechanical:24.2_candidate
echo "test_container=${{ env.DOCKER_PACKAGE }}:${{ env.DEV_DOCKER_IMAGE_VERSION }}" >> $GITHUB_OUTPUT
# 24.2_candidate
# 25.1_candidate
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=${{ env.LATEST_STABLE_REVN }}" >> $GITHUB_OUTPUT
# ghcr.io/ansys/mechanical:24.1.0
echo "test_revn=$mech_revn" >> $GITHUB_OUTPUT
# 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 @@ -147,10 +149,10 @@ jobs:
- id: set-matrix
run: |
# Run all stable mechanical versions release tags
# For nightly scheduled runs use pre-release (242_candidate)
# For pull requests and merges use latest stable version (241)
# For nightly scheduled runs use pre-release (25.1_candidate)
# 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 All @@ -173,7 +175,6 @@ jobs:

- name: Pull, launch, and validate Mechanical service
env:
LICENSE_SERVER: ${{ secrets.LICENSE_SERVER }}
MECHANICAL_IMAGE: ${{ env.DOCKER_PACKAGE }}:${{ matrix.mechanical-version }}
run: |
docker pull ${{ env.MECHANICAL_IMAGE }}
Expand Down Expand Up @@ -281,8 +282,6 @@ jobs:
- name: Unit Testing and coverage
env:
LICENSE_SERVER: ${{ secrets.LICENSE_SERVER }}
ANSYSLMD_LICENSE_FILE: 1055@${{ secrets.LICENSE_SERVER }}
ANSYS_WORKBENCH_LOGGING_CONSOLE: 0
ANSYS_WORKBENCH_LOGGING: 0
ANSYS_WORKBENCH_LOGGING_FILTER_LEVEL: 2
Expand Down Expand Up @@ -355,8 +354,6 @@ jobs:
- name: Embedding scripts unit testing and coverage
env:
LICENSE_SERVER: ${{ secrets.LICENSE_SERVER }}
ANSYSLMD_LICENSE_FILE: 1055@${{ secrets.LICENSE_SERVER }}
ANSYS_WORKBENCH_LOGGING_CONSOLE: 0
ANSYS_WORKBENCH_LOGGING: 0
ANSYS_WORKBENCH_LOGGING_FILTER_LEVEL: 2
Expand Down Expand Up @@ -437,8 +434,6 @@ jobs:

- name: Unit Testing and coverage
env:
LICENSE_SERVER: ${{ secrets.LICENSE_SERVER }}
ANSYSLMD_LICENSE_FILE: 1055@${{ secrets.LICENSE_SERVER }}
ANSYS_WORKBENCH_LOGGING_CONSOLE: 0
run: |
unset PYMECHANICAL_PORT
Expand Down Expand Up @@ -509,8 +504,6 @@ jobs:
- name: Build docs
env:
NUM_CORES: 1
LICENSE_SERVER: ${{ secrets.LICENSE_SERVER }}
ANSYSLMD_LICENSE_FILE: 1055@${{ secrets.LICENSE_SERVER }}
ANSYS_WORKBENCH_LOGGING_FILTER_LEVEL: 0
run: |
. /env/bin/activate
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ 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
Expand Down
9 changes: 6 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repos:
- id: black

- repo: https://github.com/adamchainz/blacken-docs
rev: 1.16.0
rev: 1.18.0
hooks:
- id: blacken-docs
additional_dependencies: [black==24.4.2]
Expand All @@ -34,11 +34,14 @@ repos:
args: ["--ignore-words", "doc/styles/config/vocabularies/ANSYS/accept.txt", "-w"]

- repo: https://github.com/ansys/pre-commit-hooks
rev: v0.3.1
rev: v0.4.1
hooks:
- id: add-license-headers
args:
- --start_year=2022
- id: tech-review
args:
- --product=mechanical

- repo: https://github.com/pycqa/pydocstyle
rev: 6.3.0
Expand Down Expand Up @@ -66,7 +69,7 @@ repos:
- id: check-added-large-files

- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.28.6
rev: 0.29.0
hooks:
- id: check-github-workflows

Expand Down
20 changes: 8 additions & 12 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
# Contributors
# Contribute

## Project Lead
Overall guidance on contributing to a PyAnsys library appears in the
[Contributing] topic in the *PyAnsys developer's guide*. Ensure that you
are thoroughly familiar with this guide before attempting to contribute to
PyMechanical.

* [Sam Sangili](https://github.com/samigithub2022)
* [Mohamed Koubaa](https://github.com/koubaa)
The following contribution information is specific to PyMechanical.

## Individual Contributors
[Contributing]: https://dev.docs.pyansys.com/how-to/contributing.html

* [Alexander Kaszynski](https://github.com/akaszynski)
* [Dipin Nair](https://github.com/dipinknair)
* [Kathy Pippert](https://github.com/PipKat)
* [Kerry McAdams](https://github.com/klmcadams)
* [Maxime Rey](https://github.com/MaxJPRey)
* [Revathy Venugopal](https://github.com/Revathyvenugopal162)
* [Roberto Pastor](https://github.com/RobPasMue)
<!-- Begin content specific to your library here. -->
16 changes: 16 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Contributors

## Project Lead

* [Sam Sangili](https://github.com/samigithub2022)
* [Mohamed Koubaa](https://github.com/koubaa)

## Individual Contributors

* [Alexander Kaszynski](https://github.com/akaszynski)
* [Dipin Nair](https://github.com/dipinknair)
* [Kathy Pippert](https://github.com/PipKat)
* [Kerry McAdams](https://github.com/klmcadams)
* [Maxime Rey](https://github.com/MaxJPRey)
* [Revathy Venugopal](https://github.com/Revathyvenugopal162)
* [Roberto Pastor](https://github.com/RobPasMue)
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/760.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FEAT: Add known issues and limitation section
1 change: 1 addition & 0 deletions doc/changelog.d/796.miscellaneous.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
docs: update architecture.rst
1 change: 1 addition & 0 deletions doc/changelog.d/800.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix sentence in architecture file
1 change: 1 addition & 0 deletions doc/changelog.d/801.changed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[pre-commit.ci] pre-commit autoupdate
1 change: 1 addition & 0 deletions doc/changelog.d/802.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
feat: add --script-args argument to ansys-mechanical
1 change: 1 addition & 0 deletions doc/changelog.d/803.changed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
MAINT: Update nightly runs for 251
1 change: 1 addition & 0 deletions doc/changelog.d/804.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FEAT: Update print_tree method
1 change: 1 addition & 0 deletions doc/changelog.d/805.dependencies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
MAINT: Bump the doc group with 2 updates
1 change: 1 addition & 0 deletions doc/changelog.d/806.changed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
MAINT: Refactor CICD
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
1 change: 1 addition & 0 deletions doc/changelog.d/811.changed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
MAINT: update for docker files 24R2
1 change: 1 addition & 0 deletions doc/changelog.d/812.miscellaneous.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fix exception when plotting a model with any line bodies
1 change: 1 addition & 0 deletions doc/changelog.d/814.dependencies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
MAINT: Update dev version of pymechanical
1 change: 1 addition & 0 deletions doc/changelog.d/815.changed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update ACT API Reference Guide link
1 change: 1 addition & 0 deletions doc/changelog.d/818.dependencies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
MAINT: Bump sphinx from 7.3.7 to 7.4.4 in the doc group
1 change: 1 addition & 0 deletions doc/changelog.d/819.changed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[pre-commit.ci] pre-commit autoupdate
1 change: 1 addition & 0 deletions doc/changelog.d/821.dependencies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
MAINT: Update pymech-env
13 changes: 6 additions & 7 deletions doc/source/architecture.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,11 @@ solvers can be integrated into Mechanical and can take advantage of the
powerful meshing, generic CAD reader, and the intuitive pre- and post-
processing experience of Mechanical.

Before discussing how Mechanical's API is implemented, the software design
pattern known as the *command pattern* is explored. This pattern can be used in many
programming languages. For a general description (using the Java programming
language) of the command pattern, see `Command Design Pattern
<https://howtodoinjava.com/design-patterns/behavioral/command-pattern/>`_ in the
*HowToDoInJava* newsletter.
Before discussing how Mechanical's API is implemented, let’s first look at the software design
pattern known as the *command pattern*. You can use this pattern with many programming languages.
For a general description (using the Java programming language) of the command pattern, see
`Command Design Pattern <https://howtodoinjava.com/design-patterns/behavioral/command-pattern/>`_
in the *HowToDoInJava* newsletter.

Command pattern
---------------
Expand Down Expand Up @@ -222,4 +221,4 @@ Python.
.. [#f4] *Undo* and *redo* are often implemented using a command pattern. They store all executed commands in a stack. Each command not only has the ability to execute, it also has the ability to undo itself. Undo and redo are then implemented by walking up and down the stack and executing the Command or its inverse function.
.. [#f5] The Internet Protocol (IP) model is a layered description and specification that describes how information moves on the internet.
.. [#f6] Actually, for normal procedure calls within an address space, there needs to be a similar handshake about how the inputs and arguments are passed. This is called a calling convention, and describes what to do with CPU registers.
.. [#f7] HTTPS, HTTP/2, and HTTP/3.
.. [#f7] HTTPS, HTTP/2, and HTTP/3.
1 change: 1 addition & 0 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ def intersphinx_pymechanical(switcher_version: str):
"https://ansysaccount.b2clogin.com/*",
"https://answers.microsoft.com/en-us/windows/forum/all/*",
"https://download.ansys.com/*",
"https://support.ansys.com/*",
"../api/*", # Remove this after release 0.10.12
"path.html",
]
Expand Down
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
Loading

0 comments on commit c8adad8

Please sign in to comment.