• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

haiiliin / abqpy / 5910646359

19 Aug 2023 09:25AM UTC coverage: 83.152% (-0.1%) from 83.3%
5910646359

push

github

web-flow
[typing] Fix wrong mypy typing annotations (backport #4879) (#4880)

* [typing] Fix wrong mypy typing annotations (#4879)

* Fix mypy abqpy issues

* Mypy typings

* Update typing annotations for SymbolicConstants

* Fixing typings

* Add future annotations

* Use list/dict/tuple instead of List/Dict/Tuple

* Fix Optional typings

* Add future annotations

* Update xyPlot.py

* Update .pre-commit-config.yaml

* Fix list typings for Python 3.7/3.8

* Fixing more typings

* Fix more typings

* Update conf.py

* Update .pre-commit-config.yaml

* Revert "Update conf.py"

This reverts commit e8449ae0c.

* Update conf.py

* Revert "Update conf.py"

This reverts commit 3be44d0a5.

* Docs Not -W

(cherry picked from commit d7be4b472)

# Conflicts:
#	src/abaqus/BasicGeometry/Cell.py
#	src/abaqus/BasicGeometry/CellArray.py
#	src/abaqus/BasicGeometry/Face.py
#	src/abaqus/BasicGeometry/FaceArray.py
#	src/abaqus/BoundaryCondition/BoundaryConditionModel.py
#	src/abaqus/BoundaryCondition/SubmodelBC.py
#	src/abaqus/Datum/DatumCsys.py
#	src/abaqus/DisplayGroup/LeafFromConstraintNames.py
#	src/abaqus/EngineeringFeature/DataImperfection.py
#	src/abaqus/EngineeringFeature/EngineeringFeature.py
#	src/abaqus/EngineeringFeature/EngineeringFeatureBase.py
#	src/abaqus/EngineeringFeature/FileImperfection.py
#	src/abaqus/EngineeringFeature/InputImperfection.py
#	src/abaqus/FieldReport/FieldReportSession.py
#	src/abaqus/FieldReport/writeFieldReport.py
#	src/abaqus/Interaction/ContactExp.py
#	src/abaqus/Interaction/ContactStd.py
#	src/abaqus/Interaction/ExpInitialization.py
#	src/abaqus/Interaction/FluidInflatorProperty.py
#	src/abaqus/Interaction/FluidInflatorState.py
#	src/abaqus/Interaction/InteractionContactInitializationModel.py
#	src/abaqus/Interaction/InteractionModel.py
#	src/abaqus/Interaction/InteractionPropertyModel.py
#	src/abaqus/Interaction/SurfaceCrushTriggerAssignment.py
#... (continued)

3258 of 3258 new or added lines in 713 files covered. (100.0%)

24089 of 28970 relevant lines covered (83.15%)

0.83 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

65.22
/src/abaqus/BasicGeometry/Face.py
1
from __future__ import annotations
1✔
2

3
from typing import TYPE_CHECKING, Sequence
1✔
4

5
from typing_extensions import Literal
1✔
6

7
from abqpy.decorators import abaqus_class_doc, abaqus_method_doc
1✔
8

9
from ..Mesh.MeshElement import MeshElement
1✔
10
from ..Mesh.MeshFace import MeshFace
1✔
11
from ..Mesh.MeshNode import MeshNode
1✔
12
from ..UtilityAndView.abaqusConstants import BOTH_SIDES, OFF, Boolean
1✔
13
from ..UtilityAndView.abaqusConstants import abaqusConstants as C
1✔
14

15
if TYPE_CHECKING:  # to avoid circular imports
1✔
16
    from ..Mesh.MeshElementArray import MeshElementArray
×
17
    from ..Mesh.MeshFaceArray import MeshFaceArray
×
18
    from ..Mesh.MeshNodeArray import MeshNodeArray
×
19
    from .FaceArray import FaceArray
×
20

21

22
@abaqus_class_doc
1✔
23
class Face:
1✔
24
    """Faces are two-dimensional regions of geometry.
25

26
    .. note::
27
        This object can be accessed by::
28

29
            import part
30
            mdb.models[name].parts[name].allInternalSets[name].faces[i]
31
            mdb.models[name].parts[name].allInternalSurfaces[name].faces[i]
32
            mdb.models[name].parts[name].allSets[name].faces[i]
33
            mdb.models[name].parts[name].allSurfaces[name].faces[i]
34
            mdb.models[name].parts[name].faces[i]
35
            mdb.models[name].parts[name].sets[name].faces[i]
36
            mdb.models[name].parts[name].surfaces[name].faces[i]
37
            import assembly
38
            mdb.models[name].rootAssembly.allInstances[name].faces[i]
39
            mdb.models[name].rootAssembly.allInstances[name].sets[name].faces[i]
40
            mdb.models[name].rootAssembly.allInstances[name].surfaces[name].faces[i]
41
            mdb.models[name].rootAssembly.allInternalSets[name].faces[i]
42
            mdb.models[name].rootAssembly.allInternalSurfaces[name].faces[i]
43
            mdb.models[name].rootAssembly.allSets[name].faces[i]
44
            mdb.models[name].rootAssembly.allSurfaces[name].faces[i]
45
            mdb.models[name].rootAssembly.instances[name].faces[i]
46
            mdb.models[name].rootAssembly.instances[name].sets[name].faces[i]
47
            mdb.models[name].rootAssembly.instances[name].surfaces[name].faces[i]
48
            mdb.models[name].rootAssembly.modelInstances[i].sets[name].faces[i]
49
            mdb.models[name].rootAssembly.modelInstances[i].surfaces[name].faces[i]
50
            mdb.models[name].rootAssembly.sets[name].faces[i]
51
            mdb.models[name].rootAssembly.surfaces[name].faces[i]
52
    """
53

54
    #: An Int specifying the index of the face in the FaceArray.
55
    index: int | None = None
1✔
56

57
    #: A Boolean specifying whether the face belongs to the reference representation of the
58
    #: Part or Instance.
59
    isReferenceRep: Boolean = OFF
1✔
60

61
    #: A tuple of tuples of Floats specifying the coordinates. For a face of a shell **pointOn**
62
    #: specifies the **X**, **Y**, and **Z** coordinates of a point located on the face and the
63
    #: **X**, **Y**, and **Z** components of the normal to the face.For a face of a solid **pointOn**
64
    #: specifies the **X**, **Y**, and **Z** coordinates of a point located on the face.
65
    pointOn: float | None = None
1✔
66

67
    #: A tuple of Floats specifying the name of the feature that created this face.
68
    featureName: float | None = None
1✔
69

70
    #: A tuple of Floats specifying the name of the part instance for this face (if
71
    #: applicable).
72
    instanceName: float | None = None
1✔
73

74
    @abaqus_method_doc
1✔
75
    def getCentroid(self) -> Sequence[float]:
1✔
76
        """This method returns the centroid of a face.
77

78
        Returns
79
        -------
80
        Sequence[float]
81
            A sequence of Floats specifying the **X**, **Y**, and **Z** coordinates of the centroid of
82
            the face.
83
        """
84
        return (0.0, 0.0, 0.0)
×
85

86
    @abaqus_method_doc
1✔
87
    def getCurvature(self, point: tuple[float, float, float], uParam: float, vParam: float) -> dict[str, float]:
1✔
88
        """This method returns information about the curvature at a location on the face.
89

90
        Parameters
91
        ----------
92
        point
93
            A tuple specifying the **X**, **Y**, and **Z** coordinates of the point where the curvature
94
            is desired. If the **point** does not lie on the face it will be projected onto the face.
95
            This argument and **uParam** and **vParam** are mutually exclusive.
96
        uParam
97
            A Float specifying the normalized **U** parameter value at which the curvature is to be
98
            computed. This value must lie between (0,1). **vParam** must also be specified. This
99
            argument is mutually exclusive with **point**.
100
        vParam
101
            A Float specifying the normalized **V** parameter value at which the curvature is to be
102
            computed. This value must lie between (0,1).
103

104
        Returns
105
        -------
106
        dict[str, float]
107
            A dictionary with keys 'evaluationPoint', 'principalAxis1', 'principalAxis2',
108
            'curvature1', 'curvature2' and 'gaussianCurvature'. Where the evaluationPoint specifies
109
            the location at which the curvature was evaluated. 'principalAxis1' and 'principalAxis2'
110
            refer to the vectors specifying the two principal axes of the face. 'curvature1' and
111
            'curvature2' specify the curvatures along the two principal axes.
112
        """
113
        return {
×
114
            "evaluationPoint": 0.0,
115
            "principalAxis1": 0.0,
116
            "principalAxis2": 0.0,
117
            "curvature1": 0.0,
118
            "curvature2": 0.0,
119
            "gaussianCurvature": 0.0,
120
        }
121

122
    @abaqus_method_doc
1✔
123
    def getElements(self) -> "MeshElementArray":
1✔
124
        """This method returns an array of element objects that are associated with the face.
125

126
        Returns
127
        -------
128
        MeshElementArray
129
            A MeshElementArray object which is a sequence of MeshElement objects.
130
        """
131
        from ..Mesh.MeshElementArray import MeshElementArray
×
132

133
        return MeshElementArray([MeshElement()])
×
134

135
    @abaqus_method_doc
1✔
136
    def getElementFaces(self, faceSide: Literal[C.SIDE2, C.SIDE1, C.BOTH_SIDES] = BOTH_SIDES) -> "MeshFaceArray":
1✔
137
        """This method returns an array of mesh face objects. Each mesh face object contains the element label
138
        and the side of the element that lies on the geometric face.
139

140
        Parameters
141
        ----------
142
        faceSide
143
            A symbolic constant specifying the side of the geometric face of a solid from which the
144
            element faces should be retrieved. Possible values are **SIDE1**, **SIDE2**, and
145
            **BOTH_SIDES**. The default value is **BOTH_SIDES**. For shell faces this option is ignored.
146

147
        Returns
148
        -------
149
        MeshFaceArray
150
            A MeshFaceArray object which is a sequence of MeshFace objects.
151
        """
152
        from ..Mesh.MeshFaceArray import MeshFaceArray
×
153

154
        return MeshFaceArray([MeshFace()])
×
155

156
    @abaqus_method_doc
1✔
157
    def getNodes(self, faceSide: Literal[C.SIDE2, C.BOTH_SIDES] = BOTH_SIDES) -> "MeshNodeArray":
1✔
158
        """This method returns an array of mesh node objects. Each mesh node object contains the label of the
159
        node that lies on the geometric face.
160

161
        Parameters
162
        ----------
163
        faceSide
164
            A symbolic constant specifying the side of the geometric face of a solid from which the
165
            nodes should be retrieved. Possible values are xo*SIDE1*, **SIDE2**, and **BOTH_SIDES**. The
166
            default value is **BOTH_SIDES**. For shell faces and for faces with compatible meshes on
167
            either sides this option is ignored. Otherwise, the nodes on the specified side(s) of
168
            the face are output.
169

170
        Returns
171
        -------
172
        MeshNodeArray
173
            A MeshNodeArray object which is a sequence of MeshNode objects.
174
        """
175
        from ..Mesh.MeshNodeArray import MeshNodeArray
×
176

177
        return MeshNodeArray([MeshNode((0.0, 0.0, 0.0))])
×
178

179
    @abaqus_method_doc
1✔
180
    def getNormal(self, point: tuple[float, float, float]) -> Sequence[float]:
1✔
181
        """This method returns the normal to a face at the location specified by the **pointOn** member. The
182
        normal at a different location on the face can be obtained by specifying the optional **point**
183
        argument.
184

185
        Parameters
186
        ----------
187
        point
188
            A tuple specifying the **X**, **Y**, and **Z** coordinates of the point where the normal to
189
            the face is desired. If the **point** does not lie on the face it will be projected onto
190
            the face.
191

192
        Returns
193
        -------
194
        Sequence[float]
195
            A sequence of Floats specifying the **X**, **Y**, and **Z** components of the normal to the
196
            face.
197

198
        Raises
199
        ------
200
        An exception is raised if the optional argument **point** is provided but the point cannot
201
        be projected onto the face.
202
        """
203
        return (0.0, 0.0, 0.0)
×
204

205
    @abaqus_method_doc
1✔
206
    def getSize(self, printResults: Boolean = True) -> float:
1✔
207
        """This method returns a Float indicating the area of the face.
208

209
        Parameters
210
        ----------
211
        printResults
212
            A Bool specifying whether verbose output is printed. The default value is True.
213

214
        Returns
215
        -------
216
        float
217
            A Float.
218
        """
219
        return 0.0
×
220

221
    @abaqus_method_doc
1✔
222
    def getEdges(self) -> Sequence[int]:
1✔
223
        """This method returns a sequence consisting of the edge ids of the edges on the face.
224

225
        Returns
226
        -------
227
        Sequence[int]
228
        A tuple of integers.
229
        """
230
        return (0,)
×
231

232
    @abaqus_method_doc
1✔
233
    def getVertices(self) -> Sequence[int]:
1✔
234
        """This method returns a sequence consisting of the vertex ids of the vertices of the face.
235

236
        Returns
237
        -------
238
        Sequence[int]
239
            A tuple of integers.
240
        """
241
        return (0,)
×
242

243
    @abaqus_method_doc
1✔
244
    def getCells(self) -> Sequence[int]:
1✔
245
        """This method returns a sequence consisting of the cell ids of the cells to which this face belongs.
246

247
        Returns
248
        -------
249
        Sequence[int]
250
            A tuple of integers.
251
        """
252
        return (0,)
×
253

254
    @abaqus_method_doc
1✔
255
    def getAdjacentFaces(self) -> "FaceArray":
1✔
256
        """This method returns an array of face objects that share at least one edge of the face.
257

258
        Returns
259
        -------
260
        FaceArray
261
            A FaceArray object which is a sequence of Face objects.
262
        """
263
        from .FaceArray import FaceArray
×
264

265
        return FaceArray([Face()])
×
266

267
    @abaqus_method_doc
1✔
268
    def getFacesByFaceAngle(self, angle: str) -> "FaceArray":
1✔
269
        """This method returns an array of Face objects that are obtained by recursively finding adjacent faces
270
        that are at an angle of less than or equal to the specified angle.
271

272
        Parameters
273
        ----------
274
        angle
275
            A float specifying the value of the face angle.
276

277
        Returns
278
        -------
279
        FaceArray
280
            A FaceArray object, which is a sequence of Face objects.
281
        """
282
        from .FaceArray import FaceArray
×
283

284
        return FaceArray([Face()])
×
285

286
    @abaqus_method_doc
1✔
287
    def getFacesByCurvature(self) -> "FaceArray":
1✔
288
        """This method returns an array of Face objects that are obtained by recursively finding adjacent faces
289
        that share the same curvature.
290

291
        Returns
292
        -------
293
        FaceArray
294
            A FaceArray object, which is a sequence of Face objects.
295
        """
296
        from .FaceArray import FaceArray
×
297

298
        return FaceArray([Face()])
×
299

300
    @abaqus_method_doc
1✔
301
    def isNormalFlipped(self) -> Boolean:
1✔
302
        """This method determines whether the normal to the face is flipped from its default direction by the
303
        use of the flipNormal method on a Part object.
304

305
        Returns
306
        -------
307
        Boolean
308
            A Boolean value of True if the normal is flipped and False if not.
309
        """
310
        return True
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc