Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/pip/pytest-cov-4.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
RobPasMue authored Aug 1, 2023
2 parents 3dccdff + d5c99b6 commit 05d5b33
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
13 changes: 7 additions & 6 deletions doc/source/rest_api/ensight_rest_v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions doc/source/rest_api/rest_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://ensight.docs.pyansys.com/dev/_static/ensight_rest_v1.yaml>`_
for the API, which is appropriate for use with `Swagger <https://editor.swagger.io/>`_.

.. openapi:: ensight_rest_v1.yaml
:examples:

6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
Expand Down
17 changes: 9 additions & 8 deletions src/ansys/pyensight/core/ensobj.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,17 +106,17 @@ 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.
>>> 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})"
Expand All @@ -134,16 +134,17 @@ 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
>>> 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__()})"
Expand Down Expand Up @@ -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
-------
Expand Down
10 changes: 4 additions & 6 deletions src/ansys/pyensight/core/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -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``.
Expand Down Expand Up @@ -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")
"""
Expand Down

0 comments on commit 05d5b33

Please sign in to comment.