Class LMap
from raimad.proxy
class LMap
LMap: Layer map.
LMaps tell RAIMAD how the layers of a subcompo map
to its parent compo.
An LMap is canonically represented by an LMapShorthand,
which may be either None, a string, or a dict.
A None layermap is "transparent":
the subcompo layers are mapped directly to the parent.
If the subcompo has layers "foo" and "bar",
then the parent will have layers "foo" and "bar".
A string layermap collapses all of the subcompo
layers to one layer in the parent.
If the subcompo has layers "foo" and "bar",
and a layermap of "baz",
then the parent will have a layer "baz" containing
the geometries from both "foo" and "bar".
A dict layermap allows arbitrary layer mapping.
The keys of the dict correspond to subcompo layers,
and the values correspond to parent layers
TODO explain edgecases.
def __init__(self, shorthand: 'rai.typing.LMapShorthand') -> None:
"""
Initialize self. See help(type(self)) for accurate signature.
"""
def __getitem__(self, name: str) -> str:
"""
Given a child layer, return the parent layer.
"""
def copy(self) -> Self:
"""
Copy this lmap.
"""
def compose(self, other: Self) -> Self:
"""
Merge this lmap with another lmap.
Parameters
----------
other: Self
The other lmap
Returns
-------
Self
Self is returned to allow method chaining.
"""