• 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

75.76
/src/abaqus/Mesh/MeshElementArray.py
1
from __future__ import annotations
1✔
2

3
from typing import List, Sequence, Union
1✔
4

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

7
from .MeshElement import MeshElement
1✔
8

9

10
@abaqus_class_doc
1✔
11
class MeshElementArray(List[MeshElement]):
1✔
12
    """The MeshElementArray is a sequence of MeshElement objects.
13

14
    .. note::
15
        This object can be accessed by::
16

17
            import part
18
            mdb.models[name].parts[name].allInternalSets[name].elements
19
            mdb.models[name].parts[name].allInternalSurfaces[name].elements
20
            mdb.models[name].parts[name].allSets[name].elements
21
            mdb.models[name].parts[name].allSurfaces[name].elements
22
            mdb.models[name].parts[name].elements
23
            mdb.models[name].parts[name].sets[name].elements
24
            mdb.models[name].parts[name].surfaces[name].elements
25
            import assembly
26
            mdb.models[name].rootAssembly.allInstances[name].elements
27
            mdb.models[name].rootAssembly.allInstances[name].sets[name].elements
28
            mdb.models[name].rootAssembly.allInstances[name].surfaces[name].elements
29
            mdb.models[name].rootAssembly.allInternalSets[name].elements
30
            mdb.models[name].rootAssembly.allInternalSurfaces[name].elements
31
            mdb.models[name].rootAssembly.allSets[name].elements
32
            mdb.models[name].rootAssembly.allSurfaces[name].elements
33
            mdb.models[name].rootAssembly.elements
34
            mdb.models[name].rootAssembly.instances[name].elements
35
            mdb.models[name].rootAssembly.instances[name].sets[name].elements
36
            mdb.models[name].rootAssembly.instances[name].surfaces[name].elements
37
            mdb.models[name].rootAssembly.modelInstances[i].elements
38
            mdb.models[name].rootAssembly.modelInstances[i].sets[name].elements
39
            mdb.models[name].rootAssembly.modelInstances[i].surfaces[name].elements
40
            mdb.models[name].rootAssembly.sets[name].elements
41
            mdb.models[name].rootAssembly.surfaces[name].elements
42
    """
43

44
    @abaqus_method_doc
1✔
45
    def __init__(self, elements: list[MeshElement]) -> None:
1✔
46
        """This method creates a MeshElementArray object.
47

48
        .. note::
49
            This function can be accessed by::
50

51
                mesh.MeshElementArray
52

53
        Parameters
54
        ----------
55
        elements
56
            A list of MeshElement objects.
57

58
        Returns
59
        -------
60
        MeshElementArray
61
            A MeshElementArray object.
62
        """
63
        super().__init__()
1✔
64

65
    @abaqus_method_doc
1✔
66
    def getFromLabel(self, label: int) -> MeshElement:
1✔
67
        """This method returns the object in the MeshElementArray with the given label.
68

69
        Parameters
70
        ----------
71
        label
72
            An Int specifying the label of the object.
73

74
        Returns
75
        -------
76
        MeshElement
77
            A MeshElement object.
78
        """
79
        return MeshElement()
×
80

81
    @abaqus_method_doc
1✔
82
    def getSequenceFromMask(self, mask: Union[str, Sequence[str]]) -> MeshElementArray:
1✔
83
        """This method returns the objects in the MeshElementArray identified using the specified
84
        **mask**. This command is generated when the JournalOptions are set to COMPRESSEDINDEX.
85
        When a large number of objects are involved, this method is highly efficient.
86

87
        Parameters
88
        ----------
89
        mask
90
            A String specifying the object or objects.
91

92
        Returns
93
        -------
94
        MeshElementArray
95
            A MeshElementArray object.
96
        """
97
        return MeshElementArray([MeshElement()])
×
98

99
    @abaqus_method_doc
1✔
100
    def getMask(self) -> str:
1✔
101
        """This method returns a string specifying the object or objects.
102

103
        Returns
104
        -------
105
        str
106
            A String specifying the object or objects.
107
        """
108
        return ""
×
109

110
    @abaqus_method_doc
1✔
111
    def getByBoundingBox(
1✔
112
        self,
113
        xMin: float = 0,
114
        yMin: float = 0,
115
        zMin: float = 0,
116
        xMax: float = 0,
117
        yMax: float = 0,
118
        zMax: float = 0,
119
    ) -> MeshElementArray:
120
        """This method returns an array of element objects that lie within the specified bounding box.
121

122
        Parameters
123
        ----------
124
        xMin
125
            A float specifying the minimum X boundary of the bounding box.
126
        yMin
127
            A float specifying the minimum Y boundary of the bounding box.
128
        zMin
129
            A float specifying the minimum Z boundary of the bounding box.
130
        xMax
131
            A float specifying the maximum X boundary of the bounding box.
132
        yMax
133
            A float specifying the maximum Y boundary of the bounding box.
134
        zMax
135
            A float specifying the maximum Z boundary of the bounding box.
136

137
        Returns
138
        -------
139
        MeshElementArray
140
            A MeshElementArray object, which is a sequence of MeshElement objects.
141
        """
142
        return MeshElementArray([MeshElement()])
×
143

144
    @abaqus_method_doc
1✔
145
    def getByBoundingCylinder(self, center1: tuple, center2: tuple, radius: str) -> MeshElementArray:
1✔
146
        """This method returns an array of element objects that lie within the specified bounding cylinder.
147

148
        Parameters
149
        ----------
150
        center1
151
            A tuple of the X-, Y-, and Z-coordinates of the center of the first end of the cylinder.
152
        center2
153
            A tuple of the X-, Y-, and Z-coordinates of the center of the second end of the
154
            cylinder.
155
        radius
156
            A float specifying the radius of the cylinder.
157

158
        Returns
159
        -------
160
        MeshElementArray
161
            A MeshElementArray object, which is a sequence of MeshElement objects.
162
        """
163
        return MeshElementArray([MeshElement()])
×
164

165
    @abaqus_method_doc
1✔
166
    def getByBoundingSphere(self, center: tuple[float, float, float], radius: float) -> MeshElementArray:
1✔
167
        """This method returns an array of element objects that lie within the specified bounding sphere.
168

169
        Parameters
170
        ----------
171
        center
172
            A tuple of the X-, Y-, and Z-coordinates of the center of the sphere.
173
        radius
174
            A float specifying the radius of the sphere.
175

176
        Returns
177
        -------
178
        MeshElementArray
179
            A MeshElementArray object, which is a sequence of MeshElement objects.
180
        """
181
        return MeshElementArray([MeshElement()])
×
182

183
    @abaqus_method_doc
1✔
184
    def getBoundingBox(self) -> dict[str, tuple[float, float, float]]:
1✔
185
        """This method returns a dictionary of two tuples representing minimum and maximum boundary values of
186
        the bounding box of the minimum size containing the element sequence.
187

188
        Returns
189
        -------
190
        dict[str, tuple[float, float, float]]
191
            A Dictionary object with the following items:
192

193
            - **low**: a tuple of three floats representing the minimum x, y, and z boundary values of
194
              the bounding box.
195
            - **high**: a tuple of three floats representing the maximum x, y, and z boundary values of
196
              the bounding box.
197
        """
198
        return {"low": (0.0, 0.0, 0.0), "high": (0.0, 0.0, 0.0)}
×
199

200
    @abaqus_method_doc
1✔
201
    def sequenceFromLabels(self, labels: Sequence[int]) -> MeshElementArray:
1✔
202
        """This method returns the objects in the MeshElementArray identified using the specified labels.
203

204
        Parameters
205
        ----------
206
        labels
207
            A sequence of Ints specifying the labels.
208

209
        Returns
210
        -------
211
        MeshElementArray
212
            A MeshElementArray object.
213

214
        Raises
215
        ------
216
        Error
217
            The mask results in an empty sequence, An exception occurs if the resulting sequence is empty.
218
        """
219
        return MeshElementArray([MeshElement()])
×
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