diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 51c266b..d855e57 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 }} @@ -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 }} @@ -43,55 +43,10 @@ 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 }} @@ -99,10 +54,10 @@ jobs: 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 }} @@ -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 }} @@ -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 }} @@ -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 }} @@ -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 }} diff --git a/doc/source/user_guide.md b/doc/source/user_guide.md index 58b3c06..4f7cc80 100644 --- a/doc/source/user_guide.md +++ b/doc/source/user_guide.md @@ -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 @@ -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. @@ -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 @@ -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: @@ -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. ``` @@ -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 diff --git a/doc/styles/.gitignore b/doc/styles/.gitignore new file mode 100644 index 0000000..62d72f2 --- /dev/null +++ b/doc/styles/.gitignore @@ -0,0 +1,4 @@ +* +!config +!config/** +!.gitignore \ No newline at end of file diff --git a/doc/styles/config/vocabularies/ANSYS/accept.txt b/doc/styles/config/vocabularies/ANSYS/accept.txt new file mode 100644 index 0000000..161c718 --- /dev/null +++ b/doc/styles/config/vocabularies/ANSYS/accept.txt @@ -0,0 +1,8 @@ +(?!)amsys +Workbench +PyMechanical +PyFluent +(?!)github +(?)APIs +(?!)agdb +(?!)run_script diff --git a/doc/styles/styles/Vocab/ANSYS/reject.txt b/doc/styles/config/vocabularies/ANSYS/reject.txt similarity index 100% rename from doc/styles/styles/Vocab/ANSYS/reject.txt rename to doc/styles/config/vocabularies/ANSYS/reject.txt diff --git a/doc/styles/styles/.gitignore b/doc/styles/styles/.gitignore deleted file mode 100644 index 080f12a..0000000 --- a/doc/styles/styles/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -* -!Vocab -!Vocab/** -!.gitignore \ No newline at end of file diff --git a/doc/styles/styles/Vocab/ANSYS/accept.txt b/doc/styles/styles/Vocab/ANSYS/accept.txt deleted file mode 100644 index 6ec0d22..0000000 --- a/doc/styles/styles/Vocab/ANSYS/accept.txt +++ /dev/null @@ -1,6 +0,0 @@ -ANSYS -Ansys -ansys -Workbench -PyMechanical -PyFluent diff --git a/pyproject.toml b/pyproject.toml index 71bd686..69f40b0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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"}] @@ -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",