Split the id string into a list of strings by `cls.sep`. Args: id: id string to be split. last: whether to split the rightmost part of the id. default is False (split all parts).
(cls, id: str | int, last: bool = False)
| 231 | |
| 232 | @classmethod |
| 233 | def split_id(cls, id: str | int, last: bool = False) -> list[str]: |
| 234 | """ |
| 235 | Split the id string into a list of strings by `cls.sep`. |
| 236 | |
| 237 | Args: |
| 238 | id: id string to be split. |
| 239 | last: whether to split the rightmost part of the id. default is False (split all parts). |
| 240 | """ |
| 241 | if not last: |
| 242 | return cls.normalize_id(id).split(cls.sep) |
| 243 | res = cls.normalize_id(id).rsplit(cls.sep, 1) |
| 244 | return ["".join(res[:-1]), res[-1]] |
| 245 | |
| 246 | @classmethod |
| 247 | def iter_subconfigs(cls, id: str, config: Any) -> Iterator[tuple[str, str, Any]]: |
no test coverage detected