Skip to content

Commit

Permalink
[typing] Fix typing error about data arrays (backport #5732) (#5746)
Browse files Browse the repository at this point in the history
Co-authored-by: Hailin Wang <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Aug 28, 2024
1 parent 46f84a2 commit ae56ad3
Show file tree
Hide file tree
Showing 125 changed files with 280 additions and 225 deletions.
2 changes: 1 addition & 1 deletion src/abaqus/Adaptivity/RemeshingRule.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class RemeshingRule:

#: A sequence of Strings specifying the output request variables that Abaqus will use as
#: error indicators.
variables: tuple
variables: tuple[str, ...] = ()

#: A String specifying a descriptive string for this rule. The default value is an empty
#: string.
Expand Down
2 changes: 1 addition & 1 deletion src/abaqus/Adaptivity/RuleResult.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class RuleResult:

#: A sequence of Strings specifying the error indicator variables that have satisfied the
#: Remeshing Rule.
satisfiedVars: tuple = ()
satisfiedVars: tuple[str, ...] = ()

@abaqus_method_doc
def __init__(
Expand Down
2 changes: 1 addition & 1 deletion src/abaqus/Amplitude/BaselineCorrection.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class BaselineCorrection:
#: A sequence of Floats specifying the correction time interval end points. Possible values
#: are positive and monotonically increasing Floats. The default value is an empty
#: sequence.
intervals: tuple = ()
intervals: tuple[float, ...] = ()

@abaqus_method_doc
def __init__(self, intervals: tuple = ()):
Expand Down
2 changes: 1 addition & 1 deletion src/abaqus/Amplitude/Correlation.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Correlation(Amplitude):
#: A tuple of tuples of Floats specifying the real and imaginary part of the scaling
#: factor. If **approach** = MOVING_NOISE, then **data** represents the noise velocity components
#: 1, 2, and 3.
data: float | None = None
data: tuple[tuple[float, ...], ...] = ()

#: A SymbolicConstant specifying the time span of the amplitude. Possible values are STEP
#: and TOTAL. The default value is STEP.
Expand Down
2 changes: 1 addition & 1 deletion src/abaqus/Amplitude/EquallySpacedAmplitude.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class EquallySpacedAmplitude(Amplitude):
fixedInterval: float

#: A sequence of Floats specifying the amplitude values.
data: tuple
data: tuple[float, ...] = ()

#: A Float specifying the time at which the first amplitude data are given. Possible values
#: are non-negative numbers. The default value is 0.0.
Expand Down
2 changes: 1 addition & 1 deletion src/abaqus/Amplitude/PeriodicAmplitude.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class PeriodicAmplitude(Amplitude):
a_0: float

#: A sequence of pairs of Floats specifying AiAi and BiBi pairs.
data: tuple
data: tuple[tuple[float, float], ...] = ()

#: A SymbolicConstant specifying the time span of the amplitude. Possible values are STEP
#: and TOTAL. The default value is STEP.
Expand Down
2 changes: 1 addition & 1 deletion src/abaqus/Amplitude/PsdDefinition.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class PsdDefinition(Amplitude):
#: A sequence of sequences of Floats specifying the real part of the frequency function,
#: the imaginary part of the frequency function, and the frequency or frequency band number
#: values, depending on the value of **unitType**.
data: tuple
data: tuple[tuple[float, ...], ...] = ()

#: A SymbolicConstant specifying the type of units for specifying the frequency function.
#: FORCE implies power units. BASE implies gravity used to define base motion. DB implies
Expand Down
2 changes: 1 addition & 1 deletion src/abaqus/Amplitude/SmoothStepAmplitude.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class SmoothStepAmplitude(Amplitude):

#: A sequence of pairs of Floats specifying time/frequency and amplitude pairs. Possible
#: values for time/frequency are positive numbers.
data: tuple
data: tuple[tuple[float, float], ...] = ()

#: A SymbolicConstant specifying the time span of the amplitude. Possible values are STEP
#: and TOTAL. The default value is STEP.
Expand Down
2 changes: 1 addition & 1 deletion src/abaqus/Amplitude/SpectrumAmplitude.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class SpectrumAmplitude(Amplitude):

#: A sequence of sequences of Floats specifying the magnitude, frequency, and damping
#: values.
data: tuple
data: tuple[tuple[float, ...], ...] = ()

#: A SymbolicConstant specifying the units used for specifying the spectrum. Possible
#: values are DISPLACEMENT, VELOCITY, ACCELERATION, and GRAVITY. The default value is
Expand Down
2 changes: 1 addition & 1 deletion src/abaqus/Amplitude/TabularAmplitude.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class TabularAmplitude(Amplitude):

#: A sequence of pairs of Floats specifying time/frequency and amplitude pairs. Possible
#: values for time/frequency are positive numbers.
data: Sequence[Sequence[float]]
data: tuple[tuple[float, float], ...] = ()

#: The SymbolicConstant SOLVER_DEFAULT or a Float specifying the degree of smoothing.
#: Possible float values are between 0 and 0.5. If **smooth** = SOLVER_DEFAULT, the default
Expand Down
34 changes: 30 additions & 4 deletions src/abaqus/Annotation/Arrow.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,20 @@ class Arrow(Annotation, _OptionsBase):
#: - TOP_RIGHT
#:
#: The default value is BOTTOM_LEFT.
startAnchor: Union[SymbolicConstant, float] = BOTTOM_LEFT
startAnchor: Union[
Literal[
C.CENTER_RIGHT,
C.TOP_CENTER,
C.BOTTOM_RIGHT,
C.BOTTOM_LEFT,
C.CENTER,
C.TOP_RIGHT,
C.CENTER_LEFT,
C.TOP_LEFT,
C.BOTTOM_CENTER,
],
tuple[float, ...],
] = BOTTOM_LEFT

#: A SymbolicConstant or a sequence of Floats specifying a point. A sequence of two Floats
#: specifies the **X** and **Y** coordinates as percentages of the viewport width and height.
Expand All @@ -80,7 +93,20 @@ class Arrow(Annotation, _OptionsBase):
#: - TOP_RIGHT
#:
#: The default value is BOTTOM_LEFT.
endAnchor: Union[SymbolicConstant, float] = BOTTOM_LEFT
endAnchor: Union[
Literal[
C.CENTER_RIGHT,
C.TOP_CENTER,
C.BOTTOM_RIGHT,
C.BOTTOM_LEFT,
C.CENTER,
C.TOP_RIGHT,
C.CENTER_LEFT,
C.TOP_LEFT,
C.BOTTOM_CENTER,
],
tuple[float, ...],
] = BOTTOM_LEFT

#: A SymbolicConstant specifying the style of the start head. Possible values are:
#:
Expand Down Expand Up @@ -150,7 +176,7 @@ def __init__(
C.TOP_LEFT,
C.BOTTOM_CENTER,
],
float,
tuple[float, ...],
] = BOTTOM_LEFT,
endAnchor: Union[
Literal[
Expand All @@ -164,7 +190,7 @@ def __init__(
C.TOP_LEFT,
C.BOTTOM_CENTER,
],
float,
tuple[float, ...],
] = BOTTOM_LEFT,
startHeadStyle: Literal[
C.FILLED_DIAMOND,
Expand Down
34 changes: 30 additions & 4 deletions src/abaqus/Annotation/Text.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,20 @@ class Text(Annotation, _OptionsBase):
#: - TOP_RIGHT
#:
#: The default value is BOTTOM_LEFT.
anchor: Union[SymbolicConstant, float] = BOTTOM_LEFT
anchor: Union[
Literal[
C.CENTER_RIGHT,
C.TOP_CENTER,
C.BOTTOM_RIGHT,
C.BOTTOM_LEFT,
C.CENTER,
C.TOP_RIGHT,
C.CENTER_LEFT,
C.TOP_LEFT,
C.BOTTOM_CENTER,
],
tuple[float, ...],
] = BOTTOM_LEFT

#: A SymbolicConstant or a sequence of Floats specifying a point. The sequence of two
#: Floats specifies the **X** and **Y** coordinates of the reference point of the Text
Expand All @@ -84,7 +97,20 @@ class Text(Annotation, _OptionsBase):
#: - TOP_RIGHT
#:
#: The default value is BOTTOM_LEFT.
referencePoint: Union[SymbolicConstant, float] = BOTTOM_LEFT
referencePoint: Union[
Literal[
C.CENTER_RIGHT,
C.TOP_CENTER,
C.BOTTOM_RIGHT,
C.BOTTOM_LEFT,
C.CENTER,
C.TOP_RIGHT,
C.CENTER_LEFT,
C.TOP_LEFT,
C.BOTTOM_CENTER,
],
tuple[float, ...],
] = BOTTOM_LEFT

#: A Float specifying the amount of rotation in degrees about **referencePoint**. The default
#: value is 0.0.
Expand Down Expand Up @@ -132,7 +158,7 @@ def __init__(
C.TOP_LEFT,
C.BOTTOM_CENTER,
],
float,
tuple[float, ...],
] = BOTTOM_LEFT,
referencePoint: Union[
Literal[
Expand All @@ -146,7 +172,7 @@ def __init__(
C.TOP_LEFT,
C.BOTTOM_CENTER,
],
float,
tuple[float, ...],
] = BOTTOM_LEFT,
rotationAngle: float = 0.0,
color: str = "White",
Expand Down
6 changes: 3 additions & 3 deletions src/abaqus/BasicGeometry/Cell.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ class Cell:

#: A tuple of Floats specifying the **X**, **Y**, and **Z** coordinates of a point located on
#: the cell.
pointOn: float | None = None
pointOn: tuple[float, ...] = ()

#: A tuple of Floats specifying the name of the feature that created this cell.
featureName: float | None = None
featureName: tuple[float, ...] = ()

#: A tuple of Floats specifying the name of the part instance for this cell (if
#: applicable).
instanceName: float | None = None
instanceName: tuple[float, ...] = ()

@abaqus_method_doc
def getSize(self, printResults: Boolean = True):
Expand Down
6 changes: 3 additions & 3 deletions src/abaqus/BasicGeometry/Edge.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ class Edge:

#: A tuple of Floats specifying the **X**, **Y**, and **Z** coordinates of a point located on
#: the edge.
pointOn: float | None = None
pointOn: tuple[float, ...] = ()

#: A tuple of Floats specifying the name of the feature that created this edge.
featureName: float | None = None
featureName: tuple[float, ...] = ()

#: A tuple of Floats specifying the name of the part instance for this edge (if
#: applicable).
instanceName: float | None = None
instanceName: tuple[float, ...] = ()

@abaqus_method_doc
def isTangentFlipped(self) -> Boolean:
Expand Down
6 changes: 3 additions & 3 deletions src/abaqus/BasicGeometry/Face.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,14 @@ class Face:
#: specifies the **X**, **Y**, and **Z** coordinates of a point located on the face and the
#: **X**, **Y**, and **Z** components of the normal to the face.For a face of a solid **pointOn**
#: specifies the **X**, **Y**, and **Z** coordinates of a point located on the face.
pointOn: float | None = None
pointOn: tuple[tuple[float, ...], ...] = ()

#: A tuple of Floats specifying the name of the feature that created this face.
featureName: float | None = None
featureName: tuple[float, ...] = ()

#: A tuple of Floats specifying the name of the part instance for this face (if
#: applicable).
instanceName: float | None = None
instanceName: tuple[float, ...] = ()

@abaqus_method_doc
def getCentroid(self) -> Sequence[float]:
Expand Down
2 changes: 1 addition & 1 deletion src/abaqus/BasicGeometry/IgnoredEdge.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class IgnoredEdge:

#: A tuple of Floats specifying the **X**, **Y**, and **Z** coordinates of a point located on
#: the edge.
pointOn: float | None = None
pointOn: tuple[float, ...] = ()

@abaqus_method_doc
def getSize(self, printResults: bool = True):
Expand Down
2 changes: 1 addition & 1 deletion src/abaqus/BasicGeometry/IgnoredVertex.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ class IgnoredVertex:
index: int | None = None

#: A tuple of Floats specifying the **X**, **Y**, and **Z** coordinates of the vertex.
pointOn: float | None = None
pointOn: tuple[float, ...] = ()
2 changes: 1 addition & 1 deletion src/abaqus/BeamSectionProfile/ArbitraryProfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class ArbitraryProfile(Profile):
name: str

#: A sequence of sequences of Floats specifying the items described below.
table: tuple
table: tuple[tuple[float, ...], ...] = ()

@abaqus_method_doc
def __init__(self, name: str, table: tuple):
Expand Down
2 changes: 1 addition & 1 deletion src/abaqus/BoundaryCondition/SubmodelBCState.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class SubmodelBCState(BoundaryConditionState):

#: A tuple of Ints specifying the degrees of freedom to which the boundary condition is
#: applied.
dof: int | None = None
dof: tuple[int, ...] = ()

#: A SymbolicConstant specifying the propagation state of the amplitude reference. Possible
#: values are UNSET, SET, UNCHANGED, FREED, and MODIFIED.
Expand Down
2 changes: 1 addition & 1 deletion src/abaqus/BoundaryCondition/TemperatureBCState.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class TemperatureBCState(BoundaryConditionState):

#: A tuple of Ints specifying the degrees of freedom to which the boundary condition is
#: applied.
dof: int | None = None
dof: tuple[int, ...] = ()

#: A SymbolicConstant specifying the propagation state of the amplitude reference. Possible
#: values are UNSET, SET, UNCHANGED, FREED, and MODIFIED.
Expand Down
2 changes: 1 addition & 1 deletion src/abaqus/Calibration/DataSet.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class DataSet:

#: A sequence of pairs of Floats specifying data set type pairs. Possible values are for
#: stress/strain, force/displacement, or transverse strain/axial strain pairs.
data: tuple = ()
data: tuple[tuple[float, float], ...] = ()

#: A String specifying the type of the new dataset. Values can be "STRESS/STRAIN",
#: "FORCE/DISPLACEMENT", or "AXIALSTRAIN/TRANSVERSESTRAIN". The default value is
Expand Down
8 changes: 4 additions & 4 deletions src/abaqus/Canvas/ViewportBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,18 +316,18 @@ class ViewportBase(_OptionsBase):

#: A tuple of Strings specifying the names of layers that will be displayed in the viewport
#: when **displayMode** = OVERLAY.
visibleLayers: tuple = ()
visibleLayers: tuple[str, ...] = ()

#: A pair of Floats specifying the **X** and **Y** coordinates in millimeters in the canvas
#: coordinate system of the lower left corner of the current viewport, regardless of the
#: value of **windowState**.
currentOrigin: Sequence[float] = ()
currentOrigin: tuple[float, float] = (0.0, 0.0)

#: A pair of Floats specifying the **X** and **Y** coordinates in millimeters of the lower
#: left corner of the current viewport from a coordinate system having its origin in the
#: lower left corner of the drawing area. This origin refers to the viewport location when
#: **windowState** =MINIMIZED.
iconOrigin: Sequence[float] = ()
iconOrigin: tuple[float, float] = (0.0, 0.0)

#: A LightOptions object.
lightOptions: LightOptions = LightOptions()
Expand All @@ -346,7 +346,7 @@ class ViewportBase(_OptionsBase):

#: A tuple of Strings specifying keys to the session.drawings repository. The default value
#: is an empty sequence.
drawings: tuple = ()
drawings: tuple[str, ...] = ()

@abaqus_method_doc
def __init__(
Expand Down
6 changes: 3 additions & 3 deletions src/abaqus/Connector/CDCTerm.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class CDCTerm:
#: available components can be specified if the DerivedComponent object is being referenced
#: by a Potential object. This is not the case if the DerivedComponent object is referenced
#: by a ConnectorFriction object directly. The default value is an empty sequence.
intrinsicComponents: tuple
intrinsicComponents: tuple[int, ...] = ()

#: A sequence of sequences of Floats specifying components numbers and temperature and
#: field values. Each sequence of the table data specifies:The first intrinsic component
Expand All @@ -56,7 +56,7 @@ class CDCTerm:
#: number.Etc.If applicable, the temperature value.If applicable, the value of the first
#: field variable.If applicable, the value of the second field variable.Etc.The default
#: value is an empty sequence.
table: tuple
table: tuple[tuple[float, ...], ...] = ()

#: A SymbolicConstant specifying the method for combining contributing terms: square root
#: of a sum of the squares, direct sum, or Macauley sum. Possible values are RSS, SUM, and
Expand All @@ -81,7 +81,7 @@ class CDCTerm:
#: component definition. Possible values are 1 ≤ **indepComponents** ≤ 6. Only available
#: components can be specified. The **indepComponents** argument applies only if
#: **localDependency** = ON. The default value is an empty sequence.
indepComponents: tuple = ()
indepComponents: tuple[int, ...] = ()

#: A Boolean specifying whether the table data depend on temperature. The default value is
#: OFF.
Expand Down
Loading

0 comments on commit ae56ad3

Please sign in to comment.