TimeSeriesManager
TimeSeriesManager
Local manager for TimeSeries lifecycle and tag assignment.
The manager is intentionally not a singleton. Each instance owns an
independent tag space so future model or Model instances can keep
their own time-series collections.
Create an empty manager with tags starting at 1.
Attributes
Methods:
add
Add an existing time series and assign a tag if needed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time_series
|
TimeSeries
|
Unmanaged or already-managed |
required |
Returns:
| Type | Description |
|---|---|
TimeSeries
|
The same |
Raises:
| Type | Description |
|---|---|
TypeError
|
If |
ValueError
|
If its preassigned tag conflicts with a different object already managed here. |
get
Return the time series with tag if it exists.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tag
|
int
|
Time-series tag to look up. |
required |
Returns:
| Type | Description |
|---|---|
Optional[TimeSeries]
|
The matching |
get_all
Return a shallow copy of all managed time series keyed by tag.
remove
Remove a managed time series and compact the remaining tags.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tag
|
int
|
Tag of the time series to remove. Missing tags are ignored. |
required |
set_tag_start
Set the first tag used by this manager and retag existing objects.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
start_tag
|
int
|
Positive integer for the first assigned tag. |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
constant
Create and manage a ConstantTimeSeries.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
factor
|
float
|
Constant scale factor. |
1.0
|
Returns:
| Type | Description |
|---|---|
ConstantTimeSeries
|
Managed |
linear
Create and manage a LinearTimeSeries.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
factor
|
float
|
Linear scale factor. |
1.0
|
Returns:
| Type | Description |
|---|---|
LinearTimeSeries
|
Managed |
trig
trig(tStart: float = 0.0, tEnd: float = 1.0, period: float = 1.0, factor: float = 1.0, shift: float = 0.0) -> TrigTimeSeries
Create and manage a TrigTimeSeries.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tStart
|
float
|
Start time of the trigonometric series. |
0.0
|
tEnd
|
float
|
End time of the trigonometric series. |
1.0
|
period
|
float
|
Period of the sinusoidal cycle. |
1.0
|
factor
|
float
|
Load factor amplitude. |
1.0
|
shift
|
float
|
Phase shift. |
0.0
|
Returns:
| Type | Description |
|---|---|
TrigTimeSeries
|
Managed |
ramp
ramp(tStart: float = 0.0, tRamp: float = 1.0, smoothness: float = 0.0, offset: float = 0.0, cFactor: float = 1.0) -> RampTimeSeries
Create and manage a RampTimeSeries.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tStart
|
float
|
Start time of the ramp. |
0.0
|
tRamp
|
float
|
Duration of the ramp. |
1.0
|
smoothness
|
float
|
Smoothness value between |
0.0
|
offset
|
float
|
Vertical offset. |
0.0
|
cFactor
|
float
|
Load factor scale. |
1.0
|
Returns:
| Type | Description |
|---|---|
RampTimeSeries
|
Managed |
triangular
triangular(tStart: float = 0.0, tEnd: float = 1.0, period: float = 1.0, factor: float = 1.0, shift: float = 0.0) -> TriangularTimeSeries
Create and manage a TriangularTimeSeries.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tStart
|
float
|
Start time of the triangular wave. |
0.0
|
tEnd
|
float
|
End time of the triangular wave. |
1.0
|
period
|
float
|
Wave period. |
1.0
|
factor
|
float
|
Load factor amplitude. |
1.0
|
shift
|
float
|
Phase shift. |
0.0
|
Returns:
| Type | Description |
|---|---|
TriangularTimeSeries
|
Managed |
rectangular
rectangular(tStart: float = 0.0, tEnd: float = 1.0, period: float = 1.0, factor: float = 1.0, shift: float = 0.0) -> RectangularTimeSeries
Create and manage a RectangularTimeSeries.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tStart
|
float
|
Start time of the rectangular wave. |
0.0
|
tEnd
|
float
|
End time of the rectangular wave. |
1.0
|
period
|
float
|
Wave period. |
1.0
|
factor
|
float
|
Load factor amplitude. |
1.0
|
shift
|
float
|
Phase shift. |
0.0
|
Returns:
| Type | Description |
|---|---|
RectangularTimeSeries
|
Managed |
pulse
pulse(tStart: float = 0.0, tEnd: float = 1.0, period: float = 1.0, width: float = 0.5, factor: float = 1.0, shift: float = 0.0) -> PulseTimeSeries
Create and manage a PulseTimeSeries.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tStart
|
float
|
Start time of the pulse series. |
0.0
|
tEnd
|
float
|
End time of the pulse series. |
1.0
|
period
|
float
|
Pulse period. |
1.0
|
width
|
float
|
Pulse width as a fraction of the period. |
0.5
|
factor
|
float
|
Load factor amplitude. |
1.0
|
shift
|
float
|
Phase shift. |
0.0
|
Returns:
| Type | Description |
|---|---|
PulseTimeSeries
|
Managed |
path
path(dt: Optional[float] = None, values: Optional[Union[str, Sequence[float]]] = None, filePath: Optional[str] = None, factor: float = 1.0, useLast: bool = False, prependZero: bool = False, startTime: float = 0.0, time: Optional[Union[str, Sequence[float]]] = None, fileTime: Optional[str] = None) -> PathTimeSeries
Create and manage a PathTimeSeries.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dt
|
Optional[float]
|
Constant time step. Mutually exclusive with |
None
|
values
|
Optional[Union[str, Sequence[float]]]
|
Inline path values as a sequence or comma-separated string.
Mutually exclusive with |
None
|
filePath
|
Optional[str]
|
File containing path values. Mutually exclusive with
|
None
|
factor
|
float
|
Scale factor applied to the path values. |
1.0
|
useLast
|
bool
|
Whether OpenSees should hold the last value after the path ends. |
False
|
prependZero
|
bool
|
Whether OpenSees should prepend a zero value. |
False
|
startTime
|
float
|
Time offset for the path. |
0.0
|
time
|
Optional[Union[str, Sequence[float]]]
|
Inline time values. Mutually exclusive with |
None
|
fileTime
|
Optional[str]
|
File containing time values. Mutually exclusive with
|
None
|
Returns:
| Type | Description |
|---|---|
PathTimeSeries
|
Managed |
_next_available_tag
Return the next unused tag in this manager's local tag space.