pSeven Data Types

This reference provides summary information on the data types introduced in pSeven, their string representations (usable in data editors), value ranges, equivalent Python types and supported conversions between pSeven types.

Typenames

In total, there are 17 typenames in pSeven. The type naming rules are described on the Typesystem page.

Scalar Types

Boolean scalar

Boolean value, True or False.

Typename:

BoolScalar

String form:

Boolean literal — True, False

Value range:

N/A

Conversions:

Integer scalar

Single integer value.

Typename:

IntScalar

String form:

numeric literal, signed decimal integer — 42, -20

Value range:

32-bit integer range

Conversions:

Real scalar

Single floating point value.

Typename:

RealScalar

String form:

numeric literal, signed decimal float in fixed-point notation — 42., -48.5

Value range:

double-precision floating point range

Conversions:

String scalar

Unicode character string.

Typename:

StringScalar

String form:

string literal in double quotes — "string"

Value range:

N/A

Conversions:

Vector Types

Boolean vector

Flat array of Boolean values.

Typename:

BoolVector

String form:

comma-delimited list of Boolean values enclosed in parentheses — (true, false, true)

Value range:

N/A

Conversions:
  • from pSeven types: BoolScalar; BoolMatrix containing a single row or column; flat List containing only BoolScalar values
  • to pSeven types: any scalar type if the vector contains a single element; any vector or matrix type; List
  • equivalent Python type: numpy.ndarray (1D, dtype=bool)

Integer vector

Flat array of integer values.

Typename:

IntVector

String form:

comma-delimited list of integers enclosed in parentheses — (1, -2, 3)

Value range:

32-bit integer range

Conversions:

Real vector

Flat array of floating point values.

Typename:

RealVector

String form:

comma-delimited list of floating point values enclosed in parentheses — (0.5, -1.2)

Value range:

double-precision floating point range (for each component)

Conversions:

String vector

Flat array of character strings.

Typename:

StringVector

String form:

comma-delimited list of strings in double quotes, enclosed in parentheses — ("foo", "bar")

Value range:

N/A

Conversions:

Matrix Types

Boolean matrix

2D array of Boolean values.

Typename:

BoolMatrix

String form:

list of equally long lists of Boolean values, all lists are comma-delimited and enclosed in parentheses — ((true, false), (false, true))

Value range:

N/A

Conversions:
  • from pSeven types: BoolScalar; BoolVector; List containing BoolVector values of the same dimension, List containing equally long lists of BoolScalar values
  • to pSeven types: any scalar type if the matrix contains a single element; any vector type if the matrix contains a single row or column; any matrix type; List
  • equivalent Python type: numpy.ndarray (2D, dtype=bool)

Integer matrix

2D array of integer values.

Typename:

IntMatrix

String form:

list of equally long lists of integers, all lists are comma-delimited and enclosed in parentheses — ((11, 12), (21, 22))

Value range:

32-bit integer range

Conversions:

Real matrix

2D array of floating point values.

Typename:

RealMatrix

String form:

list of equally long lists of floating point values, all lists are comma-delimited and enclosed in parentheses — ((1.1, 1.2), (2.1, 2.2))

Value range:

double-precision floating point range

Conversions:

String matrix

2D array of character strings.

Typename:

StringMatrix

String form:

list of equally long lists of strings, all lists are comma-delimited and enclosed in parentheses — (("a", "b"), ("c", "d"))

Value range:

N/A

Conversions:

Containers

List

Heterogeneous list.

Typename:

List

String form:

comma-delimited list of arbitrary elements (in their own string representations), enclosed in square brackets — [0.5, true, ("foo", "bar"), ((11, 12), (21, 22))]

Value range:

N/A

Conversions:
  • from pSeven types: trivial conversion from scalar type, Dict, Blob, and File (results in a single-element List containing the original value); intelligent conversion from vector and matrix types (results in a List which can be converted back to the original type)
  • to pSeven types: any scalar type if the list contains a single element of that type; any vector type if the list contains only appropriate scalar values (that is, the list is homogeneous and does not contain arrays or nested lists, so it can be interpreted as a vector); corresponding matrix type if the list can be converted to a vector according to the above rule (that is, a vector-like list can be interpreted as a single-row matrix); any matrix type if the list contains only appropriate vector values of the same dimension or only equally long lists that can be converted to the same vector type (that is, the list can be interpreted as a rectangular matrix); Blob if all elements are IntScalar values in range from 0 to 255 (bytecodes)
  • equivalent Python type: list

Dict

Associative array of key-value pairs. Keys can be strings only. Values can be of scalar, vector, matrix, List, or Dict type.

Typename:

Dict

String form:

comma-delimited list of key-value pairs, enclosed in curly brackets; keys are strings in double quotes, values use their own string representations; a key is separated from its value by a colon — {"key_list": ["a", [1, 2, 3], false], "key_int": 42, "key_realmatrix": ((1.1, 1.2), (2.1, 2.2))}

Value range:

N/A

Conversions:
  • from pSeven types: none
  • to pSeven types: List
  • equivalent Python type: dict with the limitation that keys have to be of unicode or str type, and values must allow conversion to scalar, vector, matrix, List, or Dict types

Special Types

Binary data

Arbitrary binary data.

Typename:

Blob

String form:

comma-delimited list of decimal bytecodes, enclosed in square brackets — [102, 111, 111]

Value range:

N/A

Conversions:
  • from pSeven types: none
  • to pSeven types: List
  • equivalent Python type: bytearray

File

File-like object.

Typename:

File

String form:

special string of the form origin_prefix:file_path, where origin_prefix can be temporary, sandbox, or project (see File Origin), and file_path is an absolute or relative path — project:ProjectSubdirectory\myfile.dat, temporary:C:\Temp\p7tempfile

Value range:

N/A

Conversions:
  • from pSeven types: none
  • to pSeven types: List
  • equivalent Python type: none (can not be directly converted to or from a Python file-like object); when accessed from a script in a scripting block, a variable of this type is an object that mimics a Python’s file-like and provides similar common methods

Undefined

Denotes a lack of value, such as an unassigned variable. It rather is a special value valid for any type, than an actual data type; thus it is not possible to create a variable or port of Undefined type. Also, all Python types that can not be properly converted to a pSeven type become Undefined.

Typename:

Undefined

String form:

empty string

Value range:

N/A

Conversions:
  • from pSeven types: N/A
  • to pSeven types: N/A
  • equivalent Python type: None