Create a dictionary mapping of paths to the data contained in those nodes. Parameters ---------- relative : bool If True, return relative instead of absolute paths. Returns ------- dict[str, Dataset] See Also ---
(self, relative: bool = False)
| 1451 | return obj |
| 1452 | |
| 1453 | def to_dict(self, relative: bool = False) -> dict[str, Dataset]: |
| 1454 | """ |
| 1455 | Create a dictionary mapping of paths to the data contained in those nodes. |
| 1456 | |
| 1457 | Parameters |
| 1458 | ---------- |
| 1459 | relative : bool |
| 1460 | If True, return relative instead of absolute paths. |
| 1461 | |
| 1462 | Returns |
| 1463 | ------- |
| 1464 | dict[str, Dataset] |
| 1465 | |
| 1466 | See Also |
| 1467 | -------- |
| 1468 | DataTree.subtree_with_keys |
| 1469 | """ |
| 1470 | return { |
| 1471 | node.relative_to(self) if relative else node.path: node.to_dataset() |
| 1472 | for node in self.subtree |
| 1473 | } |
| 1474 | |
| 1475 | @property |
| 1476 | def nbytes(self) -> int: |
nothing calls this directly
no test coverage detected