lab_executor
¶
Lab graph executor.
Takes a LiteGraph-serialised graph (from graph.serialize() in the browser) and executes it against a Polars DataFrame, returning the output series keyed by their Signal Out labels.
LiteGraph link format
links: [[link_id, from_node_id, from_slot, to_node_id, to_slot, type], ...]
LabExecutor
¶
Execute a LiteGraph filter graph against a Polars DataFrame.
Usage::
| Text Only | |
|---|---|
1 2 | |
Source code in src/mujoco_mojo/utils/layers/dojo/lab_executor.py
signal_in_columns
property
¶
Column names used by all Signal In nodes - used for validation.
frame_dependencies
property
¶
Parquet columns required by any Rotation or Translation node in this
graph: the quaternion's x/y/z/w components (Rotation only, when set),
the origin's x/y/z components (when set), and the x/y/z siblings of
the vector feeding the node's input (which must come directly from a
Signal In node - see the rotation/translation handling note in
_apply).
output_metadata
property
¶
output_metadata: dict[str, ColumnMetadata]
Metadata declared on each Signal Out node, keyed by output label.
Only the fields ColumnMetadata declares are read (taken from ColumnMetadata.model_fields), so a new field needs no change here. Empty values are ignored, and metadata that fails validation (for example an unknown unit) is skipped with a warning.
execute
¶
execute(
df: DataFrame,
template_inputs: dict[str, Series] | None = None,
) -> dict[str, Series]
Run the graph and return {output_label: series}.
Source code in src/mujoco_mojo/utils/layers/dojo/lab_executor.py
| Python | |
|---|---|
217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 | |