From a01aabb01bc252dea6b2b4f4c8f7e24c5e06bbb0 Mon Sep 17 00:00:00 2001 From: Markus Schubert <46968437+widerschein@users.noreply.github.com> Date: Mon, 6 May 2024 11:21:05 +0200 Subject: [PATCH] Migrate Vale version (#281) --- .github/workflows/ci_cd.yml | 2 +- .pre-commit-config.yaml | 3 ++- doc/.vale.ini | 2 ++ doc/source/api/node_types.rst | 4 ++-- .../api/node_types/parametric_systems.rst | 2 +- doc/source/user_guide/create_workflow.rst | 2 +- doc/source/user_guide/functions.rst | 2 +- doc/source/user_guide/launch.rst | 4 ++-- doc/styles/.gitignore | 4 ++-- .../vocabularies}/ANSYS/accept.txt | 5 ++++- .../vocabularies}/ANSYS/reject.txt | 0 src/ansys/optislang/core/tcp/osl_server.py | 2 +- .../optislang/core/tcp/server_commands.py | 20 +++++++++---------- 13 files changed, 29 insertions(+), 23 deletions(-) rename doc/styles/{Vocab => config/vocabularies}/ANSYS/accept.txt (55%) rename doc/styles/{Vocab => config/vocabularies}/ANSYS/reject.txt (100%) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 0e06cb4ff..d501763b2 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -35,7 +35,7 @@ jobs: - uses: ansys/actions/doc-style@v6 with: token: ${{ secrets.GITHUB_TOKEN }} - vale-version: "2.29.6" + vale-version: "3.4.1" wheelhouse: name: "Wheelhouse and smoke tests" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 34fc3b7ff..3991f43ab 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -23,9 +23,10 @@ repos: exclude: "examples/" - repo: https://github.com/codespell-project/codespell - rev: v2.2.2 + rev: v2.2.6 hooks: - id: codespell + args: ["--ignore-words", "doc/styles/config/vocabularies/ANSYS/accept.txt"] - repo: https://github.com/pycqa/pydocstyle rev: 6.3.0 diff --git a/doc/.vale.ini b/doc/.vale.ini index 4f0b67098..fb3cc6afc 100644 --- a/doc/.vale.ini +++ b/doc/.vale.ini @@ -26,3 +26,5 @@ Vocab = ANSYS # Apply the following styles BasedOnStyles = Vale, Google +TokenIgnores = :py:(?:class|meth|const|attr|mod):`.*` +Vale.Terms = NO diff --git a/doc/source/api/node_types.rst b/doc/source/api/node_types.rst index 2388748d4..17852d46c 100644 --- a/doc/source/api/node_types.rst +++ b/doc/source/api/node_types.rst @@ -1,5 +1,5 @@ -NodeTypes -========= +Node types +========== .. currentmodule:: ansys.optislang.core.node_types .. toctree:: diff --git a/doc/source/api/node_types/parametric_systems.rst b/doc/source/api/node_types/parametric_systems.rst index e5c47e5fb..4ec2f2502 100644 --- a/doc/source/api/node_types/parametric_systems.rst +++ b/doc/source/api/node_types/parametric_systems.rst @@ -1,4 +1,4 @@ -Parametric Systems +Parametric systems ================== .. currentmodule:: ansys.optislang.core.node_types diff --git a/doc/source/user_guide/create_workflow.rst b/doc/source/user_guide/create_workflow.rst index 1ffc81c93..e52cbebc7 100644 --- a/doc/source/user_guide/create_workflow.rst +++ b/doc/source/user_guide/create_workflow.rst @@ -28,7 +28,7 @@ with types of most of the available nodes are declared in Type of the created node can be also created manually using :py:class:`NodeType ` if constant is not available. Code below shows value of constant -:py:const:`Sensitivity ` from snippet above: +:py:const:`Sensitivity ` from the preceding snippet: .. code:: python diff --git a/doc/source/user_guide/functions.rst b/doc/source/user_guide/functions.rst index 104a8ceb0..d158cf825 100644 --- a/doc/source/user_guide/functions.rst +++ b/doc/source/user_guide/functions.rst @@ -21,7 +21,7 @@ Within the context of the :py:class:`Application `, which holds an instance of the :py:class:`Project ` class -(if any project is loaded). This instance groups functionality to get project information +(if any project is loaded). This instance groups features to get project information and execute operations on the active project. .. code:: python diff --git a/doc/source/user_guide/launch.rst b/doc/source/user_guide/launch.rst index 8eb6fc23b..0650996fb 100644 --- a/doc/source/user_guide/launch.rst +++ b/doc/source/user_guide/launch.rst @@ -3,7 +3,7 @@ ============================= OptiSLang instance management ============================= -You use the :class:`Optislang ` +You use the :py:class:`Optislang ` class to launch optiSLang as a server and to control and query optiSLang projects. You can either launch optiSLang locally or connect to a remote optiSLang instance. @@ -164,7 +164,7 @@ initialized with the ``shutdown_on_finished`` parameter set to ``False``. * To shut down the optiSLang server, use both the :py:meth:`shutdown() ` and - :py;meth:`dispose() ` methods: + :py:meth:`dispose() ` methods: .. code:: python diff --git a/doc/styles/.gitignore b/doc/styles/.gitignore index 72177bc1e..e535edf5c 100644 --- a/doc/styles/.gitignore +++ b/doc/styles/.gitignore @@ -1,4 +1,4 @@ * -!Vocab -!Vocab/** +!config +!config/** !.gitignore diff --git a/doc/styles/Vocab/ANSYS/accept.txt b/doc/styles/config/vocabularies/ANSYS/accept.txt similarity index 55% rename from doc/styles/Vocab/ANSYS/accept.txt rename to doc/styles/config/vocabularies/ANSYS/accept.txt index b205d642b..efb9fa614 100644 --- a/doc/styles/Vocab/ANSYS/accept.txt +++ b/doc/styles/config/vocabularies/ANSYS/accept.txt @@ -2,7 +2,10 @@ optiSLang OptiSLang Optislang optislang +optiSLang TCP PyOptiSLang osl Pythonic -(?!)ansys +Ansys +design_flow +integration_plugins diff --git a/doc/styles/Vocab/ANSYS/reject.txt b/doc/styles/config/vocabularies/ANSYS/reject.txt similarity index 100% rename from doc/styles/Vocab/ANSYS/reject.txt rename to doc/styles/config/vocabularies/ANSYS/reject.txt diff --git a/src/ansys/optislang/core/tcp/osl_server.py b/src/ansys/optislang/core/tcp/osl_server.py index 9e6a3a691..ff010bcc0 100644 --- a/src/ansys/optislang/core/tcp/osl_server.py +++ b/src/ansys/optislang/core/tcp/osl_server.py @@ -3487,7 +3487,7 @@ def reset(self, actor_uid: Optional[str] = None, hid: Optional[str] = None): Parameters ---------- actor_uid: Optional[str], optional - Actor uid entry. A Hirearchical ID (hid) is required. By default ``None``. + Actor uid entry. A Hierarchical ID (hid) is required. By default ``None``. hid: Optional[str], optional Hid entry. The actor uid is required. By default ``None``. diff --git a/src/ansys/optislang/core/tcp/server_commands.py b/src/ansys/optislang/core/tcp/server_commands.py index ee95d461c..7d5c3870c 100644 --- a/src/ansys/optislang/core/tcp/server_commands.py +++ b/src/ansys/optislang/core/tcp/server_commands.py @@ -1168,7 +1168,7 @@ def reset( Parameters ---------- actor_uid: Optional[str], optional - Actor uid entry. A Hirearchical ID (hid) is required. By default ``None``. + Actor uid entry. A Hierarchical ID (hid) is required. By default ``None``. hid: Optional[str], optional Hid entry. The actor uid is required. By default ``None``. password : Optional[str], optional @@ -1180,7 +1180,7 @@ def reset( JSON string of ``reset`` command. """ if actor_uid and hid is None: - raise ValueError("The Hirearchical ID (hid) is required.") + raise ValueError("The Hierarchical ID (hid) is required.") elif actor_uid is None and hid: raise ValueError("The actor uid is required.") return _to_json( @@ -1196,7 +1196,7 @@ def restart( Parameters ---------- actor_uid: Optional[str], optional - Actor uid entry. A Hirearchical ID (hid) is required. By default ``None``. + Actor uid entry. A Hierarchical ID (hid) is required. By default ``None``. hid: Optional[str], optional Hid entry. The actor uid is required. By default ``None``. password : Optional[str], optional @@ -1208,7 +1208,7 @@ def restart( JSON string of ``restart`` command. """ if actor_uid and hid is None: - raise ValueError("The Hirearchical ID (hid) is required.") + raise ValueError("The Hierarchical ID (hid) is required.") elif actor_uid is None and hid: raise ValueError("The actor uid is required.") return _to_json( @@ -1772,7 +1772,7 @@ def start( Parameters ---------- actor_uid: Optional[str], optional - Actor uid entry. A Hirearchical ID (hid) is required. By default ``None``. + Actor uid entry. A Hierarchical ID (hid) is required. By default ``None``. hid: Optional[str], optional Hid entry. The actor uid is required. By default ``None``. password : Optional[str], optional @@ -1784,7 +1784,7 @@ def start( JSON string of ``start`` command. """ if actor_uid and hid is None: - raise ValueError("The Hirearchical ID (hid) is required.") + raise ValueError("The Hierarchical ID (hid) is required.") elif actor_uid is None and hid: raise ValueError("The actor uid is required.") @@ -1801,7 +1801,7 @@ def stop( Parameters ---------- actor_uid: Optional[str], optional - Actor uid entry. A Hirearchical ID (hid) is required. By default ``None``. + Actor uid entry. A Hierarchical ID (hid) is required. By default ``None``. hid: Optional[str], optional Hid entry. The actor uid is required. By default ``None``. password : Optional[str], optional @@ -1813,7 +1813,7 @@ def stop( JSON string of ``stop`` command. """ if actor_uid and hid is None: - raise ValueError("The Hirearchical ID (hid) is required.") + raise ValueError("The Hierarchical ID (hid) is required.") elif actor_uid is None and hid: raise ValueError("The actor uid is required.") @@ -1830,7 +1830,7 @@ def stop_gently( Parameters ---------- actor_uid: Optional[str], optional - Actor uid entry. A Hirearchical ID (hid) is required. By default ``None``. + Actor uid entry. A Hierarchical ID (hid) is required. By default ``None``. hid: Optional[str], optional Hid entry. The actor uid is required. By default ``None``. password : Optional[str], optional @@ -1842,7 +1842,7 @@ def stop_gently( JSON string of ``stop_gently`` command. """ if actor_uid and hid is None: - raise ValueError("The Hirearchical ID (hid) is required.") + raise ValueError("The Hierarchical ID (hid) is required.") elif actor_uid is None and hid: raise ValueError("The actor uid is required.") return _to_json(