seli

Contents

seli#

Core functionality for working with Modules, modifying, serializing and deserializing them.

Functions#

typecheck(obj)

Type check a function call based on its type hints.

registry_add(name, value[, overwrite])

Add a something to the registry.

registry_str(obj)

Get the registry string for an object.

registry_obj(name)

Get the object for a registry string.

is_registry_str(obj)

Check if an object is a registry string.

to_tree(obj)

Convert shared/cyclic references into a PathKeys, the result is a tree.

to_tree_inverse(obj)

Reconstructs the original object structure from a tree produced by to_tree.

flat_path_dict(obj)

Convert a nested object structure into a flat dictionary representation.

dfs_map(obj[, fun, refs, path, refs_fun])

Performs a depth-first traversal of a nested data structure, applying a transformation function to each element.

save(path, obj)

Save a nested structure of modules and arrays and other containers to a file.

load(path)

Load a nested structure of modules and arrays and other containers from a file.

to_arrays_and_json(obj)

Serialize a nested structure of modules and arrays and other containers to a JSON string and a list of arrays.

from_arrays_and_json(arrays, obj_json)

Deserialize a nested structure of modules and arrays and other containers from a JSON string and a list of arrays.

jit(function)

Just-in-time compiling functions.

Classes#

Module()

Base class for all modules.

ItemKey(key)

Key for accessing items using the [] operator.

AttrKey(key)

Key for accessing object attributes using the dot operator.

PathKey(path)

Sequence of keys that enables access to nested data structures.

ArrayPlaceholder(index)

Placeholder for an array that will be serialized and deserialized later.

cached_property(func)

A property that caches the result of a function.