Source code for joltsim.assets
from __future__ import annotations
from importlib import resources
from pathlib import Path
[docs]
def get_asset_path(rel_path: str) -> Path:
"""Resolve a bundled asset path inside `joltsim/assets/`."""
base = Path(str(resources.files("joltsim").joinpath("assets")))
candidate = base / rel_path
if candidate.exists():
return candidate
raise FileNotFoundError(f"Bundled asset not found: {rel_path} (searched {base})")