sim_explorer.utils.paths

Functions

get_path(p1[, base])

Get the full path of p1.

relative_path(p1, p2)

Identify the path of p1 relative to the file p2.

sim_explorer.utils.paths.get_path(p1: str, base: Path | None = None) Path

Get the full path of p1.

  1. if p1 exists and no base provided or the full path is provided and exists, p1 is returned as Path object

  2. if base is provided, p1 relative to base is returned

  3. if base is not provided (None), p1 relative to the current directory (cwd) is returned.

This is useful for specification files, where absolute paths cannot be used.

sim_explorer.utils.paths.relative_path(p1: Path, p2: Path) str

Identify the path of p1 relative to the file p2.