semantique.processor.types.TYPE_PROMOTION_MANUALS#
- semantique.processor.types.TYPE_PROMOTION_MANUALS = {'absolute': {'__preserve_labels__': 0, 'continuous': 'continuous', 'discrete': 'discrete'}, 'add': {'__preserve_labels__': 0, 'binary': {'binary': 'discrete'}, 'continuous': {'continuous': 'continuous', 'discrete': 'continuous'}, 'discrete': {'continuous': 'continuous', 'discrete': 'discrete'}}, 'after': {'__preserve_labels__': 0, 'datetime': {'datetime': 'binary'}}, 'all': {'__preserve_labels__': 1, 'binary': 'binary'}, 'and': {'__preserve_labels__': 1, 'binary': {'binary': 'binary'}}, 'any': {'__preserve_labels__': 1, 'binary': 'binary'}, 'assign': {'__preserve_labels__': 2, 'binary': {'binary': 'binary', 'continuous': 'continuous', 'coords': 'coords', 'datetime': 'datetime', 'discrete': 'discrete', 'nominal': 'nominal', 'ordinal': 'ordinal'}, 'continuous': {'binary': 'binary', 'continuous': 'continuous', 'coords': 'coords', 'datetime': 'datetime', 'discrete': 'discrete', 'nominal': 'nominal', 'ordinal': 'ordinal'}, 'coords': {'binary': 'binary', 'continuous': 'continuous', 'coords': 'coords', 'datetime': 'datetime', 'discrete': 'discrete', 'nominal': 'nominal', 'ordinal': 'ordinal'}, 'datetime': {'binary': 'binary', 'continuous': 'continuous', 'coords': 'coords', 'datetime': 'datetime', 'discrete': 'discrete', 'nominal': 'nominal', 'ordinal': 'ordinal'}, 'discrete': {'binary': 'binary', 'continuous': 'continuous', 'coords': 'coords', 'datetime': 'datetime', 'discrete': 'discrete', 'nominal': 'nominal', 'ordinal': 'ordinal'}, 'nominal': {'binary': 'binary', 'continuous': 'continuous', 'coords': 'coords', 'datetime': 'datetime', 'discrete': 'discrete', 'nominal': 'nominal', 'ordinal': 'ordinal'}, 'ordinal': {'binary': 'binary', 'continuous': 'continuous', 'coords': 'coords', 'datetime': 'datetime', 'discrete': 'discrete', 'nominal': 'nominal', 'ordinal': 'ordinal'}}, 'assign_at': {'__preserve_labels__': 0, 'binary': {'binary': 'binary'}, 'continuous': {'continuous': 'continuous', 'discrete': 'continuous'}, 'coords': {'coords': 'coords'}, 'datetime': {'datetime': 'datetime'}, 'discrete': {'continuous': 'continuous', 'discrete': 'discrete'}, 'nominal': {'nominal': 'nominal'}, 'ordinal': {'ordinal': 'ordinal'}}, 'before': {'__preserve_labels__': 0, 'datetime': {'datetime': 'binary'}}, 'ceiling': {'__preserve_labels__': 0, 'continuous': 'discrete', 'discrete': 'discrete'}, 'cosecant': {'__preserve_labels__': 0, 'continuous': 'continuous', 'discrete': 'continuous'}, 'cosine': {'__preserve_labels__': 0, 'continuous': 'continuous', 'discrete': 'continuous'}, 'cotangent': {'__preserve_labels__': 0, 'continuous': 'continuous', 'discrete': 'continuous'}, 'count': {'__preserve_labels__': 0, 'binary': 'discrete'}, 'cube_root': {'__preserve_labels__': 0, 'continuous': 'continuous', 'discrete': 'continuous'}, 'divide': {'__preserve_labels__': 0, 'continuous': {'continuous': 'continuous', 'discrete': 'continuous'}, 'discrete': {'continuous': 'continuous', 'discrete': 'continuous'}}, 'during': {'__preserve_labels__': 0, 'datetime': {'datetime': 'binary'}}, 'equal': {'__preserve_labels__': 0, 'binary': {'binary': 'binary'}, 'continuous': {'continuous': 'binary', 'discrete': 'binary'}, 'coords': {'coords': 'binary'}, 'datetime': {'datetime': 'binary'}, 'discrete': {'continuous': 'binary', 'discrete': 'binary'}, 'nominal': {'nominal': 'binary'}, 'ordinal': {'ordinal': 'binary'}}, 'exclusive_or': {'__preserve_labels__': 1, 'binary': {'binary': 'binary'}}, 'exponential': {'__preserve_labels__': 0, 'continuous': 'continuous', 'discrete': 'continuous'}, 'first': {'__preserve_labels__': 1, 'binary': 'binary', 'continuous': 'continuous', 'datetime': 'datetime', 'discrete': 'discrete', 'nominal': 'nominal', 'ordinal': 'ordinal'}, 'floor': {'__preserve_labels__': 0, 'continuous': 'discrete', 'discrete': 'discrete'}, 'greater': {'__preserve_labels__': 0, 'binary': {'binary': 'binary'}, 'continuous': {'continuous': 'binary', 'discrete': 'binary'}, 'datetime': {'datetime': 'binary'}, 'discrete': {'continuous': 'binary', 'discrete': 'binary'}, 'ordinal': {'ordinal': 'binary'}}, 'greater_equal': {'__preserve_labels__': 0, 'binary': {'binary': 'binary'}, 'continuous': {'continuous': 'binary', 'discrete': 'binary'}, 'datetime': {'datetime': 'binary'}, 'discrete': {'continuous': 'binary', 'discrete': 'binary'}, 'ordinal': {'ordinal': 'binary'}}, 'in': {'__preserve_labels__': 0, 'binary': {'binary': 'binary'}, 'continuous': {'continuous': 'binary', 'discrete': 'binary'}, 'coords': {'coords': 'binary'}, 'datetime': {'datetime': 'binary'}, 'discrete': {'continuous': 'binary', 'discrete': 'binary'}, 'nominal': {'nominal': 'binary'}, 'ordinal': {'ordinal': 'binary'}}, 'intersects': {'__preserve_labels__': 0, 'coords': {'coords': 'binary', 'geometry': 'binary'}}, 'is_missing': {'__preserve_labels__': 0, 'binary': 'binary', 'continuous': 'binary', 'coords': 'binary', 'datetime': 'binary', 'discrete': 'binary', 'nominal': 'binary', 'ordinal': 'binary'}, 'last': {'__preserve_labels__': 1, 'binary': 'binary', 'continuous': 'continuous', 'coords': 'coords', 'datetime': 'datetime', 'discrete': 'discrete', 'nominal': 'nominal', 'ordinal': 'ordinal'}, 'less': {'__preserve_labels__': 0, 'binary': {'binary': 'binary'}, 'continuous': {'continuous': 'binary', 'discrete': 'binary'}, 'datetime': {'datetime': 'binary'}, 'discrete': {'continuous': 'binary', 'discrete': 'binary'}, 'ordinal': {'ordinal': 'binary'}}, 'less_equal': {'__preserve_labels__': 0, 'binary': {'binary': 'binary'}, 'continuous': {'continuous': 'binary', 'discrete': 'binary'}, 'datetime': {'datetime': 'binary'}, 'discrete': {'continuous': 'binary', 'discrete': 'binary'}, 'ordinal': {'ordinal': 'binary'}}, 'max': {'__preserve_labels__': 1, 'binary': 'binary', 'continuous': 'continuous', 'datetime': 'datetime', 'discrete': 'discrete', 'ordinal': 'ordinal'}, 'mean': {'__preserve_labels__': 0, 'continuous': 'continuous', 'discrete': 'continuous'}, 'median': {'__preserve_labels__': 0, 'continuous': 'continuous', 'discrete': 'continuous'}, 'min': {'__preserve_labels__': 1, 'binary': 'binary', 'continuous': 'continuous', 'datetime': 'datetime', 'discrete': 'discrete', 'ordinal': 'ordinal'}, 'mode': {'__preserve_labels__': 1, 'binary': 'binary', 'continuous': 'continuous', 'coords': 'coords', 'datetime': 'datetime', 'discrete': 'discrete', 'nominal': 'nominal', 'ordinal': 'ordinal'}, 'multiply': {'__preserve_labels__': 0, 'continuous': {'continuous': 'continuous', 'discrete': 'continuous'}, 'discrete': {'continuous': 'continuous', 'discrete': 'discrete'}}, 'n': {'__preserve_labels__': 0, 'binary': 'discrete', 'continuous': 'discrete', 'coords': 'discrete', 'datetime': 'discrete', 'discrete': 'discrete', 'nominal': 'discrete', 'ordinal': 'discrete'}, 'natural_logarithm': {'__preserve_labels__': 0, 'continuous': 'continuous', 'discrete': 'continuous'}, 'none': {'__preserve_labels__': 1, 'binary': 'binary'}, 'normalized_difference': {'__preserve_labels__': 0, 'continuous': {'continuous': 'continuous', 'discrete': 'continuous'}, 'discrete': {'continuous': 'continuous', 'discrete': 'continuous'}}, 'not': {'__preserve_labels__': 1, 'binary': 'binary'}, 'not_equal': {'__preserve_labels__': 0, 'binary': {'binary': 'binary'}, 'continuous': {'continuous': 'binary', 'discrete': 'binary'}, 'coords': {'coords': 'binary'}, 'datetime': {'datetime': 'binary'}, 'discrete': {'continuous': 'binary', 'discrete': 'binary'}, 'nominal': {'nominal': 'binary'}, 'ordinal': {'ordinal': 'binary'}}, 'not_in': {'__preserve_labels__': 0, 'binary': {'binary': 'binary'}, 'continuous': {'continuous': 'binary', 'discrete': 'binary'}, 'coords': {'coords': 'binary'}, 'datetime': {'datetime': 'binary'}, 'discrete': {'continuous': 'binary', 'discrete': 'binary'}, 'nominal': {'nominal': 'binary'}, 'ordinal': {'ordinal': 'binary'}}, 'not_missing': {'__preserve_labels__': 0, 'binary': 'binary', 'continuous': 'binary', 'coords': 'binary', 'datetime': 'binary', 'discrete': 'binary', 'nominal': 'binary', 'ordinal': 'binary'}, 'or': {'__preserve_labels__': 1, 'binary': {'binary': 'binary'}}, 'percentage': {'__preserve_labels__': 0, 'binary': 'continuous'}, 'power': {'__preserve_labels__': 0, 'continuous': {'continuous': 'continuous', 'discrete': 'continuous'}, 'discrete': {'continuous': 'continuous', 'discrete': 'discrete'}}, 'product': {'__preserve_labels__': 0, 'continuous': 'continuous', 'discrete': 'discrete'}, 'range': {'__preserve_labels__': 0, 'continuous': 'continuous', 'datetime': 'continuous', 'discrete': 'discrete'}, 'secant': {'__preserve_labels__': 0, 'continuous': 'continuous', 'discrete': 'continuous'}, 'sine': {'__preserve_labels__': 0, 'continuous': 'continuous', 'discrete': 'continuous'}, 'square_root': {'__preserve_labels__': 0, 'continuous': 'continuous', 'discrete': 'continuous'}, 'standard_deviation': {'__preserve_labels__': 0, 'continuous': 'continuous', 'discrete': 'continuous'}, 'subtract': {'__preserve_labels__': 0, 'continuous': {'continuous': 'continuous', 'discrete': 'continuous'}, 'discrete': {'continuous': 'continuous', 'discrete': 'discrete'}}, 'sum': {'__preserve_labels__': 0, 'binary': 'binary', 'continuous': 'continuous', 'discrete': 'discrete'}, 'tangent': {'__preserve_labels__': 0, 'continuous': 'continuous', 'discrete': 'continuous'}, 'to_degrees': {'__preserve_labels__': 0, 'continuous': 'continuous', 'discrete': 'continuous'}, 'to_radians': {'__preserve_labels__': 0, 'continuous': 'continuous', 'discrete': 'continuous'}, 'variance': {'__preserve_labels__': 0, 'continuous': 'continuous', 'discrete': 'continuous'}}#
Type promotion manuals for all built-in operators and reducers.
Whenever applying actions to an array, its value type might change. For example, when evaluating an expression (e.g. when evaluating an expression involving a comparison operator the resulting values are always binary) or applying a reducer (e.g. when counting the number of “true” values in a binary array the resulting values are discrete). This is called type promotion. For each built-in operator and reducer function, this dictionary stores a manual that defines which value types are accepted as input, and what the value type of the output should be.
For reducers and univariate operators, a type promotion manual is always a dictionary with as keys the supported input value types and as values the output value type. For bivariate operators, the type promotion manuals have an extra layer. The first layer of keys refers to the value type of the first operand and the second layer of keys to the value type of the second operand.
- Type: