Skip to content

Commit 847b87c

Browse files
committed
doc: modified more files.
1 parent 846afc5 commit 847b87c

File tree

11 files changed

+129
-71
lines changed

11 files changed

+129
-71
lines changed

src/ansys/dpf/core/ipconfig.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2121
# SOFTWARE.
22+
"""Provides for retrieving local ip address."""
2223

2324
import socket
2425

src/ansys/dpf/core/label_space.py

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535

3636

3737
class LabelSpace:
38+
"""A class representing a label space, which allows storage and management of key-value pairs (labels)."""
39+
3840
def __init__(self, label_space=None, obj=None, server=None):
3941
# ############################
4042
# step 1: get server
@@ -68,13 +70,42 @@ def _data_processing_core_api(self):
6870
return core_api
6971

7072
def fill(self, label_space: Dict[str, int]):
73+
"""
74+
Fill the label space with the provided dictionary of labels.
75+
76+
Parameters
77+
----------
78+
label_space : dict
79+
A dictionary where keys are labels (str) and values are indices (int) to be added to the label space.
80+
81+
Returns
82+
-------
83+
None
84+
This method does not return anything, it modifies the internal label space.
85+
"""
7186
for key, index in label_space.items():
7287
self._api.label_space_add_data(self, key, index)
7388

7489
def __str__(self):
90+
"""
91+
Return a string representation of the LabelSpace instance.
92+
93+
Returns
94+
-------
95+
str
96+
A string representation of the label space, formatted as a dictionary.
97+
"""
7598
return str(dict(self))
7699

77100
def __iter__(self):
101+
"""
102+
Iterate over the labels in the label space, yielding (key, value) pairs.
103+
104+
Yields
105+
------
106+
tuple
107+
A tuple of (key, value) for each label in the label space.
108+
"""
78109
yield from [
79110
(
80111
self._api.label_space_get_labels_name(self, i),
@@ -84,6 +115,14 @@ def __iter__(self):
84115
]
85116

86117
def __dict__(self):
118+
"""
119+
Return a dictionary representation of the LabelSpace instance.
120+
121+
Returns
122+
-------
123+
dict
124+
A dictionary where keys are label names (str) and values are label indices (int).
125+
"""
87126
if isinstance(self._internal_obj, dict):
88127
return self._internal_obj
89128
out = {}
@@ -95,6 +134,13 @@ def __dict__(self):
95134
return out
96135

97136
def __del__(self):
137+
"""
138+
Destructor for cleaning up the label space resources.
139+
140+
Returns
141+
-------
142+
None
143+
"""
98144
try:
99145
self._deleter_func[0](self._deleter_func[1](self))
100146
except:

src/ansys/dpf/core/log.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2121
# SOFTWARE.
22+
"""Provides for setting up logging."""
2223

2324
import logging
2425

src/ansys/dpf/core/mapping_types.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2121
# SOFTWARE.
22+
"""Provides utilities for mapping and transforming data types between Python and C++ representations."""
2223

2324
import sys
2425
import inspect

src/ansys/dpf/core/mesh_info.py

Lines changed: 38 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,7 @@
2020
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2121
# SOFTWARE.
2222

23-
"""
24-
MeshInfo
25-
26-
"""
23+
"""MeshInfo."""
2724

2825
from ansys.dpf.core import server as server_module
2926
from ansys.dpf.core.generic_data_container import GenericDataContainer
@@ -66,7 +63,7 @@ def __init__(
6663
mesh_info=None,
6764
server=None,
6865
):
69-
"""Initialize with a MeshInfo message"""
66+
"""Initialize with a MeshInfo message."""
7067
# ############################
7168
# step 1: get server
7269

@@ -90,6 +87,14 @@ def __init__(
9087
self._bodies_map = None
9188

9289
def __str__(self):
90+
"""
91+
Return a string representation of the MeshInfo instance.
92+
93+
Returns
94+
-------
95+
str
96+
A string representation of the information about a mesh space.
97+
"""
9398
txt = "DPF MeshInfo\n"
9499
txt += "-" * 30 + "\n"
95100
txt += "with properties:\n"
@@ -101,8 +106,7 @@ def __str__(self):
101106

102107
@property
103108
def generic_data_container(self) -> GenericDataContainer:
104-
"""GenericDataContainer wrapped into the MeshInfo
105-
that contains all the relative information of the derived class.
109+
"""GenericDataContainer wrapped into the MeshInfo that contains all the relative information of the derived class.
106110
107111
Returns
108112
-------
@@ -113,9 +117,7 @@ def generic_data_container(self) -> GenericDataContainer:
113117

114118
@generic_data_container.setter
115119
def generic_data_container(self, value: GenericDataContainer):
116-
"""GenericDataContainer wrapped into the MeshInfo
117-
that contains all the relative information of the derived class.
118-
"""
120+
"""GenericDataContainer wrapped into the MeshInfo that contains all the relative information of the derived class."""
119121
if not isinstance(value, GenericDataContainer):
120122
raise ValueError("Input value must be a GenericDataContainer.")
121123
self._generic_data_container = value
@@ -169,7 +171,8 @@ def set_property(self, property_name, prop):
169171

170172
@property
171173
def number_nodes(self):
172-
"""
174+
"""Returns number of nodes in the mesh.
175+
173176
Returns
174177
-------
175178
number_nodes : int
@@ -179,7 +182,8 @@ def number_nodes(self):
179182

180183
@property
181184
def number_faces(self):
182-
"""
185+
"""Returns number of faces in the mesh.
186+
183187
Returns
184188
-------
185189
number_faces : int
@@ -192,7 +196,8 @@ def number_faces(self):
192196

193197
@property
194198
def number_elements(self):
195-
"""
199+
"""Returns number of elements in the mesh.
200+
196201
Returns
197202
-------
198203
number_elements : int
@@ -205,7 +210,8 @@ def number_elements(self):
205210

206211
@property
207212
def splittable_by(self):
208-
"""
213+
"""Return name of properties according to which the mesh can be split by.
214+
209215
Returns
210216
-------
211217
splittable by which entity : StringField
@@ -218,7 +224,8 @@ def splittable_by(self):
218224

219225
@property
220226
def available_elem_types(self):
221-
"""
227+
"""Returns available mesh element types.
228+
222229
Returns
223230
-------
224231
available element types : Scoping
@@ -231,7 +238,8 @@ def available_elem_types(self):
231238

232239
@property
233240
def part_names(self):
234-
"""
241+
"""Return part names of the mesh.
242+
235243
Returns
236244
-------
237245
part_names : StringField
@@ -267,7 +275,8 @@ def parts(self) -> dict:
267275

268276
@property
269277
def part_scoping(self):
270-
"""
278+
"""Return part scoping of the mesh.
279+
271280
Returns
272281
-------
273282
part_scoping : Scoping
@@ -283,7 +292,8 @@ def part_scoping(self):
283292

284293
@property
285294
def body_names(self):
286-
"""
295+
"""Return body names of the mesh.
296+
287297
Returns
288298
-------
289299
body_names : StringField
@@ -296,7 +306,8 @@ def body_names(self):
296306

297307
@property
298308
def body_scoping(self):
299-
"""
309+
"""Return body scoping of the mesh.
310+
300311
Returns
301312
-------
302313
body_scoping : Scoping
@@ -332,7 +343,8 @@ def bodies(self) -> dict:
332343

333344
@property
334345
def zone_names(self):
335-
"""
346+
"""Return zone names of the mesh.
347+
336348
Returns
337349
-------
338350
zone_names : StringField
@@ -423,7 +435,8 @@ def cell_zones(self) -> dict:
423435

424436
@property
425437
def zone_scoping(self):
426-
"""
438+
"""Return zone scoping of the mesh.
439+
427440
Returns
428441
-------
429442
zone_scoping : Scoping
@@ -439,20 +452,20 @@ def zone_scoping(self):
439452

440453
@number_nodes.setter
441454
def number_nodes(self, value):
442-
"""Set the number of nodes in the mesh"""
455+
"""Set the number of nodes in the mesh."""
443456
self.generic_data_container.set_property("num_nodes", value)
444457

445458
@number_elements.setter
446459
def number_elements(self, value):
447-
"""Set the number of elements in the mesh"""
460+
"""Set the number of elements in the mesh."""
448461
self.generic_data_container.set_property("num_elements", value)
449462

450463
@splittable_by.setter
451464
def splittable_by(self, value):
452-
"""Set name of the properties according to which the mesh can be split by"""
465+
"""Set name of the properties according to which the mesh can be split by."""
453466
self.generic_data_container.set_property("splittable_by", value)
454467

455468
@available_elem_types.setter
456469
def available_elem_types(self, value):
457-
"""Set the available element types"""
470+
"""Set the available element types."""
458471
self.generic_data_container.set_property("available_elem_types", value)

src/ansys/dpf/core/mesh_scoping_factory.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
# SOFTWARE.
2222

2323
"""
24-
mesh_scoping_factory
24+
mesh_scoping_factory.
2525
2626
Contains functions to simplify creating mesh scopings.
2727
"""

0 commit comments

Comments
 (0)