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

haiiliin / abqpy / 9778474311

03 Jul 2024 01:08PM UTC coverage: 74.045% (-0.02%) from 74.061%
9778474311

push

github

web-flow
[bugfix] Move circular imports to `TYPE_CHECKING` blocks (backport #5586) (#5644)

[bugfix] Move circular imports to `TYPE_CHECKING` blocks (#5586)

* [bugfix] Move circular imports to TYPE_CHECKING blocks

* Update

(cherry picked from commit d7a30a18b)

Co-authored-by: Hailin Wang <hailin.wang@connect.polyu.hk>

17 of 23 new or added lines in 6 files covered. (73.91%)

7 existing lines in 1 file now uncovered.

24777 of 33462 relevant lines covered (74.05%)

0.74 hits per line

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

84.62
/src/abaqus/Assembly/ModelInstance.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 ..BasicGeometry.EdgeArray import EdgeArray
1✔
8
from ..BasicGeometry.ReferencePoint import ReferencePoint
1✔
9
from ..BasicGeometry.VertexArray import VertexArray
1✔
10
from ..Datum.Datum import Datum
1✔
11
from ..Mesh.MeshElementArray import MeshElementArray
1✔
12
from ..Mesh.MeshNodeArray import MeshNodeArray
1✔
13
from ..Region.Set import Set
1✔
14
from ..Region.Surface import Surface
1✔
15
from ..UtilityAndView.abaqusConstants import OFF, Boolean
1✔
16

17
if TYPE_CHECKING:
1✔
NEW
18
    from ..Model.Model import Model
×
19

20

21
@abaqus_class_doc
1✔
22
class ModelInstance:
1✔
23
    """A ModelInstance object is an instance of a Model.
24

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

28
            import assembly
29
            mdb.models[name].rootAssembly.modelInstances[i]
30
    """
31

32
    #: A repository of Set objects specifying the sets created on the assembly. For more
33
    #: information, see [Region
34
    #: commands](https://help.3ds.com/2022/english/DSSIMULIA_Established/SIMACAEKERRefMap/simaker-m-RegPyc-sb.htm?ContextScope=all).
35
    sets: dict[str, Set] = {}
1✔
36

37
    #: A repository of Surface objects specifying the surfaces created on the assembly. For
38
    #: more information, see [Region
39
    #: commands](https://help.3ds.com/2022/english/DSSIMULIA_Established/SIMACAEKERRefMap/simaker-m-RegPyc-sb.htm?ContextScope=all).
40
    surfaces: dict[str, Surface] = {}
1✔
41

42
    #: A VertexArray object.
43
    vertices: VertexArray = VertexArray([])
1✔
44

45
    #: An EdgeArray object.
46
    edges: EdgeArray = EdgeArray([])
1✔
47

48
    #: A MeshElementArray object.
49
    elements: MeshElementArray = MeshElementArray([])
1✔
50

51
    #: A MeshNodeArray object.
52
    nodes: MeshNodeArray = MeshNodeArray([])
1✔
53

54
    #: A repository of Datum objects.
55
    datums: dict[str, Datum] = {}
1✔
56

57
    #: A repository of ReferencePoint objects.
58
    referencePoints: dict[str, ReferencePoint] = {}
1✔
59

60
    @abaqus_method_doc
1✔
61
    def __init__(self, name: str, model: Model, autoOffset: Boolean = OFF):
1✔
62
        """This method creates a ModelInstance object and puts it into the instances repository.
63

64
        .. note::
65
            This function can be accessed by::
66

67
                mdb.models[name].rootAssembly.Instance
68

69
        Parameters
70
        ----------
71
        name
72
            The repository key. The name must be a valid Abaqus object name.
73
        model
74
            A Model object to be instanced. If the model does not exist, no ModelInstance object is
75
            created.
76
        autoOffset
77
            A Boolean specifying whether to apply an auto offset to the new instance that will
78
            offset it from existing instances. The default value is OFF.
79

80
        Returns
81
        -------
82
        ModelInstance
83
            A ModelInstance object.
84
        """
85
        ...
×
86

87
    @abaqus_method_doc
1✔
88
    def ConvertConstraints(self):
1✔
89
        """This method converts the position constraints of an instance to absolute positions.
90

91
        The method deletes the constraint features on the instance but preserves the position in space.
92
        """
93
        ...
×
94

95
    @abaqus_method_doc
1✔
96
    def getPosition(self):
1✔
97
        """This method prints the sum of the translations and rotations applied to the ModelInstance object."""
98
        ...
×
99

100
    @abaqus_method_doc
1✔
101
    def replace(self, instanceOf: Model, applyConstraints: Boolean = True):
1✔
102
        """This method replaces one instance with an instance of another model.
103

104
        .. versionadded:: 2019
105
            The ``replace`` method was added.
106

107
        Parameters
108
        ----------
109
        instanceOf
110
            A Model object to be instanced. If the model does not exist, no ModelInstance object is
111
            created.
112
        applyConstraints
113
            A Boolean specifying whether to apply existing constraints on the new instance or to
114
            position the new instance in the same place as the original instance. The default value
115
            is True. A value of False indicates that constraints applies to the instance are deleted
116
            will be deleted from the feature list.
117
        """
118
        ...
×
119

120
    @abaqus_method_doc
1✔
121
    def translate(self, vector: tuple):
1✔
122
        """This method translates an instance by the specified amount.
123

124
        Parameters
125
        ----------
126
        vector
127
            A sequence of three Floats specifying a translation vector.
128
        """
129
        ...
×
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

© 2025 Coveralls, Inc