• 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.0
/src/abaqus/BasicGeometry/IgnoredEdgeArray.py
1
from __future__ import annotations
1✔
2

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

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

7
from ..UtilityAndView.abaqusConstants import Boolean
1✔
8
from .IgnoredEdge import IgnoredEdge
1✔
9

10

11
@abaqus_class_doc
1✔
12
class IgnoredEdgeArray(List[IgnoredEdge]):
1✔
13
    """The IgnoredEdgeArray is a sequence of IgnoredEdge objects. If the part is modified, then IgnoredEdgeArray
14
    must be updated for that part.
15

16
    .. note::
17
        This object can be accessed by::
18

19
            import part
20
            mdb.models[name].parts[name].ignoredEdges
21
            import assembly
22
            mdb.models[name].rootAssembly.allInstances[name].ignoredEdges
23
            mdb.models[name].rootAssembly.instances[name].ignoredEdges
24
    """
25

26
    @overload
1✔
27
    @abaqus_method_doc
1✔
28
    def findAt(self, coordinates: tuple[float, float, float], printWarning: Boolean = True) -> IgnoredEdge:
1✔
29
        ...
×
30

31
    @overload
1✔
32
    @abaqus_method_doc
1✔
33
    def findAt(
1✔
34
        self,
35
        coordinates: tuple[tuple[float, float, float],],
36
        printWarning: Boolean = True,
37
    ) -> list[IgnoredEdge]:
38
        ...
×
39

40
    @overload
1✔
41
    @abaqus_method_doc
1✔
42
    def findAt(
1✔
43
        self,
44
        *coordinates: tuple[tuple[float, float, float],],
45
        printWarning: Boolean = True,
46
    ) -> list[IgnoredEdge]:
47
        ...
×
48

49
    @abaqus_method_doc
1✔
50
    def findAt(self, *args, **kwargs) -> Union[IgnoredEdge, list[IgnoredEdge]]:
1✔
51
        """This method returns the object or objects in the IgnoredEdgeArray located at the given coordinates.
52
        findAt initially uses the ACIS tolerance of 1E-6. As a result, findAt returns any IgnoredEdge that is at
53
        the arbitrary point specified or at a distance of less than 1E-6 from the arbitrary point. If nothing is
54
        found, findAt uses the tolerance for imprecise geometry (applicable only for imprecise geometric
55
        entities). The arbitrary point must not be shared by a second IgnoredEdge. If two IgnoredEdge objects
56
        intersect or coincide at the arbitrary point, findAt chooses the first IgnoredEdge that it encounters,
57
        and you should not rely on the return value being consistent. findAt will always try to find objects
58
        among all the ignored edges in the part or assembly instance and will not restrict itself to a subset
59
        even if the IgnoredEdgeArray represents such subset.
60

61
        Parameters
62
        ----------
63
        coordinates
64
            A sequence of Floats specifying the **X**, **Y**, and **Z**  coordinates of the object to
65
            find.findAt returns either an IgnoredEdge object or a sequence of IgnoredEdge objects
66
            based on the type of input.
67

68
            * If **coordinates** is a sequence of Floats, findAt returns the IgnoredEdge object at that point.
69

70
            * If you omit the **coordinates** keyword argument, findAt accepts as arguments a sequence
71
              of sequence of floats in the following format::
72

73
                ignoredEdges = e.findAt(((20.19686, -169.513997, 27.798593), ),
74
                                        ((19.657627, -167.295749, 27.056402), ),
75
                                        ((18.274129, -157.144741, 25.15218), ))
76
        printWarning
77
            A Boolean specifying whether a message is to be printed to the CLI if no entity is found
78
            at the specified location. The default value is True.
79

80
        Returns
81
        -------
82
        IgnoredEdge
83
            An IgnoredEdge object or a sequence of IgnoredEdge objects.
84
        """
85
        first_arg = kwargs.get("coordinates", args[0] if args else ((),))
×
86
        return IgnoredEdge() if isinstance(first_arg[0], float) else [IgnoredEdge()]
×
87

88
    @overload
1✔
89
    @abaqus_method_doc
1✔
90
    def getSequenceFromMask(self, mask: str) -> IgnoredEdge:  # type: ignore
1✔
91
        ...
×
92

93
    @overload
1✔
94
    @abaqus_method_doc
1✔
95
    def getSequenceFromMask(self, mask: Sequence[str]) -> list[IgnoredEdge]:  # type: ignore
1✔
96
        ...
×
97

98
    @abaqus_method_doc
1✔
99
    def getSequenceFromMask(self, mask: Union[str, Sequence[str]]) -> Union[IgnoredEdge, list[IgnoredEdge]]:  # type: ignore
1✔
100
        """This method returns the object or objects in the IgnoredEdgeArray identified using the specified
101
        **mask**. This command is generated when the JournalOptions are set to COMPRESSEDINDEX. When large
102
        number of objects are involved, this method is highly efficient.
103

104
        Parameters
105
        ----------
106
        mask
107
            A String specifying the object or objects.
108

109
        Returns
110
        -------
111
        IgnoredEdge
112
            An IgnoredEdge object or a sequence of IgnoredEdge objects.
113
        """
114
        return IgnoredEdge() if isinstance(mask, str) else [IgnoredEdge()]
×
115

116
    @abaqus_method_doc
1✔
117
    def getMask(self):
1✔
118
        """This method returns a string specifying the object or objects.
119

120
        Returns
121
        -------
122
        str
123
            A String specifying the object or objects.
124
        """
125
        return ""
×
126

127
    @abaqus_method_doc
1✔
128
    def getClosest(
1✔
129
        self, coordinates: tuple, searchTolerance: str = ""
130
    ) -> dict[str, tuple[IgnoredEdge, tuple[float, float, float]]]:
131
        """This method returns a object or objects in the IgnoredEdgeArray closest to the given set of points,
132
        where the given points need not lie on the edges in the IgnoredEdgeArray.
133

134
        Parameters
135
        ----------
136
        coordinates
137
            A sequence of a sequence of floats, where each sequence of floats describes the **X**,
138
            **Y**, and **Z** coordinates of a point::
139

140
                >>> r=e.getClosest(coordinates=((20.0, 20.0, 10.0),(-1.0, -15.0, 15), ))
141
                >>> r.keys()
142
                [0, 1]
143
                >>> r[0]
144
                (mdb.models['Model-1'].parts['Part-1'].ignoredEdges[3], (15.7090625762939, 20.0, 10.0))
145
        searchTolerance
146
            A double specifying the distance within which the closest object must lie. The default
147
            value is half of the parent part/instance size.
148

149
        Returns
150
        -------
151
        dict
152
            This method returns a dictionary object. The key to the dictionary object is the
153
            position of the input point in the tuple specified in the **coordinates** starting at
154
            index 0. If a closest IgnoredEdge could be found then the value is a sequence consisting
155
            of two objects. The first object in the sequence is an IgnoredEdge that is close to the
156
            input point referred to by the key. The second object in the sequence, is a sequence of
157
            floats which specify the **X**, **Y**, and **Z**  location of the closest point on the
158
            IgnoredEdge to the given point. See program listing above.
159

160
        Raises
161
        ------
162
        Error
163
            The mask results in an empty sequence, An exception occurs if the resulting sequence is empty.
164
        """
165
        return {"0": (IgnoredEdge(), (0.0, 0.0, 0.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