• 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

72.34
/src/abaqus/BasicGeometry/Edge.py
1
from __future__ import annotations
1✔
2

3
from typing import TYPE_CHECKING
1✔
4

5
from abqpy.decorators import abaqus_class_doc, abaqus_method_doc
1✔
6

7
from ..Mesh.MeshElement import MeshElement
1✔
8
from ..Mesh.MeshNode import MeshNode
1✔
9
from ..UtilityAndView.abaqusConstants import OFF, Boolean
1✔
10

11
if TYPE_CHECKING:  # to avoid circular imports
1✔
12
    from ..Mesh.MeshElementArray import MeshElementArray
×
13
    from ..Mesh.MeshNodeArray import MeshNodeArray
×
14
    from .EdgeArray import EdgeArray
×
15

16

17
@abaqus_class_doc
1✔
18
class Edge:
1✔
19
    """Edges are one-dimensional regions of geometry.
20

21
    .. note::
22
        This object can be accessed by::
23

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

51
    #: An Int specifying the index of the edge in the EdgeArray.
52
    index: int | None = None
1✔
53

54
    #: A Boolean specifying whether the edge belongs to the reference representation of the
55
    #: Part or Instance.
56
    isReferenceRep: Boolean = OFF
1✔
57

58
    #: A tuple of Floats specifying the **X**, **Y**, and **Z** coordinates of a point located on
59
    #: the edge.
60
    pointOn: float | None = None
1✔
61

62
    #: A tuple of Floats specifying the name of the feature that created this edge.
63
    featureName: float | None = None
1✔
64

65
    #: A tuple of Floats specifying the name of the part instance for this edge (if
66
    #: applicable).
67
    instanceName: float | None = None
1✔
68

69
    @abaqus_method_doc
1✔
70
    def isTangentFlipped(self) -> Boolean:
1✔
71
        """This method determines whether the tangent to the edge is flipped from its default direction by the
72
        use of the flipTangent method on a Part object.
73

74
        Returns
75
        -------
76
        Boolean
77
            A Boolean value of True if the tangent is flipped and False if not.
78
        """
79
        return True
×
80

81
    @abaqus_method_doc
1✔
82
    def getCurvature(self, parameter: float, point: tuple[float, float, float]) -> dict[str, float]:
1✔
83
        """This method returns curvature information at a location on the edge.
84

85
        Parameters
86
        ----------
87
        parameter
88
            A Float specifying the normalized parameter location on the edge where the curvature is
89
            to be computed. This argument is mutually exclusive with the argument **point**.
90
        point
91
            A tuple of **X**, **Y**, and **Z** coordinates of a point at which the curvature is to be
92
            computed. If **point** does not lie on the edge an attempt is made to project it onto the
93
            edge and use the projected point.
94

95
        Returns
96
        -------
97
        dict
98
            A dictionary with keys 'evaluationPoint', 'curvature', 'radius', and 'tangent', where
99
            'evaluationPoint' specifies the location at which the curvature was computed;
100
            'curvature' specifies the curvature vector at that location; 'radius' is the radius of
101
            curvature; and 'tangent' specifies the tangent to the edge at that location.
102

103
        Raises
104
        ------
105
        The given edge is straight
106
        """
107
        return {"evaluationPoint": 0.0, "curvature": 0.0, "radius": 0.0, "tangent": 0.0}
×
108

109
    @abaqus_method_doc
1✔
110
    def getFaces(self) -> tuple[int]:
1✔
111
        """This method returns a sequence consisting of the face ids of the faces which share this edge.
112

113
        Returns
114
        -------
115
        tuple[int]
116
            A tuple of integers.
117
        """
118
        return (0,)
×
119

120
    @abaqus_method_doc
1✔
121
    def getAdjacentEdges(self) -> EdgeArray:
1✔
122
        """This method returns an array of Edge objects that share at least one vertex of the edge.
123

124
        Returns
125
        -------
126
        EdgeArray
127
            An EdgeArray object, which is a sequence of Edge objects.
128
        """
129
        return EdgeArray([Edge()])
×
130

131
    @abaqus_method_doc
1✔
132
    def getEdgesByEdgeAngle(self, angle: str) -> EdgeArray:
1✔
133
        """This method returns an array of Edge objects that are obtained by recursively finding adjacent edges
134
        that are at an angle of less than or equal to the specified face angle.
135

136
        Parameters
137
        ----------
138
        angle
139
            A float specifying the value of the face angle in degrees.
140

141
        Returns
142
        -------
143
        EdgeArray
144
            An EdgeArray object, which is a sequence of Edgeobjects.
145
        """
146
        return EdgeArray([Edge()])
×
147

148
    @abaqus_method_doc
1✔
149
    def getNodes(self) -> MeshNodeArray:
1✔
150
        """This method returns an array of node objects that are associated with the edge.
151

152
        Returns
153
        -------
154
        MeshNodeArray
155
            A MeshNodeArray object, which is a sequence of MeshNode objects.
156
        """
157
        return MeshNodeArray([MeshNode((0.0, 0.0, 0.0))])
×
158

159
    @abaqus_method_doc
1✔
160
    def getElements(self) -> MeshElementArray:
1✔
161
        """This method returns an array of element objects that are associated with the edge.
162

163
        Returns
164
        -------
165
        MeshElementArray
166
            A MeshElementArray object which is a sequence of MeshElement objects.
167
        """
168
        return MeshElementArray([MeshElement()])
×
169

170
    @abaqus_method_doc
1✔
171
    def getRadius(self) -> float:
1✔
172
        """This method returns the radius of circular edges.
173

174
        Returns
175
        -------
176
        float
177
            A Float specifying the radius.
178

179
        Raises
180
        ------
181
        The given edges is not circular
182
        """
183
        return 0.0
×
184

185
    @abaqus_method_doc
1✔
186
    def getSize(self, printResults: bool = True) -> float:
1✔
187
        """This method returns a Float indicating the length of the edge.
188

189
        Parameters
190
        ----------
191
        printResults
192
            A Bool specifying whether verbose output is printed. The default is True.
193

194
        Returns
195
        -------
196
        float
197
            A Float.
198
        """
199
        return 0.0
×
200

201
    @abaqus_method_doc
1✔
202
    def getVertices(self) -> tuple[int]:
1✔
203
        """This method returns a sequence of indices of the vertices that bound this edge. The
204
        first index refers to the vertex where the normalized curve parameter = 0.0, and the
205
        second index refers to the vertex where the normalized curve parameter = 1.0. If the
206
        edge is a closed curve, only one vertex index is returned.
207

208
        Returns
209
        -------
210
        tuple[int]
211
            A tuple of integers.
212

213
        """
214
        return (0,)
×
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