MCPcopy Create free account
hub / github.com/NatLabRockies/EnergyPlus / relative_path_from_root

Function relative_path_from_root

scripts/dev/base_hook.py:376–382  ·  view source on GitHub ↗

Get the path relative to the root directory.

(path: Path, root=ROOT_DIR)

Source from the content-addressed store, hash-verified

374
375
376def relative_path_from_root(path: Path, root=ROOT_DIR) -> Path:
377 """Get the path relative to the root directory."""
378 if not path.is_absolute():
379 path = path.resolve()
380 if not path.is_relative_to(root):
381 raise ValueError(f"Path '{path}' is not under the root directory '{root}'")
382 return path.relative_to(root)
383
384
385def _walk_with_exclusion(

Callers 4

license-check.pyFile · 0.90
filesMethod · 0.90
summaryMethod · 0.90
__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected