data

This package provides a base data class for all COMPAS data objects such as geometry objects, robots, and data structures, and the infrastructure for data validation, conversion, coercion, and JSON serialisation.

Classes

Data

Abstract base class for all COMPAS data objects.

DataEncoder

Data encoder for custom JSON serialization with support for COMPAS data structures and geometric primitives.

DataDecoder

Data decoder for custom JSON serialization with support for COMPAS data structures and geometric primitives.

Functions

json_load

Read COMPAS object data from a JSON file.

json_loads

Read COMPAS object data from a JSON string.

json_dump

Write a collection of COMPAS object data to a JSON file.

json_dumps

Write a collection of COMPAS objects to a JSON string.

Validators

is_sequence_of_int

Verify that the sequence contains only integers.

is_sequence_of_uint

Verify that the sequence contains only unsigned integers.

is_sequence_of_float

Verify that the sequence contains only floats.

is_int3

Verify that the sequence contains 3 integers.

is_float3

Verify that the sequence contains 3 floats.

is_float4x4

Verify that the sequence contains 4 sequences of each 4 floats.

validate_data

Validate data against the data and json schemas of an object class.

Exceptions

DecoderError

Exception that is raised when the decoder fails at reconstructing an object that has been identified as a COMPAS data object.