Files
Mujoco_WASM/python/mujoco/sysid/report/sections/group.py
T
Kevin Zakka 146a5c08f7 System identification toolbox for MuJoCo.
This resulted from a lengthy collaboration with @kevinzakka, @jonathanembleyriches, @nimrod-gileadi, @gizemozd, @quagla, and @yuval.
2026-02-09 12:12:24 -05:00

44 lines
938 B
Python

from typing import Any
from mujoco.sysid.report.sections.base import ReportSection
class GroupSection(ReportSection):
"""A report section that groups multiple other sections together."""
def __init__(
self,
title: str,
sections: list[ReportSection],
anchor: str = "",
collapsible: bool = True,
):
super().__init__(collapsible=collapsible)
self._title = title
self.sections = sections
self._anchor = anchor
@property
def title(self) -> str:
return self._title
@property
def anchor(self) -> str:
return self._anchor
@property
def template_filename(self) -> str:
return "group.html"
def header_includes(self) -> set[str]:
includes = set()
for section in self.sections:
includes.update(section.header_includes())
return includes
def get_context(self) -> dict[str, Any]:
return {
"title": self.title,
"anchor": self.anchor,
}