PyANGKernel.GKTSDescription¶
- class GKTSDescription¶
GKTSDescriptionholds the description of a time series, that is: the time interval during which a time series is valid and the time interval that separates each value in the series. It also holds, optionally, the deviation or a band for each of its values.Details
Each time series (
GKTimeSerie) has an associated description. Two (or more) time series can share the same description if their data is compatible (same time intervals and duration, same data type).Synopsis¶
Methods¶
def
__init__()def
addInterval()def
containsTime()def
expand()def
expandMaxMin()def
getNrIntervals()def
getUniqueName()def
resetMinMax()def
setConversion()def
setFromTime()def
setMinMax()def
setNullValue()def
setTime()def
setToTime()def
setToTimeKnow()def
setTypeName()
Virtual methods¶
def
getConversion()def
getDuration()def
getFromTime()def
getInterval()def
getIntervals()def
getMaximum()def
getMinimum()def
getNullValue()def
getToTime()def
getTypeName()def
hasNullValue()def
isNull()def
toContext()
Static functions¶
def
equals()def
findUnionDates()def
invalidValue()def
isValid()
Note
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
- __init__(col, uniqueName, aIncludeDeviationValues, aIncludeBandsValues[, aExpandibleTS=false])¶
- Parameters:
col –
GKColumnuniqueName – str
aIncludeDeviationValues – bool
aIncludeBandsValues – bool
aExpandibleTS – bool
- addInterval(interval)¶
- Parameters:
interval – int
Adds a new interval to a time series that uses this description. If this new interval extends the duration of the TS, we will update the to time accordingly.
Returns true if time is in the interval [from,to]
- containsTime(timeMS)
- Parameters:
timeMS – int
- Return type:
Returns true if time (in MS since epoch) is the interval [from,to]
Compares a and b. NaN and +Inf/-Inf values supported Uses qFuzzyCompare beware of its shortcomings
Resets the initial time if ‘newTime’ is earlier, or the ending time, if ‘newTime’ is later than it, expanding the duration of the time series.
- expandMaxMin(value)¶
- Parameters:
value – float
Recalculates the maximum and minimum values taking into account the ‘value’ (that has been added to a time series).
- static findCommonDates(t1, t2, from, to)¶
- Parameters:
t1 –
GKTSDescriptiont2 –
GKTSDescriptionfrom –
QDateTimeto –
QDateTime
Find common dates (from, to) in two Timeseries.
- static findCommonDatesWithCommonInterval(t1, t2, from, to)¶
- Parameters:
t1 –
GKTSDescriptiont2 –
GKTSDescriptionfrom –
QDateTimeto –
QDateTime
Find common dates (from, to) in two Timeseries that have a common interval.
- static findCommonTimes(t1, t2, from, to)¶
- Parameters:
t1 –
GKTSDescriptiont2 –
GKTSDescriptionfrom –
QTimeto –
QTime
Find common times (from, to) in two Timeseries. The date in the date and time information is not used.
- static findCommonTimesWithCommonInterval(t1, t2, from, to)¶
- Parameters:
t1 –
GKTSDescriptiont2 –
GKTSDescriptionfrom –
QTimeto –
QTime
Find common times (from, to) in two Timeseries that have a common interval. The date in the date and time information is not used.
- static findUnionDates(descriptions, from, to, interval)¶
- Parameters:
descriptions – .list of const GKTSDescription
from –
QDateTimeto –
QDateTimeinterval –
GKTimeDuration
Find the from/to/interval parameters that fit the union of the specified descriptions.
- getAggregationType()¶
- Return type:
When aggregating data, gives what is relevant: the mean or the sum.
- getConversion()¶
- Return type:
Units of this TS.
- static getCreateDescription(col, uniqueName[, aIncludeDeviation=false[, aIncludeBands=false]])¶
- Parameters:
col –
GKColumnuniqueName – str
aIncludeDeviation – bool
aIncludeBands – bool
- Return type:
Find (and create a new one if none is found) a TS description by uniqueName.
- static getCreateDescription(cols, uniqueName[, aIncludeDeviation=false[, aIncludeBands=false]])
- Parameters:
cols – .list of GKColumn
uniqueName – str
aIncludeDeviation – bool
aIncludeBands – bool
- Return type:
- static getCreateDescription(col, uniqueName, scenario, aggType[, aIncludeDeviation=false[, aIncludeBands=false]])
- Parameters:
col –
GKColumnuniqueName – str
scenario –
GKScenarioaggType –
AggregationTypeaIncludeDeviation – bool
aIncludeBands – bool
- Return type:
Find (and create a new one if none is found) a TS description by uniqueName. The scenario will be used to assign the
GKTSDescriptiontimes ( from, to and interval )- static getCreateDescription(col, uniqueName, aFrom, aTo, anInterval, aggType[, aIncludeDeviation=false[, aIncludeBands=false]])
- Parameters:
col –
GKColumnuniqueName – str
aFrom –
QDateTimeaTo –
QDateTimeanInterval –
GKTimeDurationaggType –
AggregationTypeaIncludeDeviation – bool
aIncludeBands – bool
- Return type:
Find (and create a new one if none is found) a TS description by uniqueName.
- static getCreateDescription(cols, uniqueName, aFrom, aTo, anInterval, aggType[, aIncludeDeviation=false[, aIncludeBands=false]])
- Parameters:
cols – .list of GKColumn
uniqueName – str
aFrom –
QDateTimeaTo –
QDateTimeanInterval –
GKTimeDurationaggType –
AggregationTypeaIncludeDeviation – bool
aIncludeBands – bool
- Return type:
- getDuration(ts)¶
- Parameters:
ts –
GKTimeSerie- Return type:
Calculates the duration of a TS based on its from and to data or the interval.
Return the interval (the position in the time series array of value) in where time is truncated to the nearest integer.
UnknownCommandtime : time for the interval that is being looked for UnknownCommand exact : if true, only times matching exact value timeshots are considered (thus it returns -1 for intermediate values)
If time is not in any valid interval, -1 is returned.
Returns the interval (the position in the time series array of value) in where time is truncated to the nearest integer. QDate info is not used in the from and to times, only the QTime part.
UnknownCommandtime : time for the interval that is being looked for UnknownCommand exact : if true, only times matching exact value timeshots are considered (thus it returns -1 for intermediate values)
If time is not in any valid interval, -1 is returned.
- getInterval(timeMS[, exact=false])
- Parameters:
timeMS – int
exact – bool
- Return type:
Return the interval (the position in the time series array of value) in where timeMS is truncated to the nearest integer.
UnknownCommandtimeMS : time in MS since epoch for the interval that is being looked for UnknownCommand exact : if true, only times matching exact value timeshots are considered (thus it returns -1 for intermediate values)
If time is not in any valid interval, -1 is returned.
- getIntervalTime()¶
- Return type:
- getIntervals(iStart, iEnd)¶
Get first and last interval for specified time interval.
Returns the maximum value of all the TS that uses this description.
Returns the minimum value of all the TS that uses this description.
Get the number of intervals
Returns the NULL value for this TS description. The user must first test if a NULL has been defined using
hasNullValue.Returns the time for a given interval position (based on from time and interval time).
Returns true if a NULL value for this TS description has been set.
Returns the invalid value for this TS description. Case of no value importing value from the RDS when count is >0 for the specific dateTime.
Returns true if “value” is used as a NULL (as defined with
setNullValue).Returns true if “value” is used as a NULL (as defined with
setNullValue).- resetMinMax()¶
Resets the maximum and minimum values.
- setAggregationType(type)¶
- Parameters:
type –
AggregationType
When aggregating data, sets what is relevant: the mean or the sum.
- setConversion(type)¶
- Parameters:
type –
Conversion
Units of this TS.
Sets the initial time.
- setIntervalTime(anInterval)¶
- Parameters:
anInterval –
GKTimeDuration
Sets the interval time.
- setMinMax(min, max)¶
- Parameters:
min – float
max – float
Sets the maximum and minimum values of the time series.
- setNullValue(null)¶
- Parameters:
null – float
Sets the value to be used as NULL (no value).
See also
- setTime(aFrom, aTo, anInterval)¶
- Parameters:
aFrom –
QDateTimeaTo –
QDateTimeanInterval –
GKTimeDuration
Sets the initial time (aFrom), ending time (aTo) and time interval.
Sets the ending time.
- setToTimeKnow(value)¶
- Parameters:
value – bool
If true, the end time will be used (even if no data is found) when computing the duration (in
getDuration). If false, the duration will be computed using the the interval time and the data in the TS.Set it to true (the default) when the end time is well known, to false when the TS is dynamic and the end time is not known.
- setTypeName(value)¶
- Parameters:
value – str
Returns the time information of this description as a
GKContext.