Skip to content

Commit

Permalink
Merge branch 'main' into feat/subprocess-coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
dipinknair authored Jan 9, 2025
2 parents 415c5de + d0a6b55 commit ce7ec1b
Show file tree
Hide file tree
Showing 86 changed files with 413 additions and 222 deletions.
54 changes: 28 additions & 26 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ on:
revn:
type: choice
options:
- '252'
- '251'
- '242'
- '241'
- '232'
description: 'The Mechanical revision number to run tests on.'
default: '242' #stable version is 242, must match $stable_container
schedule:
Expand All @@ -33,10 +35,10 @@ env:
DOCKER_MECH_CONTAINER_NAME: mechanical
PACKAGE_NAME: ansys-mechanical-core
DOCUMENTATION_CNAME: mechanical.docs.pyansys.com
MAIN_PYTHON_VERSION: '3.10'
MAIN_PYTHON_VERSION: '3.13'
# DEV_REVN & its Docker image are used in scheduled or registry package runs
DEV_REVN: '251'
DEV_DOCKER_IMAGE_VERSION: '25.1_candidate'
STABLE_REVN: '242'
DEV_REVN: '252'
LICENSE_SERVER: ${{ secrets.LICENSE_SERVER }}
ANSYSLMD_LICENSE_FILE: 1055@${{ secrets.LICENSE_SERVER }}

Expand Down Expand Up @@ -106,7 +108,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.10', '3.11', '3.12']
python-version: ['3.10', '3.11', '3.12', '3.13']
should-release:
- ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags') }}
exclude:
Expand All @@ -124,39 +126,41 @@ jobs:
name: Save variations of revn
runs-on: ubuntu-latest
outputs:
# ghcr.io/ansys/mechanical:24.2.0
stable_container: ${{ steps.save-versions.outputs.stable_container }}
# '242' or '251'
test_revn: '${{ steps.save-versions.outputs.test_revn }}'
# ghcr.io/ansys/mechanical:24.2.0 or ghcr.io/ansys/mechanical:25.1.0
test_container: ${{ steps.save-versions.outputs.test_container }}
# '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
# 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
# 25.1_candidate
echo "test_docker_image_version=${{ env.DEV_DOCKER_IMAGE_VERSION }}" >> $GITHUB_OUTPUT
test_mech_revn=${{ env.DEV_REVN}}
test_mech_image_version=${test_mech_revn:0:2}.${test_mech_revn:2}_candidate
echo "test_container=${{ env.DOCKER_PACKAGE }}:$test_mech_image_version" >> $GITHUB_OUTPUT
echo "test_docker_image_version=$test_mech_image_version" >> $GITHUB_OUTPUT
else
if [[ -z "${{inputs.revn}}" ]]; then
export mech_revn=242
mech_revn=${{ env.STABLE_REVN }}
else
export mech_revn=${{inputs.revn}}
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.2.0
echo "test_container=${{ env.DOCKER_PACKAGE }}:$mech_image_version" >> $GITHUB_OUTPUT
# 24.2.0
echo "test_docker_image_version=$mech_image_version" >> $GITHUB_OUTPUT
fi
echo "stable_container=${{ env.DOCKER_PACKAGE }}:24.2.0" >> $GITHUB_OUTPUT
stable_mech_revn=${{ env.STABLE_REVN }}
stable_mech_image_version=${mech_revn:0:2}.${mech_revn:2}.0
echo "stable_container=${{ env.DOCKER_PACKAGE }}:$stable_mech_image_version" >> $GITHUB_OUTPUT
echo $GITHUB_OUTPUT
# --- Help ----
# schedule nightly uses DEV_REVN candidate
# PRs and merges use STABLE_REVN
# Workflow dispatch can use any revision number
config-matrix:
runs-on: ubuntu-latest
Expand All @@ -166,9 +170,7 @@ jobs:
steps:
- id: set-matrix
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 (242)
# if a tag(release) is pushed, test all versions
if ${{ github.event_name == 'push' }} && ${{ contains(github.ref, 'refs/tags') }}; then
echo "matrix={\"mechanical-version\":['23.2.0', '24.1.0', '24.2.0'],\"experimental\":[false]}" >> $GITHUB_OUTPUT
else
Expand All @@ -184,8 +186,8 @@ jobs:
run: |
sudo apt update
sudo apt install bc -y
CONTAINER_VERSION=$(echo "${{ needs.revn-variations.outputs.test_docker_image_version }}" | grep -o -E '[0-9]+(\.[0-9]+)?' | head -n 1)
if (( $(echo "$CONTAINER_VERSION > 24.2" | bc -l) )); then
container_version=$(echo "${{ needs.revn-variations.outputs.test_docker_image_version }}" | grep -o -E '[0-9]+(\.[0-9]+)?' | head -n 1)
if (( $(echo "$container_version > 24.2" | bc -l) )); then
echo "container_stable_exit=true" >> $GITHUB_OUTPUT
else
echo "container_stable_exit=false" >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -292,7 +294,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.10', '3.11', '3.12']
python-version: ['3.10', '3.11', '3.12', '3.13']

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -365,7 +367,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.10', '3.11', '3.12']
python-version: ['3.10', '3.11', '3.12', '3.13']

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -435,7 +437,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.10', '3.11', '3.12']
python-version: ['3.10', '3.11', '3.12', '3.13']

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 - 2024 ANSYS, Inc. and/or its affiliates.
Copyright (c) 2022 - 2025 ANSYS, Inc. and/or its affiliates.

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
Expand Down
1 change: 1 addition & 0 deletions doc/changelog.d/1031.maintenance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
update CHANGELOG for v0.11.11
1 change: 0 additions & 1 deletion doc/changelog.d/983.maintenance.md

This file was deleted.

1 change: 0 additions & 1 deletion doc/changelog.d/984.maintenance.md

This file was deleted.

1 change: 0 additions & 1 deletion doc/changelog.d/985.added.md

This file was deleted.

1 change: 0 additions & 1 deletion doc/changelog.d/986.added.md

This file was deleted.

1 change: 0 additions & 1 deletion doc/changelog.d/988.maintenance.md

This file was deleted.

1 change: 0 additions & 1 deletion doc/changelog.d/990.maintenance.md

This file was deleted.

1 change: 0 additions & 1 deletion doc/changelog.d/991.maintenance.md

This file was deleted.

1 change: 0 additions & 1 deletion doc/changelog.d/992.maintenance.md

This file was deleted.

1 change: 0 additions & 1 deletion doc/changelog.d/993.maintenance.md

This file was deleted.

55 changes: 55 additions & 0 deletions doc/source/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,61 @@ This document contains the release notes for the project.
.. towncrier release notes start
`0.11.11 <https://github.com/ansys/pymechanical/releases/tag/v0.11.11>`_ - 2025-01-08
=====================================================================================

Added
^^^^^

- Add tests for transaction `#985 <https://github.com/ansys/pymechanical/pull/985>`_
- Update private app data creation and add tests `#986 <https://github.com/ansys/pymechanical/pull/986>`_
- Update docstring and ``App.save_as()`` `#1001 <https://github.com/ansys/pymechanical/pull/1001>`_
- Update object state for `print_tree()` `#1005 <https://github.com/ansys/pymechanical/pull/1005>`_
- Option to ignore lock file on open `#1007 <https://github.com/ansys/pymechanical/pull/1007>`_
- Add project directory property `#1022 <https://github.com/ansys/pymechanical/pull/1022>`_


Fixed
^^^^^

- Process return code `#1026 <https://github.com/ansys/pymechanical/pull/1026>`_, `#1029 <https://github.com/ansys/pymechanical/pull/1029>`_
- Background App initialization `#1030 <https://github.com/ansys/pymechanical/pull/1030>`_


Miscellaneous
^^^^^^^^^^^^^

- Remove f-string without placeholders and specify exception type. `#1011 <https://github.com/ansys/pymechanical/pull/1011>`_


Documentation
^^^^^^^^^^^^^

- Update docs with new api `#1000 <https://github.com/ansys/pymechanical/pull/1000>`_


Maintenance
^^^^^^^^^^^

- Bump codecov/codecov-action from 4 to 5 `#983 <https://github.com/ansys/pymechanical/pull/983>`_
- update CHANGELOG for v0.11.10 `#984 <https://github.com/ansys/pymechanical/pull/984>`_
- Bump ansys-sphinx-theme[autoapi] from 1.2.1 to 1.2.2 in the doc group `#988 <https://github.com/ansys/pymechanical/pull/988>`_
- Bump grpcio from 1.68.0 to 1.68.1 in the core group `#990 <https://github.com/ansys/pymechanical/pull/990>`_
- Bump pytest from 8.3.3 to 8.3.4 in the tests group `#991 <https://github.com/ansys/pymechanical/pull/991>`_
- Bump the doc group with 2 updates `#992 <https://github.com/ansys/pymechanical/pull/992>`_, `#999 <https://github.com/ansys/pymechanical/pull/999>`_
- pre-commit automatic update `#993 <https://github.com/ansys/pymechanical/pull/993>`_
- Support python 3.13 `#997 <https://github.com/ansys/pymechanical/pull/997>`_
- Bump clr-loader from 0.2.6 to 0.2.7.post0 in the core group `#1003 <https://github.com/ansys/pymechanical/pull/1003>`_
- Bump matplotlib from 3.9.3 to 3.10.0 in the doc group `#1004 <https://github.com/ansys/pymechanical/pull/1004>`_
- Bump the doc group with 3 updates `#1008 <https://github.com/ansys/pymechanical/pull/1008>`_
- Bump psutil from 6.1.0 to 6.1.1 `#1009 <https://github.com/ansys/pymechanical/pull/1009>`_
- Update license headers for 2025 `#1014 <https://github.com/ansys/pymechanical/pull/1014>`_
- Bump ``ansys-mechanical-stubs`` to 0.1.5 and add typehint to DataModel `#1015 <https://github.com/ansys/pymechanical/pull/1015>`_
- Follow pythonic standard for comparison to None. `#1016 <https://github.com/ansys/pymechanical/pull/1016>`_
- Bump grpcio from 1.68.1 to 1.69.0 in the core group `#1020 <https://github.com/ansys/pymechanical/pull/1020>`_
- Bump sphinx-autodoc-typehints from 2.5.0 to 3.0.0 `#1021 <https://github.com/ansys/pymechanical/pull/1021>`_
- Update ngihtly for pre-release version `#1023 <https://github.com/ansys/pymechanical/pull/1023>`_

`0.11.10 <https://github.com/ansys/pymechanical/releases/tag/v0.11.10>`_ - 2024-11-18
=====================================================================================

Expand Down
4 changes: 2 additions & 2 deletions doc/source/getting_started/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Install the package
-------------------

The latest ``ansys.mechanical.core`` package supports Python 3.10 through
Python 3.12 on Windows, Linux, and Mac.
Python 3.13 on Windows, Linux, and Mac.

You should consider installing PyMechanical in a virtual environment.
For more information, see Python's
Expand All @@ -35,7 +35,7 @@ machine architecture from the `Releases page <https://github.com/ansys/pymechani
of the PyMechanical repository.

Each wheelhouse archive contains all the Python wheels necessary to install
PyMechanical from scratch on Windows and Linux for Python 3.10 through Python 3.12. You can install
PyMechanical from scratch on Windows and Linux for Python 3.10 through Python 3.13. You can install
a wheelhouse archive on an isolated system with a fresh Python installation or on a
virtual environment.

Expand Down
29 changes: 26 additions & 3 deletions doc/source/getting_started/running_mechanical.rst
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,17 @@ default port (``10000``), you would use this code to connect to it with this cod
mechanical = Mechanical()
Alternatively, you can use the
`connect_to_mechanical() <../api/ansys/mechanical/core/mechanical/index.html#mechanical.connect_to_mechanical>`_
for same functionality.

.. code:: python
from ansys.mechanical.core import connect_to_mechanical
mechanical = connect_to_mechanical()
Now assume that a remote instance of Mechanical has been started in server mode. To connect to
the computer on your local area network that is running Mechanical, you can use either
an IP address and port or a hostname and port.
Expand All @@ -138,6 +149,12 @@ You would connect to it with this code:
mechanical = Mechanical("192.168.0.1", port=10000)
or

.. code:: python
mechanical = connect_to_mechanical("192.168.0.1", port=10000)
**Hostname and port**

Assume that Mechanical is running remotely at hostname ``myremotemachine`` on port ``10000``.
Expand All @@ -148,6 +165,12 @@ You would connect to it with this code:
mechanical = Mechanical("myremotemachine", port=10000)
or

.. code:: python
mechanical = connect_to_mechanical("myremotemachine", port=10000)
Launching issues
----------------

Expand Down Expand Up @@ -204,9 +227,9 @@ Open a terminal and run the following command:
If the preceding command for your operating system doesn't launch Mechanical, you might have
a variety of issues, including:

- License server setup
- Running behind a VPN
- Missing dependencies
- License server setup
- Running behind a VPN
- Missing dependencies

Embed a Mechanical instance
---------------------------
Expand Down
2 changes: 1 addition & 1 deletion examples/embedding_n_remote/embedding_remote.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2022 - 2024 ANSYS, Inc. and/or its affiliates.
# Copyright (C) 2022 - 2025 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
Expand Down
23 changes: 13 additions & 10 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,23 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
]
dependencies = [
"ansys-api-mechanical==0.1.2",
"ansys-mechanical-env==0.1.8",
"ansys-mechanical-stubs==0.1.4",
"ansys-mechanical-stubs==0.1.5",
"ansys-platform-instancemanagement>=1.0.1",
"ansys-pythonnet>=3.1.0rc2",
"ansys-tools-path>=0.3.1",
"appdirs>=1.4.0",
"click>=8.1.3", # for CLI interface
"clr-loader==0.2.6",
"clr-loader==0.2.7.post0",
"grpcio>=1.30.0",
"protobuf>=3.12.2,<6",
"psutil==6.1.0",
"psutil==6.1.1",
"tqdm>=4.45.0",
"requests>=2,<3",
]
Expand All @@ -53,28 +54,28 @@ tests = [
"pytest==8.3.4",
"pytest-cov==6.0.0",
"pytest-print==1.0.2",
"psutil==6.1.0"
"psutil==6.1.1"
]
doc = [
"sphinx==8.1.3",
"ansys-sphinx-theme[autoapi]==1.2.2",
"grpcio==1.68.1",
"ansys-sphinx-theme[autoapi]==1.2.4",
"grpcio==1.69.0",
"imageio-ffmpeg==0.5.1",
"imageio==2.36.1",
"jupyter_sphinx==0.5.3",
"jupyterlab>=3.2.8",
"matplotlib==3.9.3",
"numpy==2.1.3",
"matplotlib==3.10.0",
"numpy==2.2.1",
"numpydoc==1.8.0",
"pandas==2.2.3",
"panel==1.5.4",
"panel==1.5.5",
"plotly==5.24.1",
"pypandoc==1.14",
"pytest-sphinx==0.6.3",
"pythreejs==2.4.2",
"pyvista>=0.39.1",
"sphinx-autobuild==2024.10.3",
"sphinx-autodoc-typehints==2.5.0",
"sphinx-autodoc-typehints==3.0.0",
"sphinx-copybutton==0.5.2",
"sphinx_design==0.6.1",
"sphinx-gallery==0.18.0",
Expand Down Expand Up @@ -228,13 +229,15 @@ python =
3.10: style,py310-coverage,doc
3.11: style,py311-coverage,doc
3.12: style,py311-coverage,doc
3.13: style,py311-coverage,doc
[testenv]
description = Checks for project unit tests and coverage (if desired)
basepython =
py310: python3.10
py311: python3.11
py312: python3.12
py313: python3.13
py: python3
{style,reformat,doc,build}: python3
passenv = *
Expand Down
Loading

0 comments on commit ce7ec1b

Please sign in to comment.