From adbf1e257eaaff53f352bb2314f6497f0c0db6f5 Mon Sep 17 00:00:00 2001 From: Jorge Martinez Date: Mon, 7 Jul 2025 13:34:03 +0200 Subject: [PATCH 01/64] ci: add workflows --- .github/workflows/ci_cd_pr.yml | 142 +++++++++++++++++++++++++++++++++ 1 file changed, 142 insertions(+) create mode 100644 .github/workflows/ci_cd_pr.yml diff --git a/.github/workflows/ci_cd_pr.yml b/.github/workflows/ci_cd_pr.yml new file mode 100644 index 0000000..c3e9389 --- /dev/null +++ b/.github/workflows/ci_cd_pr.yml @@ -0,0 +1,142 @@ +name: pull-request +on: + pull_request: + types: [opened, reopened, synchronize, edited, labeled, closed] + +env: + MAIN_PYTHON_VERSION: '3.12' + LIBRARY_NAME: 'ansys-lumerical-core' + DOCKER_IMAGE_LUMERICAL: 'ansys-lumerical' + + +permissions: + contents: read + pull-requests: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + + labeler: + name: "Labels" + needs: check-dependabot-pr + permissions: + contents: read + pull-requests: write + runs-on: ubuntu-latest + steps: + + - name: "Checkout project" + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + persist-credentials: false + + - name: "Sync labels" + uses: micnncim/action-label-syncer@3abd5ab72fda571e69fffd97bd4e0033dd5f495c # v1.3.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: "Label pull-request" + # HACK: skip if contributor does not have write permissions (forks) + if: github.event.pull_request.head.repo.full_name == github.repository + uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9 # v5.0.0 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + + changelog-fragment: + name: "Create changelog fragment" + runs-on: ubuntu-latest + needs: labeler + permissions: + contents: read + pull-requests: write + steps: + + - uses: ansys/actions/check-pr-title@v10 + with: + token: ${{ secrets.GITHUB_TOKEN }} + + - uses: ansys/actions/doc-changelog@v10 + with: + token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }} + use-conventional-commits: true + use-default-towncrier-config: true + bot-user: ${{ secrets.PYANSYS_CI_BOT_USERNAME }} + bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }} + + code-style: + name: "Code style" + runs-on: ubuntu-latest + needs: changelog-fragment + steps: + - name: "Run code style checks" + uses: ansys/actions/code-style@v10 + with: + python-version: ${{ env.MAIN_PYTHON_VERSION }} + use-python-cache: false + + doc-style: + name: "Doc style" + runs-on: ubuntu-latest + needs: changelog-fragment + steps: + - uses: ansys/actions/doc-style@v10 + with: + token: ${{ secrets.GITHUB_TOKEN }} + + doc-build: + name: "Doc build" + runs-on: ubuntu-latest + needs: doc-style + steps: + - uses: ansys/actions/doc-build@v10 + with: + skip-install: true + python-version: ${{ env.MAIN_PYTHON_VERSION }} + use-python-cache: false + needs-quarto: true + + wheelhouse: + name: "Wheelhouse / ${{ matrix.os }} / ${{ matrix.python }}" + runs-on: ${{ matrix.os }} + needs: code-style + permissions: + id-token: write + contents: write + strategy: + fail-fast: false + matrix: + os: ['ubuntu-latest', 'windows-latest'] + python: ['3.10', '3.11', '3.12', '3.13'] + steps: + - uses: ansys/actions/build-wheelhouse@v10 + + tests: + name: "Tests" + runs-on: ubuntu-latest + needs: wheelhouse + permissions: + id-token: write + contents: write + steps: + + - name: "Login to GitHub container registry" + uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: "Pull and launch lumerical service" + run: | + docker pull ${{ env.DOCKER_IMAGE_LUMERICAL }} + docker run --detach --name ${{ env.DOCKER_CONTAINER_NAME }} -e LICENSE_SERVER=1055@${{ secrets.LICENSE_SERVER }} + + - name: "Stop the lumerical service" + if: always() + run: | + docker stop ${{ env.DOCKER_CONTAINER_NAME }} + docker logs ${{ env.DOCKER_CONTAINER_NAME }} + docker rm ${{ env.DOCKER_CONTAINER_NAME }} From d5414494a783e239997bcc2cbe89f0f0566e4e7d Mon Sep 17 00:00:00 2001 From: Jorge Martinez Date: Mon, 7 Jul 2025 13:49:40 +0200 Subject: [PATCH 02/64] fix(ci): syntax --- .github/workflows/ci_cd_pr.yml | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci_cd_pr.yml b/.github/workflows/ci_cd_pr.yml index c3e9389..aae9ba5 100644 --- a/.github/workflows/ci_cd_pr.yml +++ b/.github/workflows/ci_cd_pr.yml @@ -6,8 +6,10 @@ on: env: MAIN_PYTHON_VERSION: '3.12' LIBRARY_NAME: 'ansys-lumerical-core' - DOCKER_IMAGE_LUMERICAL: 'ansys-lumerical' - + DOCKER_IMAGE_LUMERICAL_FDTD_SOLVE: 'lumerical-fdtd-solve:latest' + DOCKER_IMAGE_LUMERICAL_UNIFIED: 'lumerical-unified:latest' + DOCKER_CONTAINER_LUMERICAL_FDTD_SOLVE_NAME: 'lumerical-fdtd' + DOCKER_CONTAINER_LUMERICAL_UNIFIED_NAME: 'lumerical-unified' permissions: contents: read @@ -21,7 +23,6 @@ jobs: labeler: name: "Labels" - needs: check-dependabot-pr permissions: contents: read pull-requests: write @@ -129,14 +130,24 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: "Pull and launch lumerical service" + - name: "Pull lumerical services" + run: | + docker pull ${{ env.DOCKER_IMAGE_LUMERICAL_UNIFIED }} + docker pull ${{ env.DOCKER_IMAGE_LUMERICAL_FDTD_SOLVE }} + + - name: "Run lumerical services" run: | - docker pull ${{ env.DOCKER_IMAGE_LUMERICAL }} - docker run --detach --name ${{ env.DOCKER_CONTAINER_NAME }} -e LICENSE_SERVER=1055@${{ secrets.LICENSE_SERVER }} + docker run --detach --name ${{ env.DOCKER_CONTAINER_LUMERICAL_UNIFIED_NAME }} -e LICENSE_SERVER=1055@${{ secrets.LICENSE_SERVER }} + docker run --detach --name ${{ env.DOCKER_CONTAINER_LUMERICAL_FDTD_SOLVE_NAME }} -e LICENSE_SERVER=1055@${{ secrets.LICENSE_SERVER }} - - name: "Stop the lumerical service" + - name: "Stop lumerical services" if: always() run: | - docker stop ${{ env.DOCKER_CONTAINER_NAME }} - docker logs ${{ env.DOCKER_CONTAINER_NAME }} - docker rm ${{ env.DOCKER_CONTAINER_NAME }} + docker stop ${{ env.DOCKER_CONTAINER_LUMERICAL_UNIFIED_NAME }} + docker stop ${{ env.DOCKER_CONTAINER_LUMERICAL_FDTD_SOLVE_NAME }} + + docker logs ${{ env.DOCKER_CONTAINER_LUMERICAL_UNIFIED_NAME }} + docker logs ${{ env.DOCKER_CONTAINER_LUMERICAL_FDTD_SOLVE_NAME }} + + docker rm ${{ env.DOCKER_CONTAINER_LUMERICAL_UNIFIED_NAME }} + docker rm ${{ env.DOCKER_CONTAINER_LUMERICAL_FDTD_SOLVE_NAME }} From 624afc3bfae84eaada776a11159bff9a316d8d69 Mon Sep 17 00:00:00 2001 From: Jorge Martinez Date: Tue, 8 Jul 2025 09:34:28 +0200 Subject: [PATCH 03/64] fix(ci): add labels and labeler strategy --- .github/labeler.yml | 71 +++++++++++++++++++++++++++ .github/labels.yml | 116 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 187 insertions(+) create mode 100644 .github/labeler.yml create mode 100644 .github/labels.yml diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 0000000..42dd074 --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,71 @@ +# This file is required by the the action 'https://github.com/actions/labeler' +# and used in the '.github/workflows/ci_cd_pr.yml' workflow + +# -- Labels based on PR title ------------------------------------------------ +'fix': + - head-branch: ['fix'] + +'enhancement': + - head-branch: ['feat'] + +# -- Documentation labels ---------------------------------------------------- +'docs': + - all: + - changed-files: + - any-glob-to-any-file: ['doc/source/**/*.rst'] + - all-globs-to-all-files: ['!doc/source/examples.rst', '!doc/source/api/**/*.rst', '!doc/styles/**', '!doc/.vale.ini'] + +'docs:api': + - any: + - changed-files: + - any-glob-to-any-file: ['doc/source/api/**/*.rst'] + +'docs:examples': + - any: + - changed-files: + - any-glob-to-any-file: ['examples/**/*.py', 'doc/source/examples.rst'] + +## -- Other labels ------------------------------------------------------------ +'style:code': + - any: + - changed-files: + - any-glob-to-any-file: ['.pre-commit-config.yaml', 'doc/.vale.ini'] + +'docker': + - any: + - changed-files: + - any-glob-to-any-file: ['docker/**'] + +'ci': + - any: + - changed-files: + - any-glob-to-any-file: ['.github/workflows/**'] + +'tests': + - any: + - changed-files: + - any-glob-to-any-file: ['tests/**'] + +# HACK: the following labels are declared with the only purpose of avoiding the +# GitHub labeler bot to remove those. This is a known issue reported in the +# official action/labeler repo https://github.com/actions/labeler/issues/763 + +'ci:skip': + - all: + - changed-files: + - all-globs-to-all-files: ['THIS-NEVER-MATCHES-A-FILE'] + +'docs:skip': + - all: + - changed-files: + - all-globs-to-all-files: ['THIS-NEVER-MATCHES-A-FILE'] + +'tests:skip': + - all: + - changed-files: + - all-globs-to-all-files: ['THIS-NEVER-MATCHES-A-FILE'] + +'blocked': + - all: + - changed-files: + - all-globs-to-all-files: ['THIS-NEVER-MATCHES-A-FILE'] diff --git a/.github/labels.yml b/.github/labels.yml new file mode 100644 index 0000000..c2b5daf --- /dev/null +++ b/.github/labels.yml @@ -0,0 +1,116 @@ +# The labels declared in this file are the ones available +# https://github.com/ansys-internal/pylumerical/labels + +# -- Defects, glitches, and vulnerabilities labels --------------------------- + +- name: 'bug' + description: Defects or glitches reported by users or developers + color: d42a34 + +- name: 'fix' + description: Pull requests related to resolving problems or errors + color: d42a34 + +- name: 'vulnerability' + description: Pull requests related to resolving problems or errors + color: d42a34 + +# -- Style labels ------------------------------------------------------------ + +- name: 'style' + description: Improvements related to general project style + color: dcbeff + +- name: 'style:code' + description: Improvements related to code style + color: dcbeff + +- name: 'style:docs' + description: Improvements related to doc style + color: dcbeff + +- name: 'style:branch-name' + description: Verifies branch name is compliant with PyAnsys guidelines + color: dcbeff + +- name: 'style:skip' + description: Skip style runs in CI/CD + color: dcbeff + +# -- Tests labels ------------------------------------------------------------ + +- name: 'tests' + description: Related with improvements of the test suite + color: ffd8b1 + +- name: 'tests:skip' + description: Skip tests runs in CI/CD + color: ffd8b1 + +# -- Documentation labels ---------------------------------------------------- + +- name: 'docs' + description: Issues related to documentation + color: 0677ba + +- name: 'docs:api' + description: Related to API documentation + color: 0677ba + +- name: 'docs:examples' + description: Related to documentation examples + color: 0677ba + +- name: 'docs:skip' + description: Skip documentation runs in CI/CD + color: 0677ba + +# -- Dependencies labels ----------------------------------------------------- + +- name: 'dependencies' + description: Related with project dependencies + color: fabed4 + +- name: 'dependencies:pyproject' + description: Related with project file dependencies + color: fabed4 + +- name: 'dependencies:ci' + description: Related with pipelines dependencies + color: fabed4 + +# -- CI/CD labels ------------------------------------------------------------ + +- name: 'ci' + description: Pipelines maintenance related + color: a9a9a9 + +- name: 'ci:skip' + description: Skip CI/CD runs + color: a9a9a9 + +# -- Other labels ------------------------------------------------------------ + +- name: 'release' + description: Anything related to an incoming release + color: ffffff + +- name: 'good first issue' + description: Issues suitable for newcomers or those with less experience + color: 62ca50 + +- name: 'enhancement' + description: General improvements to existing features + color: ffd827 + +- name: 'maintenance' + description: Generic maintenance related + color: f78c37 + +- name: 'docker' + description: Docker maintenance related + color: 000075 + +- name: 'blocked' + description: Cannot be completed until other tasks are resolved + color: 000000 From f2687150ee7714b98a5bf7b21b77096b51bee410 Mon Sep 17 00:00:00 2001 From: Jorge Martinez Date: Tue, 8 Jul 2025 09:48:45 +0200 Subject: [PATCH 04/64] fix(changelog): add template --- doc/source/changelog/template | 22 ++++++++++++++++++++++ pyproject.toml | 6 +++--- 2 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 doc/source/changelog/template diff --git a/doc/source/changelog/template b/doc/source/changelog/template new file mode 100644 index 0000000..3ca0146 --- /dev/null +++ b/doc/source/changelog/template @@ -0,0 +1,22 @@ +{% if sections[""] %} + +.. tab-set:: + +{%+ for category, val in definitions.items() if category in sections[""] %} + + .. tab-item:: {{ definitions[category]['name'] }} + + .. list-table:: + :header-rows: 0 + :widths: auto + +{% for text, values in sections[""][category].items() %} + * - {{ text }} + - {{ values|join(', ') }} + +{% endfor %} +{% endfor %} + +{% else %} +No significant changes. +{% endif %} diff --git a/pyproject.toml b/pyproject.toml index 4c7c684..6b9b93a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -102,10 +102,10 @@ show_missing = true [tool.towncrier] package = "ansys.lumerical.core" -directory = "doc/changelog.d" +directory = "doc/source/changelog" filename = "doc/source/changelog.rst" start_string = ".. towncrier release notes start\n" -template = "doc/changelog.d/changelog_template.jinja" +template = "doc/source/changelog/template" title_format = "`{version} `_ - {project_date}" issue_format = "`#{issue} `_" @@ -132,4 +132,4 @@ showcontent = true [[tool.towncrier.type]] directory = "miscellaneous" name = "Miscellaneous" -showcontent = true \ No newline at end of file +showcontent = true From 5cdca51baaf9024426c052bd3a4b672f8709e5b8 Mon Sep 17 00:00:00 2001 From: Jorge Martinez Date: Tue, 8 Jul 2025 14:08:24 +0200 Subject: [PATCH 05/64] fix(changelog): write permissions --- .github/workflows/ci_cd_pr.yml | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci_cd_pr.yml b/.github/workflows/ci_cd_pr.yml index aae9ba5..75f86f3 100644 --- a/.github/workflows/ci_cd_pr.yml +++ b/.github/workflows/ci_cd_pr.yml @@ -48,24 +48,19 @@ jobs: changelog-fragment: name: "Create changelog fragment" - runs-on: ubuntu-latest needs: labeler permissions: - contents: read + contents: write pull-requests: write + runs-on: ubuntu-latest steps: - - - uses: ansys/actions/check-pr-title@v10 - with: - token: ${{ secrets.GITHUB_TOKEN }} - - - uses: ansys/actions/doc-changelog@v10 - with: - token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }} - use-conventional-commits: true - use-default-towncrier-config: true - bot-user: ${{ secrets.PYANSYS_CI_BOT_USERNAME }} - bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }} + - uses: ansys/actions/doc-changelog@v10 + with: + token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }} + use-conventional-commits: true + use-default-towncrier-config: true + bot-user: ${{ secrets.PYANSYS_CI_BOT_USERNAME }} + bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }} code-style: name: "Code style" From f68b82c4ef3b4cb0e0127a1a76c8b262e61fd5be Mon Sep 17 00:00:00 2001 From: Jorge Martinez Date: Tue, 8 Jul 2025 15:59:35 +0200 Subject: [PATCH 06/64] fix(pyproject): towncrier config --- pyproject.toml | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 6b9b93a..b980690 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -106,8 +106,8 @@ directory = "doc/source/changelog" filename = "doc/source/changelog.rst" start_string = ".. towncrier release notes start\n" template = "doc/source/changelog/template" -title_format = "`{version} `_ - {project_date}" -issue_format = "`#{issue} `_" +title_format = "`{version} `_ - {project_date}" +issue_format = "`#{issue} `_" [[tool.towncrier.type]] directory = "added" @@ -115,8 +115,13 @@ name = "Added" showcontent = true [[tool.towncrier.type]] -directory = "changed" -name = "Changed" +directory = "dependencies" +name = "Dependencies" +showcontent = true + +[[tool.towncrier.type]] +directory = "documentation" +name = "Documentation" showcontent = true [[tool.towncrier.type]] @@ -125,11 +130,16 @@ name = "Fixed" showcontent = true [[tool.towncrier.type]] -directory = "dependencies" -name = "Dependencies" +directory = "maintenance" +name = "Maintenance" showcontent = true [[tool.towncrier.type]] directory = "miscellaneous" name = "Miscellaneous" showcontent = true + +[[tool.towncrier.type]] +directory = "test" +name = "Test" +showcontent = true From 9e07cbeb837e41801ef6c3b83998f3d04304406c Mon Sep 17 00:00:00 2001 From: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com> Date: Tue, 8 Jul 2025 14:00:30 +0000 Subject: [PATCH 07/64] chore: adding changelog file 5.maintenance.md [dependabot-skip] --- doc/source/changelog/5.maintenance.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 doc/source/changelog/5.maintenance.md diff --git a/doc/source/changelog/5.maintenance.md b/doc/source/changelog/5.maintenance.md new file mode 100644 index 0000000..daa8aab --- /dev/null +++ b/doc/source/changelog/5.maintenance.md @@ -0,0 +1 @@ +Add workflows \ No newline at end of file From 5b971365f5a802e009c99498a3abf18dd0dd85e0 Mon Sep 17 00:00:00 2001 From: Jorge Martinez Date: Wed, 9 Jul 2025 10:30:26 +0200 Subject: [PATCH 08/64] fix(ci): enable private PyPI --- .github/workflows/ci_cd_pr.yml | 1 + pyproject.toml | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci_cd_pr.yml b/.github/workflows/ci_cd_pr.yml index 75f86f3..4a5e223 100644 --- a/.github/workflows/ci_cd_pr.yml +++ b/.github/workflows/ci_cd_pr.yml @@ -10,6 +10,7 @@ env: DOCKER_IMAGE_LUMERICAL_UNIFIED: 'lumerical-unified:latest' DOCKER_CONTAINER_LUMERICAL_FDTD_SOLVE_NAME: 'lumerical-fdtd' DOCKER_CONTAINER_LUMERICAL_UNIFIED_NAME: 'lumerical-unified' + PIP_EXTRA_INDEX_URL: 'https://${{ secrets.PYANSYS_PYPI_PRIVATE_PAT }}@pkgs.dev.azure.com/pyansys/_packaging/pyansys/pypi/simple/' permissions: contents: read diff --git a/pyproject.toml b/pyproject.toml index b980690..ca877b7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,12 +8,13 @@ dynamic = ["version"] description = "Python interface to Ansys Lumerical" readme = "README.rst" requires-python = ">=3.10,<4" -license = {file = "LICENSE"} +license = "MIT" +license_files = ["LICENSE"] authors=[ - {name="ANSYS, Inc.", email="pyansys.support@ansys.com"} + {name="ANSYS, Inc.", email="pyansys.core@ansys.com"} ] maintainers=[ - {name="PyAnsys developers", email="pyansys.core@ansys.com"} + {name="ANSYS, Inc.", email="pyansys.core@ansys.com"} ] keywords = ["Ansys", "Lumerical", "photonics", "simulation"] classifiers=[ @@ -31,8 +32,7 @@ classifiers=[ dependencies = [ "ansys-api-lumerical", - "numpy >= 2.2.2", - "importlib-metadata >=4.0" + "numpy>=2.2.2", ] [project.optional-dependencies] From 26ec64160844094f2d0de92b16f41154cc4f15b7 Mon Sep 17 00:00:00 2001 From: Jorge Martinez Date: Wed, 9 Jul 2025 10:40:16 +0200 Subject: [PATCH 09/64] fix(ci): wheelhosue --- .github/workflows/ci_cd_pr.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci_cd_pr.yml b/.github/workflows/ci_cd_pr.yml index 4a5e223..ed44574 100644 --- a/.github/workflows/ci_cd_pr.yml +++ b/.github/workflows/ci_cd_pr.yml @@ -109,6 +109,10 @@ jobs: python: ['3.10', '3.11', '3.12', '3.13'] steps: - uses: ansys/actions/build-wheelhouse@v10 + with: + library-name: ${{ env.LIBRARY_NAME }} + operating-system: ${{ matrix.os }} + python-version: ${{ matrix.python-version }} tests: name: "Tests" From 1fb6559c94ae64004f51738b62faad0c3038cff7 Mon Sep 17 00:00:00 2001 From: Jorge Martinez Date: Tue, 15 Jul 2025 08:01:37 +0200 Subject: [PATCH 10/64] fix: code-style --- .github/workflows/ci_cd_pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_cd_pr.yml b/.github/workflows/ci_cd_pr.yml index ed44574..feec1c8 100644 --- a/.github/workflows/ci_cd_pr.yml +++ b/.github/workflows/ci_cd_pr.yml @@ -109,7 +109,7 @@ jobs: python: ['3.10', '3.11', '3.12', '3.13'] steps: - uses: ansys/actions/build-wheelhouse@v10 - with: + with: library-name: ${{ env.LIBRARY_NAME }} operating-system: ${{ matrix.os }} python-version: ${{ matrix.python-version }} From 8a6cb7a96cbe63f42907577a66b623641d1993e3 Mon Sep 17 00:00:00 2001 From: Jorge Martinez Date: Tue, 15 Jul 2025 08:05:13 +0200 Subject: [PATCH 11/64] doc: fix style --- doc/.vale.ini | 5 ++++- doc/source/examples.rst | 3 ++- doc/styles/config/vocabularies/ANSYS/accept.txt | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/doc/.vale.ini b/doc/.vale.ini index 83ed7d0..4b46d55 100644 --- a/doc/.vale.ini +++ b/doc/.vale.ini @@ -26,4 +26,7 @@ Vocab = ANSYS # Apply the following styles BasedOnStyles = Vale, Google -Vale.Terms = NO \ No newline at end of file +Vale.Terms = NO + +TokenIgnores = (\$+[^\n$]+\$+), (:.*:`.*`)|(<.*>) +BlockIgnores = (?s) """([^"]*)""" diff --git a/doc/source/examples.rst b/doc/source/examples.rst index 7a1d109..56065b7 100644 --- a/doc/source/examples.rst +++ b/doc/source/examples.rst @@ -1,5 +1,6 @@ Examples ######## + These examples demonstrate the behavior and usage of PyLumerical. .. code-block:: python @@ -12,4 +13,4 @@ These examples demonstrate the behavior and usage of PyLumerical. y = fdtd.sin(2 * 3.1415 * x) fdtd.plot(x, y) -.. Provide links to the files in doc/source/examples below: \ No newline at end of file +.. Provide links to the files in doc/source/examples below: diff --git a/doc/styles/config/vocabularies/ANSYS/accept.txt b/doc/styles/config/vocabularies/ANSYS/accept.txt index bafe33d..9a81864 100644 --- a/doc/styles/config/vocabularies/ANSYS/accept.txt +++ b/doc/styles/config/vocabularies/ANSYS/accept.txt @@ -3,4 +3,6 @@ ANSYS isort Makefile py -pytest \ No newline at end of file +pytest +lumapi +Lumerical From fc2fdd989d7f0fc3fec370fd26cc001dac3d1fc4 Mon Sep 17 00:00:00 2001 From: Jorge Martinez Date: Tue, 15 Jul 2025 08:14:45 +0200 Subject: [PATCH 12/64] doc: fix style --- doc/.vale.ini | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/doc/.vale.ini b/doc/.vale.ini index 4b46d55..20fe31b 100644 --- a/doc/.vale.ini +++ b/doc/.vale.ini @@ -22,10 +22,15 @@ Packages = Google # Define the Ansys vocabulary Vocab = ANSYS -[*.{md,rst}] +[formats] +# Python + Markdown +py = md + +[*.{py,md,rst}] # Apply the following styles BasedOnStyles = Vale, Google +Google.Headings = NO Vale.Terms = NO TokenIgnores = (\$+[^\n$]+\$+), (:.*:`.*`)|(<.*>) From 3d62e67ab12e8433f9cdf877834e33f01c501dde Mon Sep 17 00:00:00 2001 From: Jorge Martinez Date: Tue, 15 Jul 2025 08:36:18 +0200 Subject: [PATCH 13/64] doc: fix style --- doc/.vale.ini | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/doc/.vale.ini b/doc/.vale.ini index 20fe31b..f296721 100644 --- a/doc/.vale.ini +++ b/doc/.vale.ini @@ -22,11 +22,7 @@ Packages = Google # Define the Ansys vocabulary Vocab = ANSYS -[formats] -# Python + Markdown -py = md - -[*.{py,md,rst}] +[*.{md,rst}] # Apply the following styles BasedOnStyles = Vale, Google From b683a089a8f575e6bfabd3f10f465cd0792c67fb Mon Sep 17 00:00:00 2001 From: Jorge Martinez Date: Tue, 15 Jul 2025 08:43:11 +0200 Subject: [PATCH 14/64] doc: fix style --- doc/.vale.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/.vale.ini b/doc/.vale.ini index f296721..accd4af 100644 --- a/doc/.vale.ini +++ b/doc/.vale.ini @@ -29,5 +29,5 @@ BasedOnStyles = Vale, Google Google.Headings = NO Vale.Terms = NO -TokenIgnores = (\$+[^\n$]+\$+), (:.*:`.*`)|(<.*>) +TokenIgnores = ^\.\. [\w:-]+::[^\n]*\n(?:[ \t]+.*\n)* BlockIgnores = (?s) """([^"]*)""" From 63797f655a471c409ffc434a2aa62e4e575b3fd7 Mon Sep 17 00:00:00 2001 From: Jorge Martinez Date: Tue, 15 Jul 2025 08:48:37 +0200 Subject: [PATCH 15/64] doc: fix style --- doc/styles/config/vocabularies/ANSYS/accept.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/styles/config/vocabularies/ANSYS/accept.txt b/doc/styles/config/vocabularies/ANSYS/accept.txt index 9a81864..39b343b 100644 --- a/doc/styles/config/vocabularies/ANSYS/accept.txt +++ b/doc/styles/config/vocabularies/ANSYS/accept.txt @@ -6,3 +6,4 @@ py pytest lumapi Lumerical +fdtd From 37bd2c87476f40b66127a4f475e60952ef6acf1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Mart=C3=ADnez?= <28702884+jorgepiloto@users.noreply.github.com> Date: Tue, 15 Jul 2025 09:28:15 +0200 Subject: [PATCH 16/64] fix: vale.ini file Co-authored-by: Revathy Venugopal <104772255+Revathyvenugopal162@users.noreply.github.com> --- doc/.vale.ini | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/.vale.ini b/doc/.vale.ini index accd4af..1cad9a2 100644 --- a/doc/.vale.ini +++ b/doc/.vale.ini @@ -28,6 +28,8 @@ Vocab = ANSYS BasedOnStyles = Vale, Google Google.Headings = NO Vale.Terms = NO +Google.Colons = NO +Google.Spacing = NO TokenIgnores = ^\.\. [\w:-]+::[^\n]*\n(?:[ \t]+.*\n)* BlockIgnores = (?s) """([^"]*)""" From 63fe6671112341bcf8531fc42c6268f07b1d6ba4 Mon Sep 17 00:00:00 2001 From: Jorge Martinez Date: Tue, 15 Jul 2025 10:03:17 +0200 Subject: [PATCH 17/64] doc: fix style --- doc/styles/config/vocabularies/ANSYS/accept.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/styles/config/vocabularies/ANSYS/accept.txt b/doc/styles/config/vocabularies/ANSYS/accept.txt index 39b343b..d6793a9 100644 --- a/doc/styles/config/vocabularies/ANSYS/accept.txt +++ b/doc/styles/config/vocabularies/ANSYS/accept.txt @@ -7,3 +7,4 @@ pytest lumapi Lumerical fdtd +linenos From 04a54bbeebcb6fa8dd05aa7e5d64b4edcc8c159b Mon Sep 17 00:00:00 2001 From: Jorge Martinez Date: Tue, 15 Jul 2025 10:18:00 +0200 Subject: [PATCH 18/64] ci: fix syntax --- .github/workflows/ci_cd_pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_cd_pr.yml b/.github/workflows/ci_cd_pr.yml index feec1c8..7080278 100644 --- a/.github/workflows/ci_cd_pr.yml +++ b/.github/workflows/ci_cd_pr.yml @@ -112,7 +112,7 @@ jobs: with: library-name: ${{ env.LIBRARY_NAME }} operating-system: ${{ matrix.os }} - python-version: ${{ matrix.python-version }} + python-version: ${{ matrix.python }} tests: name: "Tests" From 44151595fa0b2fc991601240ab4f59ac699af6d9 Mon Sep 17 00:00:00 2001 From: Jorge Martinez Date: Fri, 18 Jul 2025 09:05:04 +0200 Subject: [PATCH 19/64] ci: run tests --- .github/workflows/ci_cd_pr.yml | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci_cd_pr.yml b/.github/workflows/ci_cd_pr.yml index 7080278..72c1315 100644 --- a/.github/workflows/ci_cd_pr.yml +++ b/.github/workflows/ci_cd_pr.yml @@ -123,6 +123,9 @@ jobs: contents: write steps: + - name: "Checkout project" + uses: actions/checkout@v4 + - name: "Login to GitHub container registry" uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0 with: @@ -133,21 +136,27 @@ jobs: - name: "Pull lumerical services" run: | docker pull ${{ env.DOCKER_IMAGE_LUMERICAL_UNIFIED }} - docker pull ${{ env.DOCKER_IMAGE_LUMERICAL_FDTD_SOLVE }} - name: "Run lumerical services" run: | - docker run --detach --name ${{ env.DOCKER_CONTAINER_LUMERICAL_UNIFIED_NAME }} -e LICENSE_SERVER=1055@${{ secrets.LICENSE_SERVER }} - docker run --detach --name ${{ env.DOCKER_CONTAINER_LUMERICAL_FDTD_SOLVE_NAME }} -e LICENSE_SERVER=1055@${{ secrets.LICENSE_SERVER }} + docker run \ + --detach -it \ + --network="host" \ + --name ${{ env.DOCKER_CONTAINER_LUMERICAL_UNIFIED_NAME }} \ + --env LICENSE_SERVER=1055@${{ secrets.LICENSE_SERVER }} \ + --volume ${PWD}:/home/ansys/pylumerical \ + ${{ env.DOCKER_IMAGE_LUMERICAL_UNIFIED }} + + - name: "Install project" + run: | + docker exec \ + --workdir /home/ansys/pylumerical \ + ${{ env.DOCKER_IMAGE_LUMERICAL_UNIFIED_NAME }} /bin/bash -c \ + "python -m pip install -e .[tests] && pytest tests" - name: "Stop lumerical services" if: always() run: | docker stop ${{ env.DOCKER_CONTAINER_LUMERICAL_UNIFIED_NAME }} - docker stop ${{ env.DOCKER_CONTAINER_LUMERICAL_FDTD_SOLVE_NAME }} - docker logs ${{ env.DOCKER_CONTAINER_LUMERICAL_UNIFIED_NAME }} - docker logs ${{ env.DOCKER_CONTAINER_LUMERICAL_FDTD_SOLVE_NAME }} - docker rm ${{ env.DOCKER_CONTAINER_LUMERICAL_UNIFIED_NAME }} - docker rm ${{ env.DOCKER_CONTAINER_LUMERICAL_FDTD_SOLVE_NAME }} From ab18fb856ef2cb8b6d1f316fd7ef1936018f97b2 Mon Sep 17 00:00:00 2001 From: Jorge Martinez Date: Fri, 18 Jul 2025 09:14:35 +0200 Subject: [PATCH 20/64] fix: classifiers --- pyproject.toml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index ca877b7..fb125e7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,17 +17,15 @@ maintainers=[ {name="ANSYS, Inc.", email="pyansys.core@ansys.com"} ] keywords = ["Ansys", "Lumerical", "photonics", "simulation"] -classifiers=[ +classifiers = [ "Development Status :: 4 - Beta", - "License :: OSI Approved :: MIT License", + "Intended Audience :: Science/Research", + "Topic :: Scientific/Engineering :: Information Analysis", "Operating System :: OS Independent", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", - "Topic :: Software Development :: Libraries", - "Topic :: Scientific/Engineering :: Physics", - "Topic :: Scientific/Engineering :: Information Analysis", ] dependencies = [ From b1da482cad7ffa5abc8928be980791f9a944a2ff Mon Sep 17 00:00:00 2001 From: Luke Queenan Date: Mon, 28 Jul 2025 15:26:55 -0700 Subject: [PATCH 21/64] Remove solve container from test pipeline --- .github/workflows/ci_cd_pr.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci_cd_pr.yml b/.github/workflows/ci_cd_pr.yml index 72c1315..c3c372f 100644 --- a/.github/workflows/ci_cd_pr.yml +++ b/.github/workflows/ci_cd_pr.yml @@ -6,9 +6,7 @@ on: env: MAIN_PYTHON_VERSION: '3.12' LIBRARY_NAME: 'ansys-lumerical-core' - DOCKER_IMAGE_LUMERICAL_FDTD_SOLVE: 'lumerical-fdtd-solve:latest' DOCKER_IMAGE_LUMERICAL_UNIFIED: 'lumerical-unified:latest' - DOCKER_CONTAINER_LUMERICAL_FDTD_SOLVE_NAME: 'lumerical-fdtd' DOCKER_CONTAINER_LUMERICAL_UNIFIED_NAME: 'lumerical-unified' PIP_EXTRA_INDEX_URL: 'https://${{ secrets.PYANSYS_PYPI_PRIVATE_PAT }}@pkgs.dev.azure.com/pyansys/_packaging/pyansys/pypi/simple/' From bcae06e728df201f6e08e89de3381fd2c5024555 Mon Sep 17 00:00:00 2001 From: Luke Queenan Date: Wed, 30 Jul 2025 18:49:45 -0700 Subject: [PATCH 22/64] feat: update CI workflow to include ansys-api-lumerical checkout and rename steps --- .github/workflows/ci_cd_pr.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci_cd_pr.yml b/.github/workflows/ci_cd_pr.yml index c3c372f..67e2d81 100644 --- a/.github/workflows/ci_cd_pr.yml +++ b/.github/workflows/ci_cd_pr.yml @@ -106,6 +106,13 @@ jobs: os: ['ubuntu-latest', 'windows-latest'] python: ['3.10', '3.11', '3.12', '3.13'] steps: + - name: "Checkout ansys-api-lumerical" + uses: actions/checkout@v4 + with: + repository: ansys-internal/ansys-api-lumerical + token: ${{ secrets.GITHUB_TOKEN }} + path: ansys-api-lumerical + - uses: ansys/actions/build-wheelhouse@v10 with: library-name: ${{ env.LIBRARY_NAME }} @@ -121,7 +128,7 @@ jobs: contents: write steps: - - name: "Checkout project" + - name: "Checkout PyLumerical" uses: actions/checkout@v4 - name: "Login to GitHub container registry" @@ -131,11 +138,11 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: "Pull lumerical services" + - name: "Pull Lumerical Unified Container" run: | docker pull ${{ env.DOCKER_IMAGE_LUMERICAL_UNIFIED }} - - name: "Run lumerical services" + - name: "Run Lumerical Unified Container" run: | docker run \ --detach -it \ From 342ed5ad2011a246a75d0ecbf028f3d56969fd7d Mon Sep 17 00:00:00 2001 From: Luke Queenan Date: Wed, 30 Jul 2025 19:03:12 -0700 Subject: [PATCH 23/64] fix: update checkout token for ansys-api-lumerical to use PYANSYS_CI_BOT_TOKEN --- .github/workflows/ci_cd_pr.yml | 2 +- ansys-api-lumerical | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 160000 ansys-api-lumerical diff --git a/.github/workflows/ci_cd_pr.yml b/.github/workflows/ci_cd_pr.yml index 67e2d81..c8a93a1 100644 --- a/.github/workflows/ci_cd_pr.yml +++ b/.github/workflows/ci_cd_pr.yml @@ -110,7 +110,7 @@ jobs: uses: actions/checkout@v4 with: repository: ansys-internal/ansys-api-lumerical - token: ${{ secrets.GITHUB_TOKEN }} + token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }} path: ansys-api-lumerical - uses: ansys/actions/build-wheelhouse@v10 diff --git a/ansys-api-lumerical b/ansys-api-lumerical new file mode 160000 index 0000000..a1ef9bf --- /dev/null +++ b/ansys-api-lumerical @@ -0,0 +1 @@ +Subproject commit a1ef9bfd5b59ce2f13c72f95cfdbcf419b9739b9 From cde270c6139e02693a226df02cd654f89e7c7f5f Mon Sep 17 00:00:00 2001 From: Luke Queenan Date: Wed, 30 Jul 2025 19:08:56 -0700 Subject: [PATCH 24/64] chore: remove ansys-api-lumerical subproject --- ansys-api-lumerical | 1 - 1 file changed, 1 deletion(-) delete mode 160000 ansys-api-lumerical diff --git a/ansys-api-lumerical b/ansys-api-lumerical deleted file mode 160000 index a1ef9bf..0000000 --- a/ansys-api-lumerical +++ /dev/null @@ -1 +0,0 @@ -Subproject commit a1ef9bfd5b59ce2f13c72f95cfdbcf419b9739b9 From a070f589610ca8ceaa7c84410d111133a5aa107a Mon Sep 17 00:00:00 2001 From: Luke Queenan Date: Wed, 30 Jul 2025 19:22:01 -0700 Subject: [PATCH 25/64] feat: add step to install ansys-api-lumerical in editable mode --- .github/workflows/ci_cd_pr.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/ci_cd_pr.yml b/.github/workflows/ci_cd_pr.yml index c8a93a1..4104d4b 100644 --- a/.github/workflows/ci_cd_pr.yml +++ b/.github/workflows/ci_cd_pr.yml @@ -113,6 +113,11 @@ jobs: token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }} path: ansys-api-lumerical + - name: "Install ansys-api-lumerical in editable mode" + run: | + python -m pip install --upgrade pip + python -m pip install -e ./ansys-api-lumerical + - uses: ansys/actions/build-wheelhouse@v10 with: library-name: ${{ env.LIBRARY_NAME }} From 7889c0304cf561d982a3078b755522e2f1a05ada Mon Sep 17 00:00:00 2001 From: Luke Queenan Date: Wed, 30 Jul 2025 19:26:28 -0700 Subject: [PATCH 26/64] fix: update MAIN_PYTHON_VERSION to 3.13 in CI workflow --- .github/workflows/ci_cd_pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_cd_pr.yml b/.github/workflows/ci_cd_pr.yml index 4104d4b..cd872a3 100644 --- a/.github/workflows/ci_cd_pr.yml +++ b/.github/workflows/ci_cd_pr.yml @@ -4,7 +4,7 @@ on: types: [opened, reopened, synchronize, edited, labeled, closed] env: - MAIN_PYTHON_VERSION: '3.12' + MAIN_PYTHON_VERSION: '3.13' LIBRARY_NAME: 'ansys-lumerical-core' DOCKER_IMAGE_LUMERICAL_UNIFIED: 'lumerical-unified:latest' DOCKER_CONTAINER_LUMERICAL_UNIFIED_NAME: 'lumerical-unified' From 01587e96efbf97ccd4793176d9f10c114e0c7825 Mon Sep 17 00:00:00 2001 From: Luke Queenan Date: Wed, 30 Jul 2025 19:41:30 -0700 Subject: [PATCH 27/64] fix: restrict Python version matrix to 3.13 in CI workflow --- .github/workflows/ci_cd_pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_cd_pr.yml b/.github/workflows/ci_cd_pr.yml index cd872a3..eec134a 100644 --- a/.github/workflows/ci_cd_pr.yml +++ b/.github/workflows/ci_cd_pr.yml @@ -104,7 +104,7 @@ jobs: fail-fast: false matrix: os: ['ubuntu-latest', 'windows-latest'] - python: ['3.10', '3.11', '3.12', '3.13'] + python: ['3.13'] steps: - name: "Checkout ansys-api-lumerical" uses: actions/checkout@v4 From 300f19deba515a96cbcfb4f9445a942bbe8aee66 Mon Sep 17 00:00:00 2001 From: Luke Queenan Date: Thu, 31 Jul 2025 09:57:13 -0700 Subject: [PATCH 28/64] refactor: update CI workflow to remove wheelhouse job and streamline ansys-api-lumerical installation --- .github/workflows/ci_cd_pr.yml | 75 +++++++++++++++++++++++----------- 1 file changed, 51 insertions(+), 24 deletions(-) diff --git a/.github/workflows/ci_cd_pr.yml b/.github/workflows/ci_cd_pr.yml index eec134a..a4f8055 100644 --- a/.github/workflows/ci_cd_pr.yml +++ b/.github/workflows/ci_cd_pr.yml @@ -85,26 +85,7 @@ jobs: name: "Doc build" runs-on: ubuntu-latest needs: doc-style - steps: - - uses: ansys/actions/doc-build@v10 - with: - skip-install: true - python-version: ${{ env.MAIN_PYTHON_VERSION }} - use-python-cache: false - needs-quarto: true - wheelhouse: - name: "Wheelhouse / ${{ matrix.os }} / ${{ matrix.python }}" - runs-on: ${{ matrix.os }} - needs: code-style - permissions: - id-token: write - contents: write - strategy: - fail-fast: false - matrix: - os: ['ubuntu-latest', 'windows-latest'] - python: ['3.13'] steps: - name: "Checkout ansys-api-lumerical" uses: actions/checkout@v4 @@ -118,16 +99,48 @@ jobs: python -m pip install --upgrade pip python -m pip install -e ./ansys-api-lumerical - - uses: ansys/actions/build-wheelhouse@v10 + - uses: ansys/actions/doc-build@v10 with: - library-name: ${{ env.LIBRARY_NAME }} - operating-system: ${{ matrix.os }} - python-version: ${{ matrix.python }} + skip-install: true + python-version: ${{ env.MAIN_PYTHON_VERSION }} + use-python-cache: false + needs-quarto: true + + # wheelhouse: + # name: "Wheelhouse / ${{ matrix.os }} / ${{ matrix.python }}" + # runs-on: ${{ matrix.os }} + # needs: code-style + # permissions: + # id-token: write + # contents: write + # strategy: + # fail-fast: false + # matrix: + # os: ['ubuntu-latest', 'windows-latest'] + # python: ['3.13'] + # steps: + # - name: "Checkout ansys-api-lumerical" + # uses: actions/checkout@v4 + # with: + # repository: ansys-internal/ansys-api-lumerical + # token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }} + # path: ansys-api-lumerical + + # - name: "Install ansys-api-lumerical in editable mode" + # run: | + # python -m pip install --upgrade pip + # python -m pip install -e ./ansys-api-lumerical + + # - uses: ansys/actions/build-wheelhouse@v10 + # with: + # library-name: ${{ env.LIBRARY_NAME }} + # operating-system: ${{ matrix.os }} + # python-version: ${{ matrix.python }} tests: name: "Tests" runs-on: ubuntu-latest - needs: wheelhouse + needs: code-style # used to need wheelhouse permissions: id-token: write contents: write @@ -157,6 +170,20 @@ jobs: --volume ${PWD}:/home/ansys/pylumerical \ ${{ env.DOCKER_IMAGE_LUMERICAL_UNIFIED }} + - name: "Checkout ansys-api-lumerical in working directory" + uses: actions/checkout@v4 + with: + repository: ansys-internal/ansys-api-lumerical + token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }} + path: ansys-api-lumerical + + - name: "Install ansys-api-lumerical in editable mode" + run: | + docker exec \ + --workdir /home/ansys/pylumerical \ + ${{ env.DOCKER_IMAGE_LUMERICAL_UNIFIED_NAME }} /bin/bash -c \ + "python -m pip install -e ./ansys-api-lumerical" + - name: "Install project" run: | docker exec \ From 3571ca175c2753d490b7ee421e76e52d90252bca Mon Sep 17 00:00:00 2001 From: Luke Queenan Date: Thu, 31 Jul 2025 10:44:25 -0700 Subject: [PATCH 29/64] fix: update Docker image reference and streamline ansys-api-lumerical checkout in CI workflow --- .github/workflows/ci_cd_pr.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci_cd_pr.yml b/.github/workflows/ci_cd_pr.yml index a4f8055..bbe6d6e 100644 --- a/.github/workflows/ci_cd_pr.yml +++ b/.github/workflows/ci_cd_pr.yml @@ -6,7 +6,7 @@ on: env: MAIN_PYTHON_VERSION: '3.13' LIBRARY_NAME: 'ansys-lumerical-core' - DOCKER_IMAGE_LUMERICAL_UNIFIED: 'lumerical-unified:latest' + DOCKER_IMAGE_LUMERICAL_UNIFIED: 'ghcr.io/ansys-internal/lumerical-unified:latest' DOCKER_CONTAINER_LUMERICAL_UNIFIED_NAME: 'lumerical-unified' PIP_EXTRA_INDEX_URL: 'https://${{ secrets.PYANSYS_PYPI_PRIVATE_PAT }}@pkgs.dev.azure.com/pyansys/_packaging/pyansys/pypi/simple/' @@ -149,6 +149,13 @@ jobs: - name: "Checkout PyLumerical" uses: actions/checkout@v4 + - name: "Checkout ansys-api-lumerical in working directory" + uses: actions/checkout@v4 + with: + repository: ansys-internal/ansys-api-lumerical + token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }} + path: ansys-api-lumerical + - name: "Login to GitHub container registry" uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0 with: @@ -170,13 +177,6 @@ jobs: --volume ${PWD}:/home/ansys/pylumerical \ ${{ env.DOCKER_IMAGE_LUMERICAL_UNIFIED }} - - name: "Checkout ansys-api-lumerical in working directory" - uses: actions/checkout@v4 - with: - repository: ansys-internal/ansys-api-lumerical - token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }} - path: ansys-api-lumerical - - name: "Install ansys-api-lumerical in editable mode" run: | docker exec \ From 49bb46905a8e16db330476cf235924c173a33832 Mon Sep 17 00:00:00 2001 From: Luke Queenan Date: Fri, 1 Aug 2025 08:25:12 -0700 Subject: [PATCH 30/64] add wheelhouse back --- .github/workflows/ci_cd_pr.yml | 60 +++++++++++++++++----------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/.github/workflows/ci_cd_pr.yml b/.github/workflows/ci_cd_pr.yml index bbe6d6e..f21e9db 100644 --- a/.github/workflows/ci_cd_pr.yml +++ b/.github/workflows/ci_cd_pr.yml @@ -106,36 +106,36 @@ jobs: use-python-cache: false needs-quarto: true - # wheelhouse: - # name: "Wheelhouse / ${{ matrix.os }} / ${{ matrix.python }}" - # runs-on: ${{ matrix.os }} - # needs: code-style - # permissions: - # id-token: write - # contents: write - # strategy: - # fail-fast: false - # matrix: - # os: ['ubuntu-latest', 'windows-latest'] - # python: ['3.13'] - # steps: - # - name: "Checkout ansys-api-lumerical" - # uses: actions/checkout@v4 - # with: - # repository: ansys-internal/ansys-api-lumerical - # token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }} - # path: ansys-api-lumerical - - # - name: "Install ansys-api-lumerical in editable mode" - # run: | - # python -m pip install --upgrade pip - # python -m pip install -e ./ansys-api-lumerical - - # - uses: ansys/actions/build-wheelhouse@v10 - # with: - # library-name: ${{ env.LIBRARY_NAME }} - # operating-system: ${{ matrix.os }} - # python-version: ${{ matrix.python }} + wheelhouse: + name: "Wheelhouse / ${{ matrix.os }} / ${{ matrix.python }}" + runs-on: ${{ matrix.os }} + needs: code-style + permissions: + id-token: write + contents: write + strategy: + fail-fast: false + matrix: + os: ['ubuntu-latest', 'windows-latest'] + python: ['3.10', '3.11', '3.12', '3.13'] + steps: + - name: "Checkout ansys-api-lumerical" + uses: actions/checkout@v4 + with: + repository: ansys-internal/ansys-api-lumerical + token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }} + path: ansys-api-lumerical + + - name: "Install ansys-api-lumerical in editable mode" + run: | + python -m pip install --upgrade pip + python -m pip install -e ./ansys-api-lumerical + + - uses: ansys/actions/build-wheelhouse@v10 + with: + library-name: ${{ env.LIBRARY_NAME }} + operating-system: ${{ matrix.os }} + python-version: ${{ matrix.python }} tests: name: "Tests" From f0525a5820e1f060660310c0f9c06ff945dc2ea2 Mon Sep 17 00:00:00 2001 From: Luke Queenan Date: Fri, 1 Aug 2025 12:49:38 -0700 Subject: [PATCH 31/64] enable Python caching in CI workflow for docs --- .github/workflows/ci_cd_pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_cd_pr.yml b/.github/workflows/ci_cd_pr.yml index f21e9db..a1d6f60 100644 --- a/.github/workflows/ci_cd_pr.yml +++ b/.github/workflows/ci_cd_pr.yml @@ -103,7 +103,7 @@ jobs: with: skip-install: true python-version: ${{ env.MAIN_PYTHON_VERSION }} - use-python-cache: false + use-python-cache: true needs-quarto: true wheelhouse: From c93da57d052f167eb74a5a79e3101cdb36092def Mon Sep 17 00:00:00 2001 From: Luke Queenan Date: Fri, 1 Aug 2025 14:09:29 -0700 Subject: [PATCH 32/64] update doc build step to create requirements file instead of installing in editable mode --- .github/workflows/ci_cd_pr.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci_cd_pr.yml b/.github/workflows/ci_cd_pr.yml index a1d6f60..5369303 100644 --- a/.github/workflows/ci_cd_pr.yml +++ b/.github/workflows/ci_cd_pr.yml @@ -94,10 +94,9 @@ jobs: token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }} path: ansys-api-lumerical - - name: "Install ansys-api-lumerical in editable mode" + - name: "Create requirements file for doc build" run: | - python -m pip install --upgrade pip - python -m pip install -e ./ansys-api-lumerical + echo "-e ../ansys-api-lumerical" > doc-requirements.txt - uses: ansys/actions/doc-build@v10 with: @@ -105,6 +104,7 @@ jobs: python-version: ${{ env.MAIN_PYTHON_VERSION }} use-python-cache: true needs-quarto: true + requirements-file: doc-requirements.txt wheelhouse: name: "Wheelhouse / ${{ matrix.os }} / ${{ matrix.python }}" From 69b064d42122c450db39588af26e5f2a9b0bdbae Mon Sep 17 00:00:00 2001 From: Luke Queenan Date: Fri, 1 Aug 2025 14:38:30 -0700 Subject: [PATCH 33/64] update library name and adjust requirements file path in CI workflow --- .github/workflows/ci_cd_pr.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci_cd_pr.yml b/.github/workflows/ci_cd_pr.yml index 5369303..7b4f8e1 100644 --- a/.github/workflows/ci_cd_pr.yml +++ b/.github/workflows/ci_cd_pr.yml @@ -5,7 +5,7 @@ on: env: MAIN_PYTHON_VERSION: '3.13' - LIBRARY_NAME: 'ansys-lumerical-core' + LIBRARY_NAME: 'pylumerical' DOCKER_IMAGE_LUMERICAL_UNIFIED: 'ghcr.io/ansys-internal/lumerical-unified:latest' DOCKER_CONTAINER_LUMERICAL_UNIFIED_NAME: 'lumerical-unified' PIP_EXTRA_INDEX_URL: 'https://${{ secrets.PYANSYS_PYPI_PRIVATE_PAT }}@pkgs.dev.azure.com/pyansys/_packaging/pyansys/pypi/simple/' @@ -96,7 +96,7 @@ jobs: - name: "Create requirements file for doc build" run: | - echo "-e ../ansys-api-lumerical" > doc-requirements.txt + echo "-e ./ansys-api-lumerical" > ansys-api-lumerical.txt - uses: ansys/actions/doc-build@v10 with: @@ -104,7 +104,7 @@ jobs: python-version: ${{ env.MAIN_PYTHON_VERSION }} use-python-cache: true needs-quarto: true - requirements-file: doc-requirements.txt + requirements-file: ../ansys-api-lumerical.txt wheelhouse: name: "Wheelhouse / ${{ matrix.os }} / ${{ matrix.python }}" From 1d191442b6ba05d0b427e864ad4654f49040f19a Mon Sep 17 00:00:00 2001 From: Luke Queenan Date: Fri, 1 Aug 2025 15:00:45 -0700 Subject: [PATCH 34/64] update doc build step to use optional dependencies instead of requirements file --- .github/workflows/ci_cd_pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_cd_pr.yml b/.github/workflows/ci_cd_pr.yml index 7b4f8e1..3add3be 100644 --- a/.github/workflows/ci_cd_pr.yml +++ b/.github/workflows/ci_cd_pr.yml @@ -104,7 +104,7 @@ jobs: python-version: ${{ env.MAIN_PYTHON_VERSION }} use-python-cache: true needs-quarto: true - requirements-file: ../ansys-api-lumerical.txt + optional-dependencies-name: -e ../ansys-api-lumerical wheelhouse: name: "Wheelhouse / ${{ matrix.os }} / ${{ matrix.python }}" From f03dbbab47139d92929ca101e1cdfd0b0b1f529e Mon Sep 17 00:00:00 2001 From: Luke Queenan Date: Fri, 1 Aug 2025 15:08:39 -0700 Subject: [PATCH 35/64] just trying random stuff now --- .github/workflows/ci_cd_pr.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci_cd_pr.yml b/.github/workflows/ci_cd_pr.yml index 3add3be..0593846 100644 --- a/.github/workflows/ci_cd_pr.yml +++ b/.github/workflows/ci_cd_pr.yml @@ -104,7 +104,7 @@ jobs: python-version: ${{ env.MAIN_PYTHON_VERSION }} use-python-cache: true needs-quarto: true - optional-dependencies-name: -e ../ansys-api-lumerical + optional-dependencies-name: -e../ansys-api-lumerical wheelhouse: name: "Wheelhouse / ${{ matrix.os }} / ${{ matrix.python }}" @@ -161,7 +161,7 @@ jobs: with: registry: ghcr.io username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} + password: ${{ secrets.PYANSYS_CI_BOT_TOKEN }} - name: "Pull Lumerical Unified Container" run: | From 14ec803258710d035b2483ae18bc02a551ecb615 Mon Sep 17 00:00:00 2001 From: Luke Queenan Date: Fri, 1 Aug 2025 15:21:10 -0700 Subject: [PATCH 36/64] the most important commits don't have good messages --- .github/workflows/ci_cd_pr.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci_cd_pr.yml b/.github/workflows/ci_cd_pr.yml index 0593846..7fce66b 100644 --- a/.github/workflows/ci_cd_pr.yml +++ b/.github/workflows/ci_cd_pr.yml @@ -104,7 +104,7 @@ jobs: python-version: ${{ env.MAIN_PYTHON_VERSION }} use-python-cache: true needs-quarto: true - optional-dependencies-name: -e../ansys-api-lumerical + optional-dependencies-name: ../ansys-api-lumerical wheelhouse: name: "Wheelhouse / ${{ matrix.os }} / ${{ matrix.python }}" @@ -181,14 +181,14 @@ jobs: run: | docker exec \ --workdir /home/ansys/pylumerical \ - ${{ env.DOCKER_IMAGE_LUMERICAL_UNIFIED_NAME }} /bin/bash -c \ + ${{ env.DOCKER_CONTAINER_LUMERICAL_UNIFIED_NAME }} /bin/bash -c \ "python -m pip install -e ./ansys-api-lumerical" - name: "Install project" run: | docker exec \ --workdir /home/ansys/pylumerical \ - ${{ env.DOCKER_IMAGE_LUMERICAL_UNIFIED_NAME }} /bin/bash -c \ + ${{ env.DOCKER_CONTAINER_LUMERICAL_UNIFIED_NAME }} /bin/bash -c \ "python -m pip install -e .[tests] && pytest tests" - name: "Stop lumerical services" From 8462bb366777adc4b0c883e700e4a9a942b6b063 Mon Sep 17 00:00:00 2001 From: Luke Queenan Date: Fri, 1 Aug 2025 15:36:09 -0700 Subject: [PATCH 37/64] fix: update license environment variable and improve docker exec command --- .github/workflows/ci_cd_pr.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci_cd_pr.yml b/.github/workflows/ci_cd_pr.yml index 7fce66b..9d6d2c0 100644 --- a/.github/workflows/ci_cd_pr.yml +++ b/.github/workflows/ci_cd_pr.yml @@ -173,7 +173,7 @@ jobs: --detach -it \ --network="host" \ --name ${{ env.DOCKER_CONTAINER_LUMERICAL_UNIFIED_NAME }} \ - --env LICENSE_SERVER=1055@${{ secrets.LICENSE_SERVER }} \ + --env ANSYSLMD_LICENSE_FILE=1055@${{ secrets.LICENSE_SERVER }} \ --volume ${PWD}:/home/ansys/pylumerical \ ${{ env.DOCKER_IMAGE_LUMERICAL_UNIFIED }} @@ -181,14 +181,14 @@ jobs: run: | docker exec \ --workdir /home/ansys/pylumerical \ - ${{ env.DOCKER_CONTAINER_LUMERICAL_UNIFIED_NAME }} /bin/bash -c \ + ${{ env.DOCKER_CONTAINER_LUMERICAL_UNIFIED_NAME }} /bin/bash --login -c \ "python -m pip install -e ./ansys-api-lumerical" - name: "Install project" run: | docker exec \ --workdir /home/ansys/pylumerical \ - ${{ env.DOCKER_CONTAINER_LUMERICAL_UNIFIED_NAME }} /bin/bash -c \ + ${{ env.DOCKER_CONTAINER_LUMERICAL_UNIFIED_NAME }} /bin/bash --login -c \ "python -m pip install -e .[tests] && pytest tests" - name: "Stop lumerical services" From 845c3cf9bd45b7c66c570179bb5bfcdc73208e1e Mon Sep 17 00:00:00 2001 From: Luke Queenan Date: Fri, 1 Aug 2025 15:45:53 -0700 Subject: [PATCH 38/64] fix: update optional dependencies path and improve test job name --- .github/workflows/ci_cd_pr.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci_cd_pr.yml b/.github/workflows/ci_cd_pr.yml index 9d6d2c0..bd95750 100644 --- a/.github/workflows/ci_cd_pr.yml +++ b/.github/workflows/ci_cd_pr.yml @@ -104,7 +104,7 @@ jobs: python-version: ${{ env.MAIN_PYTHON_VERSION }} use-python-cache: true needs-quarto: true - optional-dependencies-name: ../ansys-api-lumerical + optional-dependencies-name: ansys-api-lumerical wheelhouse: name: "Wheelhouse / ${{ matrix.os }} / ${{ matrix.python }}" @@ -138,7 +138,7 @@ jobs: python-version: ${{ matrix.python }} tests: - name: "Tests" + name: "Test Python 3.13 with Lumerical Unified Linux Container" runs-on: ubuntu-latest needs: code-style # used to need wheelhouse permissions: From c9389d83874492942ab3586ab6c8580021e09276 Mon Sep 17 00:00:00 2001 From: Luke Queenan Date: Fri, 1 Aug 2025 22:01:41 -0700 Subject: [PATCH 39/64] fix: update doc build step to use requirements file for optional dependencies --- .github/workflows/ci_cd_pr.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci_cd_pr.yml b/.github/workflows/ci_cd_pr.yml index bd95750..226f053 100644 --- a/.github/workflows/ci_cd_pr.yml +++ b/.github/workflows/ci_cd_pr.yml @@ -104,7 +104,8 @@ jobs: python-version: ${{ env.MAIN_PYTHON_VERSION }} use-python-cache: true needs-quarto: true - optional-dependencies-name: ansys-api-lumerical + requirements-file: "../ansys-api-lumerical.txt" + optional-dependencies-name: "doc" wheelhouse: name: "Wheelhouse / ${{ matrix.os }} / ${{ matrix.python }}" From 674c11bca8c401258031f2b6b8918837a7b652c0 Mon Sep 17 00:00:00 2001 From: Luke Queenan Date: Fri, 1 Aug 2025 23:31:48 -0700 Subject: [PATCH 40/64] fix: remove optional dependencies name from doc build step --- .github/workflows/ci_cd_pr.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci_cd_pr.yml b/.github/workflows/ci_cd_pr.yml index 226f053..db38321 100644 --- a/.github/workflows/ci_cd_pr.yml +++ b/.github/workflows/ci_cd_pr.yml @@ -105,7 +105,6 @@ jobs: use-python-cache: true needs-quarto: true requirements-file: "../ansys-api-lumerical.txt" - optional-dependencies-name: "doc" wheelhouse: name: "Wheelhouse / ${{ matrix.os }} / ${{ matrix.python }}" From cb9a0b4957bc9af351fbe2a515c22dda2cf587bd Mon Sep 17 00:00:00 2001 From: Luke Queenan Date: Fri, 1 Aug 2025 23:40:26 -0700 Subject: [PATCH 41/64] trying copilot suggestions --- .github/workflows/ci_cd_pr.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci_cd_pr.yml b/.github/workflows/ci_cd_pr.yml index db38321..224a043 100644 --- a/.github/workflows/ci_cd_pr.yml +++ b/.github/workflows/ci_cd_pr.yml @@ -87,6 +87,9 @@ jobs: needs: doc-style steps: + - name: "Checkout PyLumerical" + uses: actions/checkout@v4 + - name: "Checkout ansys-api-lumerical" uses: actions/checkout@v4 with: @@ -94,9 +97,15 @@ jobs: token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }} path: ansys-api-lumerical - - name: "Create requirements file for doc build" + - name: "Set up Python" + uses: actions/setup-python@v5 + with: + python-version: ${{ env.MAIN_PYTHON_VERSION }} + + - name: "Install ansys-api-lumerical in editable mode" run: | - echo "-e ./ansys-api-lumerical" > ansys-api-lumerical.txt + python -m pip install --upgrade pip + python -m pip install -e ./ansys-api-lumerical - uses: ansys/actions/doc-build@v10 with: @@ -104,7 +113,6 @@ jobs: python-version: ${{ env.MAIN_PYTHON_VERSION }} use-python-cache: true needs-quarto: true - requirements-file: "../ansys-api-lumerical.txt" wheelhouse: name: "Wheelhouse / ${{ matrix.os }} / ${{ matrix.python }}" From 08f783f0d299be9bafd6a85c281334b76acb622c Mon Sep 17 00:00:00 2001 From: Luke Queenan Date: Thu, 18 Sep 2025 19:47:24 -0700 Subject: [PATCH 42/64] fix: remove unnecessary checkout and installation steps for ansys-api-lumerical in doc build job --- .github/workflows/ci_cd_pr.yml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/.github/workflows/ci_cd_pr.yml b/.github/workflows/ci_cd_pr.yml index 224a043..9c10769 100644 --- a/.github/workflows/ci_cd_pr.yml +++ b/.github/workflows/ci_cd_pr.yml @@ -90,23 +90,11 @@ jobs: - name: "Checkout PyLumerical" uses: actions/checkout@v4 - - name: "Checkout ansys-api-lumerical" - uses: actions/checkout@v4 - with: - repository: ansys-internal/ansys-api-lumerical - token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }} - path: ansys-api-lumerical - - name: "Set up Python" uses: actions/setup-python@v5 with: python-version: ${{ env.MAIN_PYTHON_VERSION }} - - name: "Install ansys-api-lumerical in editable mode" - run: | - python -m pip install --upgrade pip - python -m pip install -e ./ansys-api-lumerical - - uses: ansys/actions/doc-build@v10 with: skip-install: true From ad96e455314a327d6f75bfb908d61b959702a184 Mon Sep 17 00:00:00 2001 From: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com> Date: Fri, 19 Sep 2025 02:52:05 +0000 Subject: [PATCH 43/64] chore: adding changelog file 5.maintenance.md [dependabot-skip] --- doc/source/changelog/5.maintenance.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/changelog/5.maintenance.md b/doc/source/changelog/5.maintenance.md index daa8aab..8154aff 100644 --- a/doc/source/changelog/5.maintenance.md +++ b/doc/source/changelog/5.maintenance.md @@ -1 +1 @@ -Add workflows \ No newline at end of file +Add workflows From 3606e008a52efd660b62e41f18d42ffbd28c9e96 Mon Sep 17 00:00:00 2001 From: Luke Queenan Date: Thu, 18 Sep 2025 19:55:31 -0700 Subject: [PATCH 44/64] fix: remove checkout and installation steps for ansys-api-lumerical in CI workflow --- .github/workflows/ci_cd_pr.yml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/.github/workflows/ci_cd_pr.yml b/.github/workflows/ci_cd_pr.yml index 9c10769..4bee1e0 100644 --- a/.github/workflows/ci_cd_pr.yml +++ b/.github/workflows/ci_cd_pr.yml @@ -115,18 +115,6 @@ jobs: os: ['ubuntu-latest', 'windows-latest'] python: ['3.10', '3.11', '3.12', '3.13'] steps: - - name: "Checkout ansys-api-lumerical" - uses: actions/checkout@v4 - with: - repository: ansys-internal/ansys-api-lumerical - token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }} - path: ansys-api-lumerical - - - name: "Install ansys-api-lumerical in editable mode" - run: | - python -m pip install --upgrade pip - python -m pip install -e ./ansys-api-lumerical - - uses: ansys/actions/build-wheelhouse@v10 with: library-name: ${{ env.LIBRARY_NAME }} From c4b4e541186a851b875db068e9140db951b02d6e Mon Sep 17 00:00:00 2001 From: Luke Queenan Date: Thu, 18 Sep 2025 20:03:27 -0700 Subject: [PATCH 45/64] fix: remove checkout and installation steps for ansys-api-lumerical in CI workflow --- .github/workflows/ci_cd_pr.yml | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/.github/workflows/ci_cd_pr.yml b/.github/workflows/ci_cd_pr.yml index 4bee1e0..ea60bd3 100644 --- a/.github/workflows/ci_cd_pr.yml +++ b/.github/workflows/ci_cd_pr.yml @@ -133,13 +133,6 @@ jobs: - name: "Checkout PyLumerical" uses: actions/checkout@v4 - - name: "Checkout ansys-api-lumerical in working directory" - uses: actions/checkout@v4 - with: - repository: ansys-internal/ansys-api-lumerical - token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }} - path: ansys-api-lumerical - - name: "Login to GitHub container registry" uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0 with: @@ -161,13 +154,6 @@ jobs: --volume ${PWD}:/home/ansys/pylumerical \ ${{ env.DOCKER_IMAGE_LUMERICAL_UNIFIED }} - - name: "Install ansys-api-lumerical in editable mode" - run: | - docker exec \ - --workdir /home/ansys/pylumerical \ - ${{ env.DOCKER_CONTAINER_LUMERICAL_UNIFIED_NAME }} /bin/bash --login -c \ - "python -m pip install -e ./ansys-api-lumerical" - - name: "Install project" run: | docker exec \ From 815f401178af71b580bd6f1d3c96650a5eaa3e14 Mon Sep 17 00:00:00 2001 From: Luke Queenan Date: Thu, 18 Sep 2025 20:23:00 -0700 Subject: [PATCH 46/64] fix: remove unnecessary checkout and setup steps in doc build job --- .github/workflows/ci_cd_pr.yml | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci_cd_pr.yml b/.github/workflows/ci_cd_pr.yml index ea60bd3..d6bec56 100644 --- a/.github/workflows/ci_cd_pr.yml +++ b/.github/workflows/ci_cd_pr.yml @@ -85,21 +85,12 @@ jobs: name: "Doc build" runs-on: ubuntu-latest needs: doc-style - steps: - - name: "Checkout PyLumerical" - uses: actions/checkout@v4 - - - name: "Set up Python" - uses: actions/setup-python@v5 - with: - python-version: ${{ env.MAIN_PYTHON_VERSION }} - - uses: ansys/actions/doc-build@v10 with: skip-install: true python-version: ${{ env.MAIN_PYTHON_VERSION }} - use-python-cache: true + use-python-cache: false needs-quarto: true wheelhouse: @@ -124,7 +115,7 @@ jobs: tests: name: "Test Python 3.13 with Lumerical Unified Linux Container" runs-on: ubuntu-latest - needs: code-style # used to need wheelhouse + needs: wheelhouse permissions: id-token: write contents: write From ac9f98564a3dcb9331f0d850af1631ccfe0c2086 Mon Sep 17 00:00:00 2001 From: Jorge Martinez Date: Fri, 19 Sep 2025 05:38:59 +0200 Subject: [PATCH 47/64] fix(ci): library name --- .github/workflows/ci_cd_pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_cd_pr.yml b/.github/workflows/ci_cd_pr.yml index d6bec56..50062ff 100644 --- a/.github/workflows/ci_cd_pr.yml +++ b/.github/workflows/ci_cd_pr.yml @@ -5,7 +5,7 @@ on: env: MAIN_PYTHON_VERSION: '3.13' - LIBRARY_NAME: 'pylumerical' + LIBRARY_NAME: 'ansys-lumerical-core' DOCKER_IMAGE_LUMERICAL_UNIFIED: 'ghcr.io/ansys-internal/lumerical-unified:latest' DOCKER_CONTAINER_LUMERICAL_UNIFIED_NAME: 'lumerical-unified' PIP_EXTRA_INDEX_URL: 'https://${{ secrets.PYANSYS_PYPI_PRIVATE_PAT }}@pkgs.dev.azure.com/pyansys/_packaging/pyansys/pypi/simple/' From cf4ff84718ec7cf9130c049d3da2cbe8211fbcc8 Mon Sep 17 00:00:00 2001 From: Luke Queenan Date: Thu, 18 Sep 2025 20:53:47 -0700 Subject: [PATCH 48/64] fix: update warning message for missing Lumerical installation --- src/ansys/lumerical/core/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ansys/lumerical/core/__init__.py b/src/ansys/lumerical/core/__init__.py index c54be0a..27135a1 100644 --- a/src/ansys/lumerical/core/__init__.py +++ b/src/ansys/lumerical/core/__init__.py @@ -37,5 +37,5 @@ if install_dir is not None: ansys.api.lumerical.lumapi.InteropPaths.setLumericalInstallPath(install_dir) else: - print("Warning: Lumerical installation not found. Please use InteropPaths.setLumericalInstallPath to set the interop library location.") + print("Lumerical installation not found. Please use InteropPaths.setLumericalInstallPath to set the interop library location.") del install_dir # remove the local variable to exclude from the namespace From dc7cc9558b6039932f34bcfaae8706704f15d776 Mon Sep 17 00:00:00 2001 From: Jorge Martinez Date: Fri, 19 Sep 2025 06:56:41 +0200 Subject: [PATCH 49/64] fix(doc): remove include of README --- doc/source/index.rst | 8 -------- 1 file changed, 8 deletions(-) diff --git a/doc/source/index.rst b/doc/source/index.rst index c274c5e..946c021 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -37,14 +37,6 @@ As a part of the PyAnsys project, PyLumerical also enables you to integrate with Description of classes and methods of the PyLumerical module. -.. - Just reuse the root readme to avoid duplicating the documentation. - Provide any documentation specific to your online documentation - here. - -.. include:: ../../README.rst - :start-after: .. contribute_start - .. toctree:: :hidden: :maxdepth: 3 From 8356702586370cfb1d2020997d9c84e8d76f63e6 Mon Sep 17 00:00:00 2001 From: Jorge Martinez Date: Fri, 19 Sep 2025 08:02:18 +0200 Subject: [PATCH 50/64] doc(autoapi): setup --- doc/source/conf.py | 13 ++++--------- pyproject.toml | 2 +- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 3abfbf2..305651c 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -35,12 +35,14 @@ }, "check_switcher": False, "logo": "pyansys", + "ansys_sphinx_theme_autoapi": { + "project": "PyLumerical", + }, } # Sphinx extensions extensions = [ - "sphinx.ext.autodoc", - "sphinx.ext.autosummary", + "ansys_sphinx_theme.extension.autoapi", "numpydoc", "sphinx.ext.intersphinx", "sphinx_copybutton", @@ -87,13 +89,6 @@ copybutton_prompt_text = r">>> ?|\.\.\. ?" copybutton_prompt_is_regexp = True - -# Skipping members -def autodoc_skip_member_custom(app, what, name, obj, skip, options): - """Skip members that are not documented.""" - return True if obj.__doc__ is None else None # need to return none if exclude is false otherwise it will interfere with other skip functions - - # RST prolog for substitution of custom variables rst_prolog = "" diff --git a/pyproject.toml b/pyproject.toml index 15b665d..9d5ba98 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,7 +39,7 @@ tests = [ "pytest-cov==4.1.0", ] doc = [ - "ansys-sphinx-theme==1.4.2", + "ansys-sphinx-theme[autoapi]==1.4.2", "numpydoc==1.8.0", "sphinx==8.2.3", "sphinx-copybutton==0.5.2", From f97cbbfe58376c385f8aedea71425302be2807cd Mon Sep 17 00:00:00 2001 From: Jorge Martinez Date: Fri, 19 Sep 2025 08:08:00 +0200 Subject: [PATCH 51/64] fix(style): code --- doc/source/conf.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 305651c..e685d7f 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -122,8 +122,3 @@ # Define extlinks extlinks = {"examples_url": (f"{html_theme_options['github_url']}/blob/main/examples/%s", "%s")} - - -def setup(app): - """Sphinx setup function.""" - app.connect("autodoc-skip-member", autodoc_skip_member_custom) From 738fff62ae5f48c1a81f77f0d3973069800562e3 Mon Sep 17 00:00:00 2001 From: Jorge Martinez Date: Fri, 19 Sep 2025 08:18:23 +0200 Subject: [PATCH 52/64] fix(doc): force autoapi content --- doc/source/api/autodiscovery.rst | 21 ------------- doc/source/api/index.rst | 31 ------------------- doc/source/api/interface_class.rst | 14 --------- doc/source/api/simobject_class.rst | 13 -------- .../working_with_simulation_objects.rst | 6 ++-- 5 files changed, 3 insertions(+), 82 deletions(-) delete mode 100644 doc/source/api/autodiscovery.rst delete mode 100644 doc/source/api/index.rst delete mode 100644 doc/source/api/interface_class.rst delete mode 100644 doc/source/api/simobject_class.rst diff --git a/doc/source/api/autodiscovery.rst b/doc/source/api/autodiscovery.rst deleted file mode 100644 index d104711..0000000 --- a/doc/source/api/autodiscovery.rst +++ /dev/null @@ -1,21 +0,0 @@ -Autodiscovery -============= - -PyLumerical requires Lumerical |supported_lum_release| or later to run. The autodiscovery function first attempts to find the installation location using the following methods: - -1. **Windows registry**: On Windows, PyLumerical checks the registry for the installation path of Lumerical products. - -2. **Default installation paths**: If the registry lookup fails, or if you are using Linux, PyLumerical checks the default installation paths: - - On Windows, with the Lumerical standalone installer: ``C:\Program Files\Lumerical\`` - - On Windows, with the Ansys automated installer: ``C:\Program Files\ANSYS Inc\ANSYS Optics\`` - - On Linux, with the Lumerical standalone installer: ``/opt/Lumerical/`` - - On Linux, with the Ansys automated installer: ``~/Ansys/ansys_inc/`` - -If PyLumerical can't find the installation path automatically, it returns a warning, and you must set the path manually. - -The autodiscovery function below is automatically ran when you import PyLumerical: - -.. autosummary:: - :toctree: _autosummary - - ansys.lumerical.core.autodiscovery.locate_lumerical_install \ No newline at end of file diff --git a/doc/source/api/index.rst b/doc/source/api/index.rst deleted file mode 100644 index 23523ae..0000000 --- a/doc/source/api/index.rst +++ /dev/null @@ -1,31 +0,0 @@ -API reference -============= - -The API reference provides an overview of classes and methods used in PyLumerical. - -.. grid:: 2 2 3 3 - - .. grid-item-card:: Interface classes - :link: interface_class - :link-type: doc - - Main classes to programmatically interact with Lumerical products. - - .. grid-item-card:: Auxiliary classes - :link: simobject_class - :link-type: doc - - Auxiliary classes used to represent simulation objects, their results, and IDs. - - .. grid-item-card:: Autodiscovery - :link: autodiscovery - :link-type: doc - - Function to automatically discover Lumerical installation. - -.. toctree:: - :hidden: - - interface_class - simobject_class - autodiscovery \ No newline at end of file diff --git a/doc/source/api/interface_class.rst b/doc/source/api/interface_class.rst deleted file mode 100644 index a44b12c..0000000 --- a/doc/source/api/interface_class.rst +++ /dev/null @@ -1,14 +0,0 @@ -Interface classes -================== - -Instances of these objects each represent an interactive session with a Lumerical product, and provide methods to create simulation objects, run simulations, and access results. - -.. autosummary:: - :toctree: _autosummary - - ansys.lumerical.core.FDTD - ansys.lumerical.core.MODE - ansys.lumerical.core.DEVICE - ansys.lumerical.core.INTERCONNECT - -The PyLumerical :doc:`User guide <../user_guide/index>` provides information on how to get started and details of how to use the Lumerical class methods to interact with Lumerical products. \ No newline at end of file diff --git a/doc/source/api/simobject_class.rst b/doc/source/api/simobject_class.rst deleted file mode 100644 index b8f4b72..0000000 --- a/doc/source/api/simobject_class.rst +++ /dev/null @@ -1,13 +0,0 @@ -Auxiliary classes -================= - -These classes represent simulation objects, their results, and IDs. - -Don't instantiate these classes directly. Methods of interface classes often return instances of these classes. - -.. autosummary:: - :toctree: _autosummary - - ansys.lumerical.core.SimObject - ansys.lumerical.core.SimObjectResults - ansys.lumerical.core.SimObjectId \ No newline at end of file diff --git a/doc/source/user_guide/working_with_simulation_objects.rst b/doc/source/user_guide/working_with_simulation_objects.rst index ab0c4a8..64ff420 100644 --- a/doc/source/user_guide/working_with_simulation_objects.rst +++ b/doc/source/user_guide/working_with_simulation_objects.rst @@ -90,8 +90,8 @@ When you set linked properties, unexpected changes may occur to the object. .. code-block:: python with lumapi.FDTD() as fdtd: - rect1 = fdtd.addrect(name = "rect1", x = 0, x_span = 1e-6, x_min = -1e-6, x_max = 1e-6) - print(f"{rect1.x_span=}") + rect1 = fdtd.addrect(name = "rect1", x = 0, x_span = 1e-6, x_min = -1e-6, x_max = 1e-6) + print(f"{rect1.x_span=}") Returns @@ -184,4 +184,4 @@ You can traverse the tree of objects in a Lumerical product using the parent or print(f'There are {len(model.getChildren())} children in the model. Their names are:') for child in model.getChildren(): - print(f'{child["name"]}') \ No newline at end of file + print(f'{child["name"]}') From f1325f9b2c3ceb50e629289b6f1f261b2ad4bba4 Mon Sep 17 00:00:00 2001 From: Jorge Martinez Date: Fri, 19 Sep 2025 08:32:28 +0200 Subject: [PATCH 53/64] fix(doc): api xrefs --- doc/source/getting_started/index.rst | 2 +- doc/source/user_guide/script_commands_as_methods.rst | 4 ++-- doc/source/user_guide/session_management.rst | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/source/getting_started/index.rst b/doc/source/getting_started/index.rst index 3655241..ad8a3aa 100644 --- a/doc/source/getting_started/index.rst +++ b/doc/source/getting_started/index.rst @@ -25,7 +25,7 @@ Requirements ------------- You must have an Ansys Lumerical GUI license to use PyLumerical. For more information, please visit the `licensing page `_ on the Ansys Optics website. -In addition, you must also have Lumerical |supported_lum_release| or later installed on your computer. Upon importing PyLumerical, the :doc:`autodiscovery <../api/autodiscovery>` function automatically locates the Lumerical installation path. If it fails to do so, you must set the path manually using :func:`ansys.lumerical.core.autodiscovery.locate_lumerical_install`. +In addition, you must also have Lumerical |supported_lum_release| or later installed on your computer. Upon importing PyLumerical, the :doc:`autodiscovery ` function automatically locates the Lumerical installation path. If it fails to do so, you must set the path manually using :func:`ansys.lumerical.core.autodiscovery.locate_lumerical_install`. .. Turn off vale here due to captizalization issues being wrongly flagged by vale. diff --git a/doc/source/user_guide/script_commands_as_methods.rst b/doc/source/user_guide/script_commands_as_methods.rst index 7261539..8fb80b4 100644 --- a/doc/source/user_guide/script_commands_as_methods.rst +++ b/doc/source/user_guide/script_commands_as_methods.rst @@ -167,7 +167,7 @@ Importing custom script commands --------------------------------- In addition to default script commands, you can also take advantage of the auto-syncing function feature in PyLumerical and import functions that are pre-defined in a Lumerical script file (.lsf file). -To import these functions, you can either execute the scripts while constructing the session using the :doc:`script keyword argument <../api/interface_class>`, or manually evaluating the file using the :meth:`ansys.lumerical.core.FDTD.eval` method. +To import these functions, you can either execute the scripts while constructing the session using the :doc:`script keyword argument `, or manually evaluating the file using the :meth:`ansys.lumerical.core.FDTD.eval` method. .. note:: @@ -386,4 +386,4 @@ Returns +-----------------------------------+-----------------------------------+ See Also set(), run() - https://kb.lumerical.com/en/ref_scripts_addfdtd.html \ No newline at end of file + https://kb.lumerical.com/en/ref_scripts_addfdtd.html diff --git a/doc/source/user_guide/session_management.rst b/doc/source/user_guide/session_management.rst index aa3f8aa..1ec30f2 100644 --- a/doc/source/user_guide/session_management.rst +++ b/doc/source/user_guide/session_management.rst @@ -6,7 +6,7 @@ Session management Starting a local session ------------------------- -The Python API interacts with Lumerical products through sessions. The simplest way to create a session is by calling the relevant constructor for the Lumerical product and storing it in an object. These constructors construct objects derived from the :doc:`Lumerical class <../api/interface_class>`. +The Python API interacts with Lumerical products through sessions. The simplest way to create a session is by calling the relevant constructor for the Lumerical product and storing it in an object. These constructors construct objects derived from the :doc:`Lumerical class <../api/ansys/lumerical/core/interface_class>`. **Example** From 432ca27b9906262d084dab3528388bbb1c5eb5be Mon Sep 17 00:00:00 2001 From: Luke Queenan Date: Tue, 23 Sep 2025 13:43:37 -0700 Subject: [PATCH 54/64] Revert "fix(doc): api xrefs" This reverts commit f1325f9b2c3ceb50e629289b6f1f261b2ad4bba4. --- doc/source/getting_started/index.rst | 2 +- doc/source/user_guide/script_commands_as_methods.rst | 4 ++-- doc/source/user_guide/session_management.rst | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/source/getting_started/index.rst b/doc/source/getting_started/index.rst index ad8a3aa..3655241 100644 --- a/doc/source/getting_started/index.rst +++ b/doc/source/getting_started/index.rst @@ -25,7 +25,7 @@ Requirements ------------- You must have an Ansys Lumerical GUI license to use PyLumerical. For more information, please visit the `licensing page `_ on the Ansys Optics website. -In addition, you must also have Lumerical |supported_lum_release| or later installed on your computer. Upon importing PyLumerical, the :doc:`autodiscovery ` function automatically locates the Lumerical installation path. If it fails to do so, you must set the path manually using :func:`ansys.lumerical.core.autodiscovery.locate_lumerical_install`. +In addition, you must also have Lumerical |supported_lum_release| or later installed on your computer. Upon importing PyLumerical, the :doc:`autodiscovery <../api/autodiscovery>` function automatically locates the Lumerical installation path. If it fails to do so, you must set the path manually using :func:`ansys.lumerical.core.autodiscovery.locate_lumerical_install`. .. Turn off vale here due to captizalization issues being wrongly flagged by vale. diff --git a/doc/source/user_guide/script_commands_as_methods.rst b/doc/source/user_guide/script_commands_as_methods.rst index 8fb80b4..7261539 100644 --- a/doc/source/user_guide/script_commands_as_methods.rst +++ b/doc/source/user_guide/script_commands_as_methods.rst @@ -167,7 +167,7 @@ Importing custom script commands --------------------------------- In addition to default script commands, you can also take advantage of the auto-syncing function feature in PyLumerical and import functions that are pre-defined in a Lumerical script file (.lsf file). -To import these functions, you can either execute the scripts while constructing the session using the :doc:`script keyword argument `, or manually evaluating the file using the :meth:`ansys.lumerical.core.FDTD.eval` method. +To import these functions, you can either execute the scripts while constructing the session using the :doc:`script keyword argument <../api/interface_class>`, or manually evaluating the file using the :meth:`ansys.lumerical.core.FDTD.eval` method. .. note:: @@ -386,4 +386,4 @@ Returns +-----------------------------------+-----------------------------------+ See Also set(), run() - https://kb.lumerical.com/en/ref_scripts_addfdtd.html + https://kb.lumerical.com/en/ref_scripts_addfdtd.html \ No newline at end of file diff --git a/doc/source/user_guide/session_management.rst b/doc/source/user_guide/session_management.rst index 1ec30f2..aa3f8aa 100644 --- a/doc/source/user_guide/session_management.rst +++ b/doc/source/user_guide/session_management.rst @@ -6,7 +6,7 @@ Session management Starting a local session ------------------------- -The Python API interacts with Lumerical products through sessions. The simplest way to create a session is by calling the relevant constructor for the Lumerical product and storing it in an object. These constructors construct objects derived from the :doc:`Lumerical class <../api/ansys/lumerical/core/interface_class>`. +The Python API interacts with Lumerical products through sessions. The simplest way to create a session is by calling the relevant constructor for the Lumerical product and storing it in an object. These constructors construct objects derived from the :doc:`Lumerical class <../api/interface_class>`. **Example** From 150879b05de900c4232f6bf235ae3d9075ba48df Mon Sep 17 00:00:00 2001 From: Luke Queenan Date: Tue, 23 Sep 2025 13:44:53 -0700 Subject: [PATCH 55/64] Revert "fix(doc): force autoapi content" This reverts commit 738fff62ae5f48c1a81f77f0d3973069800562e3. --- doc/source/api/autodiscovery.rst | 21 +++++++++++++ doc/source/api/index.rst | 31 +++++++++++++++++++ doc/source/api/interface_class.rst | 14 +++++++++ doc/source/api/simobject_class.rst | 13 ++++++++ .../working_with_simulation_objects.rst | 6 ++-- 5 files changed, 82 insertions(+), 3 deletions(-) create mode 100644 doc/source/api/autodiscovery.rst create mode 100644 doc/source/api/index.rst create mode 100644 doc/source/api/interface_class.rst create mode 100644 doc/source/api/simobject_class.rst diff --git a/doc/source/api/autodiscovery.rst b/doc/source/api/autodiscovery.rst new file mode 100644 index 0000000..d104711 --- /dev/null +++ b/doc/source/api/autodiscovery.rst @@ -0,0 +1,21 @@ +Autodiscovery +============= + +PyLumerical requires Lumerical |supported_lum_release| or later to run. The autodiscovery function first attempts to find the installation location using the following methods: + +1. **Windows registry**: On Windows, PyLumerical checks the registry for the installation path of Lumerical products. + +2. **Default installation paths**: If the registry lookup fails, or if you are using Linux, PyLumerical checks the default installation paths: + - On Windows, with the Lumerical standalone installer: ``C:\Program Files\Lumerical\`` + - On Windows, with the Ansys automated installer: ``C:\Program Files\ANSYS Inc\ANSYS Optics\`` + - On Linux, with the Lumerical standalone installer: ``/opt/Lumerical/`` + - On Linux, with the Ansys automated installer: ``~/Ansys/ansys_inc/`` + +If PyLumerical can't find the installation path automatically, it returns a warning, and you must set the path manually. + +The autodiscovery function below is automatically ran when you import PyLumerical: + +.. autosummary:: + :toctree: _autosummary + + ansys.lumerical.core.autodiscovery.locate_lumerical_install \ No newline at end of file diff --git a/doc/source/api/index.rst b/doc/source/api/index.rst new file mode 100644 index 0000000..23523ae --- /dev/null +++ b/doc/source/api/index.rst @@ -0,0 +1,31 @@ +API reference +============= + +The API reference provides an overview of classes and methods used in PyLumerical. + +.. grid:: 2 2 3 3 + + .. grid-item-card:: Interface classes + :link: interface_class + :link-type: doc + + Main classes to programmatically interact with Lumerical products. + + .. grid-item-card:: Auxiliary classes + :link: simobject_class + :link-type: doc + + Auxiliary classes used to represent simulation objects, their results, and IDs. + + .. grid-item-card:: Autodiscovery + :link: autodiscovery + :link-type: doc + + Function to automatically discover Lumerical installation. + +.. toctree:: + :hidden: + + interface_class + simobject_class + autodiscovery \ No newline at end of file diff --git a/doc/source/api/interface_class.rst b/doc/source/api/interface_class.rst new file mode 100644 index 0000000..a44b12c --- /dev/null +++ b/doc/source/api/interface_class.rst @@ -0,0 +1,14 @@ +Interface classes +================== + +Instances of these objects each represent an interactive session with a Lumerical product, and provide methods to create simulation objects, run simulations, and access results. + +.. autosummary:: + :toctree: _autosummary + + ansys.lumerical.core.FDTD + ansys.lumerical.core.MODE + ansys.lumerical.core.DEVICE + ansys.lumerical.core.INTERCONNECT + +The PyLumerical :doc:`User guide <../user_guide/index>` provides information on how to get started and details of how to use the Lumerical class methods to interact with Lumerical products. \ No newline at end of file diff --git a/doc/source/api/simobject_class.rst b/doc/source/api/simobject_class.rst new file mode 100644 index 0000000..b8f4b72 --- /dev/null +++ b/doc/source/api/simobject_class.rst @@ -0,0 +1,13 @@ +Auxiliary classes +================= + +These classes represent simulation objects, their results, and IDs. + +Don't instantiate these classes directly. Methods of interface classes often return instances of these classes. + +.. autosummary:: + :toctree: _autosummary + + ansys.lumerical.core.SimObject + ansys.lumerical.core.SimObjectResults + ansys.lumerical.core.SimObjectId \ No newline at end of file diff --git a/doc/source/user_guide/working_with_simulation_objects.rst b/doc/source/user_guide/working_with_simulation_objects.rst index 64ff420..ab0c4a8 100644 --- a/doc/source/user_guide/working_with_simulation_objects.rst +++ b/doc/source/user_guide/working_with_simulation_objects.rst @@ -90,8 +90,8 @@ When you set linked properties, unexpected changes may occur to the object. .. code-block:: python with lumapi.FDTD() as fdtd: - rect1 = fdtd.addrect(name = "rect1", x = 0, x_span = 1e-6, x_min = -1e-6, x_max = 1e-6) - print(f"{rect1.x_span=}") + rect1 = fdtd.addrect(name = "rect1", x = 0, x_span = 1e-6, x_min = -1e-6, x_max = 1e-6) + print(f"{rect1.x_span=}") Returns @@ -184,4 +184,4 @@ You can traverse the tree of objects in a Lumerical product using the parent or print(f'There are {len(model.getChildren())} children in the model. Their names are:') for child in model.getChildren(): - print(f'{child["name"]}') + print(f'{child["name"]}') \ No newline at end of file From 44825adf998a122e5d7d9b70627bdac870399850 Mon Sep 17 00:00:00 2001 From: Adan Wang Date: Tue, 23 Sep 2025 17:11:45 -0600 Subject: [PATCH 56/64] Reverted extension to sphinx.ext.autodoc and sphinx.ext.autosummary, and reinstating skipping of members without documentation to unblock doc CI/CD --- doc/source/conf.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index e685d7f..29d770f 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -42,7 +42,8 @@ # Sphinx extensions extensions = [ - "ansys_sphinx_theme.extension.autoapi", + "sphinx.ext.autodoc", + "sphinx.ext.autosummary", "numpydoc", "sphinx.ext.intersphinx", "sphinx_copybutton", @@ -89,6 +90,11 @@ copybutton_prompt_text = r">>> ?|\.\.\. ?" copybutton_prompt_is_regexp = True +# Skipping members +def autodoc_skip_member_custom(app, what, name, obj, skip, options): + """Skip members that are not intended to be in documentation.""" + return True if obj.__doc__ is None else None # need to return none if exclude is false otherwise it will interfere with other skip functions + # RST prolog for substitution of custom variables rst_prolog = "" @@ -122,3 +128,7 @@ # Define extlinks extlinks = {"examples_url": (f"{html_theme_options['github_url']}/blob/main/examples/%s", "%s")} + +def setup(app): + """Sphinx setup function.""" + app.connect("autodoc-skip-member", autodoc_skip_member_custom) \ No newline at end of file From d4b5dfc1e7a13a5dec59d331db67d92d9730b395 Mon Sep 17 00:00:00 2001 From: Adan Wang Date: Tue, 23 Sep 2025 18:29:52 -0600 Subject: [PATCH 57/64] Added workaround for LaTeX build --- doc/source/conf.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 29d770f..4eea97a 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -4,10 +4,16 @@ import os from ansys_sphinx_theme import get_version_match +from sphinx.builders.latex import LaTeXBuilder from ansys.lumerical.core import __version__ from ansys.lumerical.core.autodiscovery import __min_supported_lum_release__ +# Workaround for pdf build. An override of the LaTeX builder for sphinx is required, else the latex build will fail with seemingly unrelated warnings. +# Using autoapi will solve this issue +LaTeXBuilder.supported_image_types = ["image/png", "image/pdf", "image/svg+xml"] +os.environ["PYANSYS_VISUALIZER_HTML_BACKEND"] = "true" + # Project information project = "ansys-lumerical-core" copyright = f"(c) {datetime.now().year} ANSYS, Inc. All rights reserved" @@ -90,11 +96,13 @@ copybutton_prompt_text = r">>> ?|\.\.\. ?" copybutton_prompt_is_regexp = True + # Skipping members def autodoc_skip_member_custom(app, what, name, obj, skip, options): """Skip members that are not intended to be in documentation.""" return True if obj.__doc__ is None else None # need to return none if exclude is false otherwise it will interfere with other skip functions + # RST prolog for substitution of custom variables rst_prolog = "" @@ -129,6 +137,7 @@ def autodoc_skip_member_custom(app, what, name, obj, skip, options): extlinks = {"examples_url": (f"{html_theme_options['github_url']}/blob/main/examples/%s", "%s")} + def setup(app): """Sphinx setup function.""" - app.connect("autodoc-skip-member", autodoc_skip_member_custom) \ No newline at end of file + app.connect("autodoc-skip-member", autodoc_skip_member_custom) From b4c67eb802baca34b469d3d88e1caa8c8c6b811e Mon Sep 17 00:00:00 2001 From: Adan Wang Date: Tue, 23 Sep 2025 18:44:44 -0600 Subject: [PATCH 58/64] Revert "Added workaround for LaTeX build" This reverts commit d4b5dfc1e7a13a5dec59d331db67d92d9730b395. --- doc/source/conf.py | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 4eea97a..29d770f 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -4,16 +4,10 @@ import os from ansys_sphinx_theme import get_version_match -from sphinx.builders.latex import LaTeXBuilder from ansys.lumerical.core import __version__ from ansys.lumerical.core.autodiscovery import __min_supported_lum_release__ -# Workaround for pdf build. An override of the LaTeX builder for sphinx is required, else the latex build will fail with seemingly unrelated warnings. -# Using autoapi will solve this issue -LaTeXBuilder.supported_image_types = ["image/png", "image/pdf", "image/svg+xml"] -os.environ["PYANSYS_VISUALIZER_HTML_BACKEND"] = "true" - # Project information project = "ansys-lumerical-core" copyright = f"(c) {datetime.now().year} ANSYS, Inc. All rights reserved" @@ -96,13 +90,11 @@ copybutton_prompt_text = r">>> ?|\.\.\. ?" copybutton_prompt_is_regexp = True - # Skipping members def autodoc_skip_member_custom(app, what, name, obj, skip, options): """Skip members that are not intended to be in documentation.""" return True if obj.__doc__ is None else None # need to return none if exclude is false otherwise it will interfere with other skip functions - # RST prolog for substitution of custom variables rst_prolog = "" @@ -137,7 +129,6 @@ def autodoc_skip_member_custom(app, what, name, obj, skip, options): extlinks = {"examples_url": (f"{html_theme_options['github_url']}/blob/main/examples/%s", "%s")} - def setup(app): """Sphinx setup function.""" - app.connect("autodoc-skip-member", autodoc_skip_member_custom) + app.connect("autodoc-skip-member", autodoc_skip_member_custom) \ No newline at end of file From e46d658046c053dfe5ddf378e29426f56c01e2e6 Mon Sep 17 00:00:00 2001 From: Adan Wang Date: Tue, 23 Sep 2025 19:02:53 -0600 Subject: [PATCH 59/64] Fix new line issues from pre-commit. --- doc/source/conf.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 29d770f..aa19635 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -90,11 +90,13 @@ copybutton_prompt_text = r">>> ?|\.\.\. ?" copybutton_prompt_is_regexp = True + # Skipping members def autodoc_skip_member_custom(app, what, name, obj, skip, options): """Skip members that are not intended to be in documentation.""" return True if obj.__doc__ is None else None # need to return none if exclude is false otherwise it will interfere with other skip functions + # RST prolog for substitution of custom variables rst_prolog = "" @@ -129,6 +131,7 @@ def autodoc_skip_member_custom(app, what, name, obj, skip, options): extlinks = {"examples_url": (f"{html_theme_options['github_url']}/blob/main/examples/%s", "%s")} + def setup(app): """Sphinx setup function.""" - app.connect("autodoc-skip-member", autodoc_skip_member_custom) \ No newline at end of file + app.connect("autodoc-skip-member", autodoc_skip_member_custom) From 0a0bef538e411add59a21b8ceb2159295f1680a0 Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Wed, 24 Sep 2025 18:01:57 +0200 Subject: [PATCH 60/64] test: supress warning --- doc/source/api/interface_class.rst | 1 + doc/source/conf.py | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/doc/source/api/interface_class.rst b/doc/source/api/interface_class.rst index a44b12c..f1d9bb8 100644 --- a/doc/source/api/interface_class.rst +++ b/doc/source/api/interface_class.rst @@ -5,6 +5,7 @@ Instances of these objects each represent an interactive session with a Lumerica .. autosummary:: :toctree: _autosummary + :recursive: ansys.lumerical.core.FDTD ansys.lumerical.core.MODE diff --git a/doc/source/conf.py b/doc/source/conf.py index aa19635..4f1ade6 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -40,6 +40,11 @@ }, } +suppress_warnings = [ + "toc.not_included", + "numpydoc", +] + # Sphinx extensions extensions = [ "sphinx.ext.autodoc", From 2bf5b884475ff50c3dd2586095b97e2f3fd18665 Mon Sep 17 00:00:00 2001 From: Adan Wang Date: Wed, 24 Sep 2025 15:08:42 -0600 Subject: [PATCH 61/64] test:Deleted Sphinx fail on warning. --- doc/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/Makefile b/doc/Makefile index 7dc17b5..82dc50e 100755 --- a/doc/Makefile +++ b/doc/Makefile @@ -2,7 +2,7 @@ # # You can set these variables from the command line. -SPHINXOPTS = -j auto -W --color --keep-going +SPHINXOPTS = -j auto --color --keep-going SPHINXBUILD = sphinx-build SOURCEDIR = source BUILDDIR = _build From b7cdfdc9fa3962749438d9a58b2b5f4c49690238 Mon Sep 17 00:00:00 2001 From: Adan Wang Date: Wed, 24 Sep 2025 15:27:26 -0600 Subject: [PATCH 62/64] test: Added linkcheck ignore for Zendesk pages - Zendesk Help Center cannot be accessed by bots. --- doc/source/conf.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/source/conf.py b/doc/source/conf.py index 4f1ade6..3c6e0e3 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -124,6 +124,7 @@ def autodoc_skip_member_custom(app, what, name, obj, skip, options): linkcheck_ignore = [ "https://github.com/ansys/pylumerical/*", "https://pypi.org/project/ansys-lumerical-core", + r"https://optics.ansys.com/hc/" # ignore Zendesk articles because help center is not accessible by bots/crawlers ] # If we are on a release, we have to ignore the "release" URLs, since it is not @@ -137,6 +138,7 @@ def autodoc_skip_member_custom(app, what, name, obj, skip, options): extlinks = {"examples_url": (f"{html_theme_options['github_url']}/blob/main/examples/%s", "%s")} + def setup(app): """Sphinx setup function.""" app.connect("autodoc-skip-member", autodoc_skip_member_custom) From 603198519ae5070c6544e6e1e8ec880df080c53c Mon Sep 17 00:00:00 2001 From: Adan Wang Date: Wed, 24 Sep 2025 15:31:11 -0600 Subject: [PATCH 63/64] Pre-commit fix --- doc/source/conf.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 3c6e0e3..72c7982 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -124,7 +124,7 @@ def autodoc_skip_member_custom(app, what, name, obj, skip, options): linkcheck_ignore = [ "https://github.com/ansys/pylumerical/*", "https://pypi.org/project/ansys-lumerical-core", - r"https://optics.ansys.com/hc/" # ignore Zendesk articles because help center is not accessible by bots/crawlers + r"https://optics.ansys.com/hc/", # ignore Zendesk articles because help center is not accessible by bots/crawlers ] # If we are on a release, we have to ignore the "release" URLs, since it is not @@ -138,7 +138,6 @@ def autodoc_skip_member_custom(app, what, name, obj, skip, options): extlinks = {"examples_url": (f"{html_theme_options['github_url']}/blob/main/examples/%s", "%s")} - def setup(app): """Sphinx setup function.""" app.connect("autodoc-skip-member", autodoc_skip_member_custom) From 02078f69acd00be341f8a7bf40a01155846498fa Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Thu, 25 Sep 2025 09:35:14 +0200 Subject: [PATCH 64/64] fox: add warning supress only to pdf --- doc/Makefile | 4 ++-- doc/source/conf.py | 5 ----- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/doc/Makefile b/doc/Makefile index 82dc50e..0318dc9 100755 --- a/doc/Makefile +++ b/doc/Makefile @@ -2,7 +2,7 @@ # # You can set these variables from the command line. -SPHINXOPTS = -j auto --color --keep-going +SPHINXOPTS = -j auto -W --color --keep-going SPHINXBUILD = sphinx-build SOURCEDIR = source BUILDDIR = _build @@ -27,6 +27,6 @@ clean: # Customized pdf for svg format images pdf: - @$(SPHINXBUILD) -M latex "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + @$(SPHINXBUILD) -M latex "$(SOURCEDIR)" "$(BUILDDIR)" -j auto --color --keep-going $(O) cd $(BUILDDIR)/latex && latexmk -r latexmkrc -pdf *.tex -interaction=nonstopmode || true (test -f $(BUILDDIR)/latex/*.pdf && echo pdf exists) || exit 1 diff --git a/doc/source/conf.py b/doc/source/conf.py index 72c7982..f1f1508 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -40,11 +40,6 @@ }, } -suppress_warnings = [ - "toc.not_included", - "numpydoc", -] - # Sphinx extensions extensions = [ "sphinx.ext.autodoc",