• 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

78.26
/src/abaqus/Adaptivity/AdaptivityIteration.py
1
from __future__ import annotations
1✔
2

3
from abqpy.decorators import abaqus_class_doc, abaqus_method_doc
1✔
4

5
from .ErrorIndicatorResult import ErrorIndicatorResult as ErrorIndicatorResultType
1✔
6
from .RuleResult import RuleResult as RuleResultType
1✔
7

8

9
@abaqus_class_doc
1✔
10
class AdaptivityIteration:
1✔
11
    """The AdaptivityIteration object contains information about a given iteration of the varying topology
12
    adaptivity process (adaptive remeshing).
13

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

17
            import job
18
            mdb.adaptivityProcesses[name].iterations[i]
19
    """
20

21
    #: A repository of RuleResult objects specifying the calculated results from sizing
22
    #: functions corresponding to the RemeshingRule objects for this iteration of an adaptivity
23
    #: process.
24
    ruleResults: dict[str, RuleResultType] = {}
1✔
25

26
    #: An Int specifying the sequence number for this iteration in the adaptivity process.
27
    iteration: int
1✔
28

29
    #: A String specifying the name of the job that was run for this iteration.
30
    jobName: str
1✔
31

32
    #: A String specifying the name of the model that was analyzed and remeshed in this
33
    #: iteration.
34
    modelName: str
1✔
35

36
    #: A String specifying the path to the ODB file that was created for this iteration.
37
    odbPath: str
1✔
38

39
    #: An Int specifying the number of part instances which generated errors while remeshing
40
    #: the model in this iteration of the adaptivity process.
41
    remeshingErrors: int
1✔
42

43
    @abaqus_method_doc
1✔
44
    def __init__(
1✔
45
        self,
46
        iteration: int,
47
        jobName: str,
48
        modelName: str,
49
        odbPath: str,
50
        remeshingErrors: int,
51
    ):
52
        """This method creates an AdaptivityIteration object.
53

54
        .. note::
55
            This function can be accessed by::
56

57
                mdb.adaptivityProcesses[name].AdaptivityIteration
58

59
        Parameters
60
        ----------
61
        iteration
62
            An Int specifying the sequence number for this iteration in the adaptivity process.
63
        jobName
64
            A String specifying the name of the job that was run for this iteration.
65
        modelName
66
            A String specifying the name of the model that was analyzed and remeshed in this
67
            iteration.
68
        odbPath
69
            A String specifying the path to the ODB file that was created for this iteration.
70
        remeshingErrors
71
            An Int specifying the number of part instances which generated errors while remeshing
72
            the model in this iteration of the adaptivity process.
73

74
        Returns
75
        -------
76
        AdaptivityIteration
77
            An AdaptivityIteration object.
78
        """
79
        ...
×
80

81
    @abaqus_method_doc
1✔
82
    def ErrorIndicatorResult(self, name: str, results: str) -> ErrorIndicatorResultType:
1✔
83
        """This method creates an ErrorIndicatorResult with data for an error indicator variable in a
84
        RemeshingRule for a given adaptivity iteration.
85

86
        .. note::
87
            This function can be accessed by::
88

89
                mdb.adaptivityProcesses[name].AdaptivityIteration
90

91
        Parameters
92
        ----------
93
        name
94
            A String specifying the name of the error indicator variable to which these results
95
            correspond.
96
        results
97
            A String-to-Float Dictionary specifying the calculated results from the sizing function
98
            corresponding to the error indicator variable represented by this ErrorIndicatorResult.
99

100
        Returns
101
        -------
102
        ErrorIndicatorResult
103
            An ErrorIndicatorResult object.
104

105
        Raises
106
        ------
107
        AbaqusException
108
        """
109
        self.ruleResults[name] = ruleResult = ErrorIndicatorResultType(name, results)
×
110
        return ruleResult
×
111

112
    @abaqus_method_doc
1✔
113
    def RuleResult(
1✔
114
        self,
115
        name: str,
116
        indicatorResults: dict[str, ErrorIndicatorResultType],
117
        numElems: int,
118
        minSizeElemCount: int,
119
        satisfiedVars: tuple = (),
120
    ) -> RuleResultType:
121
        """This method creates a RuleResult with data for a RemeshingRule for a given adaptivity iteration.
122

123
        .. note::
124
            This function can be accessed by::
125

126
                mdb.adaptivityProcesses[name].AdaptivityIteration
127

128
        Parameters
129
        ----------
130
        name
131
            A String specifying the name of the Remeshing Rule to which these results correspond.
132
        indicatorResults
133
            A repository of ErrorIndicatorResult objects specifying the calculated results from the
134
            sizing function corresponding to the error indicator variables for the Remeshing Rule.
135
        numElems
136
            An Int specifying the number of elements before remeshing in the region of the Remeshing
137
            Rule.
138
        minSizeElemCount
139
            An Int specifying the number of elements that were constrained to the minimum element
140
            size by the Remeshing Rule.
141
        satisfiedVars
142
            A sequence of Strings specifying the error indicator variables that have satisfied the
143
            Remeshing Rule.
144

145
        Returns
146
        -------
147
        RuleResult
148
            A RuleResult object.
149

150
        Raises
151
        ------
152
        AbaqusException
153
        """
154
        self.ruleResults[name] = ruleResult = RuleResultType(
×
155
            name, indicatorResults, numElems, minSizeElemCount, satisfiedVars
156
        )
157
        return ruleResult
×
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