Skip to main content
Base class for all GRID Robot API types. A GRID type is a pydantic dataclass declared with @grid_dataclass. Its constructor validates strictly: a value of the wrong type, an unknown field or a missing field raises pydantic.ValidationError, which is a ValueError. from_dict() reads JSON-shaped data and converts compatible values, for example "1.5" to 1.5; unknown fields are still rejected. to_dict() and from_dict() cover records whose fields are numbers, strings and other GRID types. A type that carries an array keeps its own pair, so its JSON form stays what callers read today.

Methods

from_dict()

Signature
Deserialize from a dictionary of JSON-compatible values.
dict
required
Dictionary containing serialized object data
Returns: GRIDType: Reconstructed object

to_dict()

Signature
Serialize to a JSON-compatible dictionary. Returns: dict: Dictionary representation of the object