Skip to content

Commit 91dbe02

Browse files
ENH: restore abstractions chapter (#74)
* New doc/source/abstractions chapter * Fix PyAEDT link * Fix app-interface.rst table header * Apply suggestions from code review Co-authored-by: Maxime Rey <[email protected]> Co-authored-by: Maxime Rey <[email protected]>
1 parent 192e9c9 commit 91dbe02

File tree

6 files changed

+35
-12
lines changed

6 files changed

+35
-12
lines changed

doc/source/guidelines/app_interface_abstraction.rst renamed to doc/source/abstractions/app-interface.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
Application Interface Abstraction
2-
=================================
1+
Application Interface
2+
=====================
3+
34
Many Ansys applications are designed around user interaction within a
45
desktop GUI-based environment. Consequently, scripts are recorded
56
directly from user sessions and are in the context of manipulating the
@@ -14,7 +15,7 @@ open region in the active editor:
1415

1516
+------------------------------------------------------+----------------------------------------------+
1617
| Using a Recorded Script from AEDT (MS COM Methods) | Using the `PyAEDT`_ Library |
17-
+------------------------------------------------------+----------------------------------------------+
18+
+======================================================+==============================================+
1819
| .. code:: python | .. code:: python |
1920
| | |
2021
| import sys | from pyaedt import Hfss |
@@ -54,7 +55,7 @@ clear ``numpydoc`` parameters and returns, and a basic example.
5455
These are unavailable when directly using COM methods, preventing
5556
the use of contextual help from within a Python IDE.
5657

57-
The source of the ``hfss.py`` method within`PyAEDT`_ follows.
58+
The source of the ``hfss.py`` method within `PyAEDT`_ follows.
5859
Note how calls to the COM object are all encapsulated
5960
within this method.
6061

@@ -108,5 +109,5 @@ providing (and documenting) the defaults using keyword arguments and
108109
placing them into the ``vars`` list, all while following the `Style
109110
Guide for Python Code (PEP8)`_.
110111

111-
.. _PyAEDT: https://github.com/pyansys/PyAEDT
112+
.. _PyAEDT: https://github.com/pyansys/pyaedt
112113
.. _Style Guide for Python Code (PEP8): https://www.python.org/dev/peps/pep-0008

doc/source/guidelines/data_transfer_and_representation.rst renamed to doc/source/abstractions/data-transfer.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
Data Transfer and Abstraction
2-
=============================
1+
Data Transfer
2+
=============
3+
34
Abstracted APIs should attempt to hide the implementation details of
45
the remote or local API in a well organized data model. This data
56
model should avoid returning raw JSON files, gRPC messages, SWIG objects,

doc/source/abstractions/index.rst

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Abstractions
2+
############
3+
4+
Abstraction in Python is the process of hiding the real implementation
5+
of an application from the user and emphasizing only usage.
6+
7+
One of the main objectives of PyAnsys libraries is to wrap (encapsulate)
8+
data and methods within units of execution while hiding data or parameters
9+
in protected variables.
10+
11+
The topics in this section demonstrate how applications and complex services
12+
expose functionalities that matter to users and hide all else, such as conditional
13+
statements and algorithms. For example, background details, implementation,
14+
and states can all be hidden.
15+
16+
.. toctree::
17+
:hidden:
18+
:maxdepth: 3
19+
20+
app-interface
21+
data-transfer
22+
service

doc/source/guidelines/service_abstraction.rst renamed to doc/source/abstractions/service.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
Service Abstraction
2-
===================
1+
Service
2+
=======
3+
34
Some Ansys products are exposed as services that permit remote
45
execution using technologies like `REST`_ or `gRPC`_. These services
56
are typically exposed in a manner where the API has already been

doc/source/guidelines/index.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ functionalities such as logging, data transfer, and application APIs.
1313
dev_practices
1414
version_support
1515
doc_practices
16-
app_interface_abstraction
17-
data_transfer_and_representation
1816
logging
19-
service_abstraction
2017
test_practices
2118
private_packaging

doc/source/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@
1212
packaging/index
1313
coding_style/index
1414
documentation_style/index
15+
abstractions/index

0 commit comments

Comments
 (0)