Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 10 additions & 55 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
name: "Code style"
runs-on: ubuntu-latest
steps:
- uses: ansys/actions/code-style@v5
- uses: ansys/actions/code-style@v6
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}

Expand All @@ -34,7 +34,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: "Running documentation style checks"
uses: ansys/actions/doc-style@v5
uses: ansys/actions/doc-style@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -43,66 +43,21 @@ jobs:
runs-on: ubuntu-latest
needs: [doc-style]
steps:

- name: "Checkout project"
uses: actions/checkout@v4

- name: "Install Python"
uses: actions/setup-python@v5
- uses: ansys/actions/doc-build@v6
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}

- name: "Install project with doc dependencies"
run: |
sudo apt update
sudo apt-get install -y build-essential texlive-latex-extra latexmk texlive-pstricks
python -m pip install .[doc]

- name: "Install custom sphinx-autoapi branch"
run: |
python -m pip install \
"sphinx-autoapi @ git+https://github.com/ansys/sphinx-autoapi@feat/single-page-stable"

- name: "Build HTML documentation"
run: |
make -C doc html

- name: "Build PDF documentation"
run: |
make -C doc pdf

- name: "Upload HTML documentation artifact"
uses: actions/upload-artifact@v3
with:
name: documentation-html
path: doc/_build/html
retention-days: 7

- name: "Upload PDF documentation artifact"
uses: actions/upload-artifact@v3
with:
name: documentation-pdf
path: doc/_build/latex/*.pdf
retention-days: 7

# TODO: restore these step in favor of previous ones this PR is merged
# https://github.com/readthedocs/sphinx-autoapi/pull/399
#
# - uses: ansys/actions/doc-build@v4
# with:
# python-version: ${{ env.MAIN_PYTHON_VERSION }}

build-wheelhouse:
name: "Build wheelhouse for latest Python versions"
runs-on: ${{ matrix.os }}
needs: [code-style]
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ['3.8', '3.9', '3.10', '3.11']
python-version: ['3.9', '3.10', '3.11']
steps:
- name: "Build a wheelhouse for ${{ matrix.python-version }}"
uses: ansys/actions/build-wheelhouse@v5
uses: ansys/actions/build-wheelhouse@v6
with:
library-name: ${{ env.PACKAGE_NAME }}
operating-system: ${{ matrix.os }}
Expand All @@ -113,7 +68,7 @@ jobs:
runs-on: ubuntu-latest
needs: [build-wheelhouse, doc-build]
steps:
- uses: ansys/actions/build-library@v5
- uses: ansys/actions/build-library@v6
with:
library-name: ${{ env.PACKAGE_NAME }}
python-version: ${{ env.MAIN_PYTHON_VERSION }}
Expand All @@ -125,14 +80,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Release to the private PyPI repository
uses: ansys/actions/release-pypi-private@v5
uses: ansys/actions/release-pypi-private@v6
with:
library-name: ${{ env.PACKAGE_NAME }}
twine-username: "__token__"
twine-token: ${{ secrets.PYANSYS_PYPI_PRIVATE_PAT }}

- name: Release to GitHub
uses: ansys/actions/release-github@v5
uses: ansys/actions/release-github@v6
with:
library-name: ${{ env.PACKAGE_NAME }}

Expand All @@ -142,7 +97,7 @@ jobs:
runs-on: ubuntu-latest
needs: doc-build
steps:
- uses: ansys/actions/doc-deploy-dev@v5
- uses: ansys/actions/doc-deploy-dev@v6
with:
cname: ${{ env.DOCUMENTATION_CNAME }}
token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -154,7 +109,7 @@ jobs:
needs: [release]
steps:
- name: Deploy the stable documentation
uses: ansys/actions/doc-deploy-stable@v5
uses: ansys/actions/doc-deploy-stable@v6
with:
cname: ${{ env.DOCUMENTATION_CNAME }}
token: ${{ secrets.GITHUB_TOKEN }}
14 changes: 7 additions & 7 deletions doc/source/user_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ This section provides an overview of the PyWorkbench package, explaining
key concepts and approaches when working with Workbench gRPC service.


### Start Workbench client and connect to a running Workbench server
## Start Workbench client and connect to a running Workbench server
A typical user of Workbench gRPC service starts a Workbench client that connects to
a running Workbench server on cloud, given the server's name/IP and port.
A client-side working directory should be specified. This directory is the default
Expand All @@ -17,7 +17,7 @@ wb = WorkbenchClient(workdir, host, port)
wb.connect()
```

### Launch Workbench server and start a client
## Launch Workbench server and start a client
During development phase or for debugging purpose, it is useful to start Workbench server on the developer's desktop or some computer within the company network.

One can always start a Workbench server by executing command `StartServer()` in any running Workbench session and use the returned server port to start a client, like in the example above.
Expand All @@ -41,7 +41,7 @@ from ansys.workbench.core import launch_workbench
wb = launch_workbench(release='241', server_workdir='path_to_a_dir_on_server', client_workdir='path_to_a_dir_on_client')
```

### Run script/commands/queries on Workbench server
## Run script/commands/queries on Workbench server
IronPython based Workbench scripts containing commands/queries can be executed on the server via
* `run_script_file`, which execute a script file in the client working directory; or
* `run_script_string`, which execute a script contained in the given string
Expand All @@ -57,7 +57,7 @@ These run_script APIs can also be called with different logging levels. The defa
wb.run_script_file('a_script_file_name', log_level='info')
```

### File handling
## File handling
Data files can be uploaded to the server or downloaded from the server, using `upload_file` or `download_file` API. The client-side working directory is used to hold these files unless absolute paths or target directory is specified. There is also a working directory on the server for the same purpose. The server's working directory can be obtained via Workbench query `GetServerWorkingDirectory()` that runs on the server.

For example, this uploads all part files with a given prefix and all agdb files in the working directory, plus another file outside of the working directory, from client to server:
Expand Down Expand Up @@ -101,8 +101,8 @@ All the file handling APIs come with progress bar that is shown by default. One
wb.download_file('solve.out', show_progress=False)
```

### Start other PyANSYS services from systems in a PyWorkbench project
#### PyMechanical
## Start other PyANSYS services from systems in a PyWorkbench project
### PyMechanical
For any mechanical system in the Workbench project, PyMechanical service can be started and connected to from the same client machine.
The following runs a server side script to create a mechanical system, then starts PyMechanical service for the system and establish a PyMechanical client.
```
Expand All @@ -113,7 +113,7 @@ wb_script_result=json.dumps(GetTemplate(TemplateName="Static Structural (ANSYS)"
server_port=wb.start_mechanical_server(system_name=sys_name)
mechanical = launch_mechanical(start_instance=False, ip='localhost', port=server_port)"
```
#### PyFluent
### PyFluent
This example illustrates how to start PyFluent service and client for a Fluent system created in Workbench.
```
import ansys.fluent.core as pyfluent
Expand Down
4 changes: 4 additions & 0 deletions doc/styles/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*
!config
!config/**
!.gitignore
8 changes: 8 additions & 0 deletions doc/styles/config/vocabularies/ANSYS/accept.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
(?!)amsys
Workbench
PyMechanical
PyFluent
(?!)github
(?)APIs
(?!)agdb
(?!)run_script
4 changes: 0 additions & 4 deletions doc/styles/styles/.gitignore

This file was deleted.

6 changes: 0 additions & 6 deletions doc/styles/styles/Vocab/ANSYS/accept.txt

This file was deleted.

7 changes: 2 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ name = "ansys-workbench-core"
version = "0.3.dev0"
description = "A python wrapper for Ansys Workbench"
readme = "README.md"
requires-python = ">=3.8,<4.0"
requires-python = ">=3.9,<4.0"
license = {file = "LICENSE"}
authors = [{name = "ANSYS, Inc.", email = "pyansys.core@ansys.com"}]
maintainers = [{name = "ANSYS, Inc.", email = "pyansys.core@ansys.com"}]
Expand All @@ -35,15 +35,12 @@ dependencies = [
]
[project.optional-dependencies]
doc = [
"ansys-sphinx-theme==0.14.1",
"ansys-sphinx-theme[autoapi]==0.15.2",
"jupyter_sphinx==0.4.0",
"jupytext==1.15.0",
"myst-parser==2.0.0",
"numpydoc==1.6.0",
"Sphinx==7.2.6",
# TODO: use the following for local development until merged into sphinx-autoapi
# "sphinx-autoapi @ git+https://github.com/ansys/sphinx-autoapi@feat/single-page-stable",
"sphinx-autoapi==3.0.0",
"sphinx-autodoc-typehints==1.24.0",
"sphinx-copybutton==0.5.2",
"sphinx_design==0.5.0",
Expand Down