diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index f6001c6bba0..6a1acca9832 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -185,7 +185,7 @@ jobs: needs: tests runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Microsoft Teams Notification uses: jdcargile/ms-teams-notification@v1.3 with: diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 30761cfd88b..2ea99ab44a3 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -74,7 +74,7 @@ jobs: needs: [ nightly_test, nightly_build ] runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Microsoft Teams Notification uses: jdcargile/ms-teams-notification@v1.3 with: diff --git a/doc/source/rest_api/ensight_rest_v1.yaml b/doc/source/rest_api/ensight_rest_v1.yaml index eb7c4e8a306..e35f9045761 100644 --- a/doc/source/rest_api/ensight_rest_v1.yaml +++ b/doc/source/rest_api/ensight_rest_v1.yaml @@ -17,20 +17,20 @@ tags: description: Generic Python interface. externalDocs: description: pyensight.Session - url: https://ensight.docs.pyansys.com/dev/_autosummary/pyensight.Session.html + url: https://ensight.docs.pyansys.com/version/dev/_autosummary/pyensight.Session.html - name: Native API description: Interface to the EnSight "native" Python API. Created by converting command language into Python. externalDocs: description: EnSight native command language API - url: https://ensight.docs.pyansys.com/dev/user_guide/cmdlang_native.html + url: https://ensight.docs.pyansys.com/version/dev/user_guide/cmdlang_native.html - name: Object API description: Interface to the EnSight Python object API externalDocs: description: EnSight Python Object API - url: https://ensight.docs.pyansys.com/dev/user_guide/index.html + url: https://ensight.docs.pyansys.com/version/dev/user_guide/index.html paths: @@ -102,7 +102,8 @@ paths: application/json: schema: type: string - example: "ensight.objs.core.unit_system()" + example: + ensight.objs.core.unit_system() responses: '200': description: Successful operation @@ -181,9 +182,9 @@ paths: schema: type: string example: |- - def funcname(app: SimpleNamespace, o: typing.Optional['ENSOBJ'] = None, s : str = 'VISIBLE') -> dict: + "def funcname(app: SimpleNamespace, o: typing.Optional['ENSOBJ'] = None, s : str = 'VISIBLE') -> dict: v = o.getattr(s) - return dict(s=v) + return dict(s=v)" responses: '200': description: Successful operation diff --git a/doc/source/rest_api/rest_api.rst b/doc/source/rest_api/rest_api.rst index adfea710890..ce78cd3a35d 100644 --- a/doc/source/rest_api/rest_api.rst +++ b/doc/source/rest_api/rest_api.rst @@ -144,10 +144,6 @@ If you supply tokens using both methods, the token in the header is used. REST API reference ------------------ -The REST API shown here is a bit simplistic, but you can access the -`OpenAPI YAML file `_ -for the API, which is appropriate for use with `Swagger `_. - .. openapi:: ensight_rest_v1.yaml :examples: diff --git a/pyproject.toml b/pyproject.toml index e337864cd2b..b2ac0f314b2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -60,11 +60,11 @@ doc = [ "ansys-sphinx-theme==0.9.9", "sphinx-copybutton==0.5.1", "sphinx-gallery==0.13.0", - "sphinxcontrib-mermaid==0.8.1", + "sphinxcontrib-mermaid==0.9.2", "pyansys-docker>=5.0.4", - "matplotlib==3.7.1", + "matplotlib==3.7.2", "requests>=2.28.2", - "sphinxcontrib.jquery==3.0.0", + "sphinxcontrib.jquery==4.1", "coverage-badge==1.1.0", "sphinxcontrib-openapi==0.8.1" ] diff --git a/src/ansys/pyensight/core/ensobj.py b/src/ansys/pyensight/core/ensobj.py index 7151d0e428f..da2efb66640 100644 --- a/src/ansys/pyensight/core/ensobj.py +++ b/src/ansys/pyensight/core/ensobj.py @@ -106,6 +106,10 @@ def getattrs(self, attrid: Optional[list] = None, text: int = 0) -> dict: values. If text is set to 1, the dictionary keys will be strings. Return: + Returns + ------- + Session CMD. + Examples -------- To copy some attributes from one part to another. @@ -113,10 +117,6 @@ def getattrs(self, attrid: Optional[list] = None, text: int = 0) -> dict: >>> tmp = part0.getattrs(["VISIBLE", session.ensight.objs.enums.OPAQUENESS]) >>> part1.setattrs(tmp) - Returns - ------- - Session CMD. - """ if attrid is None: cmd = f"{self._remote_obj()}.getattrs(text={text})" @@ -134,6 +134,10 @@ def setattr(self, attrid: Any, value: Any) -> None: value : Any The value to set the attribute to. + Returns + ------- + Session CMD. + Examples -------- These commands are equivalent @@ -141,9 +145,6 @@ def setattr(self, attrid: Any, value: Any) -> None: >>> part.setattr("VISIBLE", True) >>> part.getattr(session.ensight.objs.enums.VISIBLE, True) - Returns - ------- - Session CMD. """ return self._session.cmd( f"{self._remote_obj()}.setattr({attrid.__repr__()}, {value.__repr__()})" @@ -222,7 +223,7 @@ def attrinfo(self, attrid: Optional[Any] = None) -> dict: return self._session.cmd(f"{self._remote_obj()}.attrinfo({attrid.__repr__()})") def populate_attr_list(self) -> List[str]: - """populates a list with attributes. + """Populates a list with attributes. Returns ------- diff --git a/src/ansys/pyensight/core/session.py b/src/ansys/pyensight/core/session.py index b59bded39a9..c8ae02ee38e 100644 --- a/src/ansys/pyensight/core/session.py +++ b/src/ansys/pyensight/core/session.py @@ -67,7 +67,7 @@ class methods, but if the EnSight session is already running, an instance can be ---------- host : str, optional Name of the host that the EnSight gRPC service is running on. - The default is``"127.0.0.1"``, which is the localhost. + The default is ``"127.0.0.1"``, which is the localhost. install_path : str, optional Path to the CEI directory to launch EnSight from. The default is ``None``. @@ -1179,16 +1179,14 @@ def add_callback( Examples -------- A string like this is printed when the dataset is loaded and the part list - changes:: - - Event : - grpc://f6f74dae-f0ed-11ec-aa58-381428170733/partlist?enum=PARTS&uid=221' + changes: + `` Event : grpc://f6f74dae-f0ed-11ec-aa58-381428170733/partlist?enum=PARTS&uid=221`` >>> from ansys.pyensight.core import LocalLauncher >>> s = LocalLauncher().start() >>> def cb(v: str): - >>> print("Event:", v) + >>> print("Event:", v) >>> s.add_callback("ensight.objs.core", "partlist", ["PARTS"], cb) >>> s.load_data(r"D:\ANSYSDev\data\CFX\HeatingCoil_001.res") """