Skip to content

Commit e98851d

Browse files
committed
docs: 📝 update guides with new obj and script name
`properties.py` -> `package_properties.py`; `properties` -> `package_properties` within code blocks.
1 parent 7287c2a commit e98851d

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

docs/guide/packages.qmd

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ uv run main.py
6969
sp.create_properties_script(package_path.root())
7070
```
7171

72-
This will create a `properties.py` file in the newly created `scripts/`
72+
This will create a `package_properties.py` file in the newly created `scripts/`
7373
folder of your data package.
7474

7575
::: callout-caution
@@ -97,7 +97,7 @@ The file structure should now look like:
9797
print(file_tree(package_path.root()))
9898
```
9999

100-
Inside the `scripts/properties.py` file, you will find a template for
100+
Inside the `scripts/package_properties.py` file, you will find a template for
101101
creating the properties of your data package. It looks like:
102102

103103
```{python}
@@ -126,7 +126,7 @@ is an example of a set of properties with required fields filled in
126126

127127
```{python}
128128
#| eval: false
129-
properties = sp.PackageProperties(
129+
package_properties = sp.PackageProperties(
130130
name="diabetes-study",
131131
title="A Study on Diabetes",
132132
# You can write Markdown below, with the helper `sp.dedent()`.
@@ -175,13 +175,13 @@ So in your `main.py`, include this code:
175175
#| eval: false
176176
#| filename: "main.py"
177177
import seedcase_sprout as sp
178-
from scripts.properties import properties
178+
from scripts.package_properties import package_properties
179179
180180
def main():
181181
# Create the properties script in default location.
182182
sp.create_properties_script()
183183
# Write properties from properties script to `datapackage.json`.
184-
sp.write_properties(properties=properties)
184+
sp.write_properties(properties=package_properties)
185185
186186
if __name__ == "__main__":
187187
main()
@@ -207,7 +207,7 @@ The `write_properties()` function will give an error if the
207207
`PackageProperties` object is missing some of its required fields or if
208208
they are not filled in correctly. In that case, a `datapackage.json`
209209
file won't be created. So you will have to return to the
210-
`scripts/properties.py` file and fill in the correct properties.
210+
`scripts/package_properties.py` file and fill in the correct properties.
211211
:::
212212

213213
The `write_properties()` function created the `datapackage.json` file in
@@ -233,15 +233,15 @@ data package you just created by writing it in the `main.py` file.
233233
#| eval: false
234234
#| filename: "main.py"
235235
import seedcase_sprout as sp
236-
from scripts.properties import properties
236+
from scripts.package_properties import package_properties
237237
238238
def main():
239239
# Create the properties script in default location.
240240
sp.create_properties_script()
241241
# Save the properties to `datapackage.json`.
242-
sp.write_properties(properties=properties)
242+
sp.write_properties(properties=package_properties)
243243
# Create text for a README of the data package.
244-
readme_text = sp.as_readme_text(properties)
244+
readme_text = sp.as_readme_text(package_properties)
245245
# Write the README text to a `README.md` file.
246246
sp.write_file(readme_text, sp.PackagePath().readme())
247247

docs/guide/resources.qmd

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ the creation of our resource properties script:
161161
#| filename: "main.py"
162162
#| eval: false
163163
import seedcase_sprout as sp
164-
from scripts.properties import properties
164+
from scripts.package_properties import package_properties
165165
import polars as pl
166166
167167
def main():
@@ -184,9 +184,9 @@ def main():
184184
# New code ends here -----
185185
186186
# Save the properties to `datapackage.json`.
187-
sp.write_properties(properties=properties)
187+
sp.write_properties(properties=package_properties)
188188
# Create text for a README of the data package.
189-
readme_text = sp.as_readme_text(properties)
189+
readme_text = sp.as_readme_text(package_properties)
190190
# Write the README text to a `README.md` file.
191191
sp.write_file(readme_text, sp.PackagePath().readme())
192192
@@ -353,11 +353,11 @@ package. You can do this by adding the following lines to the
353353

354354
```{python}
355355
#| eval: false
356-
#| filename: "properties.py"
356+
#| filename: "package_properties.py"
357357
# Import the resource properties object.
358358
from .resource_properties_patients import resource_properties_patients
359359
360-
properties = sp.PackageProperties(
360+
package_properties = sp.PackageProperties(
361361
# Your existing properties here...
362362
resources=[
363363
resource_properties_patients,
@@ -372,8 +372,8 @@ resource.
372372

373373
The next step is to write the resource properties to the
374374
`datapackage.json` file. Since we included the `resource_properties`
375-
object directly into the `scripts/properties.py` file, and since the
376-
`scripts/properties.py` file is imported already in `main.py`, we can
375+
object directly into the `scripts/package_properties.py` file, and since the
376+
`scripts/package_properties.py` file is imported already in `main.py`, we can
377377
simply re-run the `main.py` file and it will update both the
378378
`datapackage.json` file and the `README.md` file.
379379

0 commit comments

Comments
 (0)