Skip to content

Commit 531c44f

Browse files
committed
docs: 📝 update example in create_resource_structure()
1 parent fe6dc9e commit 531c44f

File tree

1 file changed

+22
-20
lines changed

1 file changed

+22
-20
lines changed

src/seedcase_sprout/core/create_resource_structure.py

+22-20
Original file line numberDiff line numberDiff line change
@@ -23,33 +23,35 @@ def create_resource_structure(path: Path) -> list[Path]:
2323
2424
Returns:
2525
A list of the two created directories:
26+
2627
- A path to the resource directory and
2728
- A path to the raw data directory.
2829
2930
Raises:
3031
NotADirectoryError: If path is not an existing directory.
3132
3233
Examples:
33-
```{python}
34-
import tempfile
35-
from pathlib import Path
36-
37-
import seedcase_sprout.core as sp
38-
39-
# Create a temporary directory for the example
40-
with tempfile.TemporaryDirectory() as temp_dir:
41-
temp_path = Path(temp_dir)
42-
43-
# Create a package structure first
44-
sp.create_package_properties(
45-
properties=sp.example_package_properties(),
46-
path=temp_path
47-
)
48-
49-
# TODO: Update after converting to "local-first"
50-
# Create a resource structure
51-
# sp.create_resource_structure(path=temp_path / "1" / "resources")
52-
```
34+
```{python}
35+
import tempfile
36+
from pathlib import Path
37+
38+
import seedcase_sprout.core as sp
39+
40+
# Create a temporary directory for the example
41+
with tempfile.TemporaryDirectory() as temp_dir:
42+
temp_path = Path(temp_dir)
43+
44+
# Create a package structure first
45+
sp.create_package_properties(
46+
properties=sp.example_package_properties(),
47+
path=temp_path
48+
)
49+
50+
resource_path = Path(temp_path / "resources")
51+
resource_path.mkdir()
52+
# Create a resource structure
53+
sp.create_resource_structure(path=resource_path)
54+
```
5355
"""
5456
check_is_dir(path)
5557

0 commit comments

Comments
 (0)