easyidp.data.dataset._PathNamespace

class easyidp.data.dataset._PathNamespace(root, tree)

Recursively expose nested file mappings as path attributes.

String leaf values become root / value. Intermediate mappings become nested _PathNamespace objects sharing the same root.

Parameters:
  • root (Path) – Absolute base directory.

  • tree (dict) – Nested dict of relative path strings.

Examples

>>> from pathlib import Path
>>> ns = _PathNamespace(Path("/data"), {"ms": {"dom": "outputs/dom.tif"}})
>>> ns.ms.dom
PosixPath('/data/outputs/dom.tif')
__init__(root, tree)

Methods

__init__(root, tree)