Datatypes

Model input and outputs are described in model YAML files by several properties, including type. The type assigned to an input/output determines how yggdrasil will serialize data that is passed to/from the input/output from/to other models and how data objects are mapped between native data types in the different programming languages (see here for the mappings). Simple types (e.g. float, int) can be specified by strings, while more complex datatypes can be described directly in the YAML file using a JSON Schema (See below). When the YAML specification files are read in these datatypes are validated against the yggdrasil metaschema.

Primary Datatypes

yggdrasil supports all of the following basic data types which include the core JSON data types, as well as several additional datatypes that yggdrasil defines for convenience. Simple datatypes can be specified via strings, while collection datatypes require a schema that can be used to validate data being passed (dynamic arrays/objects are not yet supported).

Simple Datatypes

Type

========-

boolean

Description

-================================================================================-

JSON boolean type.

Required Properties

-====================

type

integer

JSON integer type.

type

null

JSON null type.

type

number

JSON number type.

type

string

JSON string type.

type

Collection Datatypes

Type

=======-

array

Description

-================================================================================-

A container of ordered values.

Required Properties

-====================

type

object

A container mapping between keys and values.

type

yggdrasil Datatypes

Type

=========-

1darray

Description

-================================================================================-

A 1D array with or without units.

Required Properties

-====================

type subtype

any

A type allowing any value that is expresible in some type.

type

bytes

A bytes value with or without units.

type

class

Type for Python classes.

type

complex

A complex value with or without units.

type

float

A float value with or without units.

type

function

Type for callable Python functions.

type

instance

Type for Python class instances.

type class

int

A int value with or without units.

type

ndarray

An ND array with or without units.

type subtype

obj

A mapping container for Obj 3D data.

type

ply

A mapping container for Ply 3D data.

type

scalar

A scalar value with or without units.

type subtype

schema

A schema type for evaluating subschema.

type

uint

A uint value with or without units.

type

unicode

A unicode value with or without units.

type

Information on adding new datatypes can be found here