Enumerations

The Python execution context employs some enumerations describing field and variable metadata.

Enumerations used

DataType

This enumeration is used for Megaladata data types. Its elements are:

Name Value Represented data type
None 0 Data type not set
Boolean 1 Boolean
DateTime 2 Date/Time
Float 3 Float
Integer 4 Integer
String 5 String
Variant 6 Variant

DataKind

This represents the discrete/continuous nature of data. Enumeration elements are:

Name Value Represented kind of data
Undefined 0 Data kind not set
Continuous 1 Continuous
Discrete 2 Discrete

UsageType

This enumeration lists dataset field usage types. Its elements are:

Name Value Represented usage type
Unspecified 0  Unspecified
Excluded 1  Excluded
Useless 2  Useless
Active (also: Used, Input) 3  Active
Predicted (also: Output) 4  Predicted
Key 5  Кey
Group 6  Group
Value 7  Value
Transaction 8  Тransaction
Item 9  Item

Examples of using enumerations

from builtin_data import OutputTable, DataType, UsageType

col0 = OutputTable.Columns[0]
#Checking the value of a property with an enumeration type
if (col0.DataType == DataType.String):
    print("Column {} has a string data type".format(col0.Name))

#Outputting numeric representation of enumeration value
print(col0.DefaultUsageType)
#Outputting string representation of enumeration value
print(UsageType(col0.DefaultUsageType).name)

Read on: Output Console

results matching ""

    No results matching ""