Skip to content

Commit c2ab628

Browse files
committed
Fix fallback path lookup
1 parent fc095fe commit c2ab628

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

uxarray/tutorial/__init__.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,13 @@ def _get_dataset_entry(name: str) -> TutorialDataset:
126126

127127

128128
def _meshfiles_path() -> Path:
129-
"""Support both local development from a cloned
129+
"""Locate the local ``test/meshfiles`` directory for tutorial datasets.
130+
This supports both local development from a cloned
130131
repo and cwd fallback supports docs builds that run from the root repo"""
131-
candidates = (
132-
Path(__file__).resolve().parents[2] / "test" / "meshfiles",
133-
Path.cwd() / "test" / "meshfiles",
134-
)
132+
candidates = [Path(__file__).resolve().parents[2] / "test" / "meshfiles"]
133+
134+
cwd = Path.cwd().resolve()
135+
candidates.extend(parent / "test" / "meshfiles" for parent in (cwd, *cwd.parents))
135136

136137
for path in candidates:
137138
if path.exists():

0 commit comments

Comments
 (0)