Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion scripts/create-datapackage-json.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

import seedcase_sprout.core as sp

default_properties = sp.PackageProperties.default().compact_dict

properties = sp.PackageProperties(
**default_properties,
name="dung-beetle-activity",
title=(
"Dung beetle activity affects rainforest seed bank dynamics "
Expand Down Expand Up @@ -61,4 +64,7 @@

# Create the path to the package
package_path = Path(__file__).resolve().parent.parent
package_path = sp.create_package_properties(properties=properties, path=package_path)

sp.write_package_properties(
properties=properties, path=sp.PackagePath(package_path).properties()
)
21 changes: 13 additions & 8 deletions scripts/edit-datapackage-json.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@

import seedcase_sprout.core as sp

properties = sp.PackageProperties(
package_path = Path(__file__).resolve().parent.parent

current_properties = sp.read_properties(
path=sp.PackagePath(package_path).properties(),
)

updated_properties = sp.PackageProperties(
description=(
"Dung beetles relocate vertebrate feces under the soil surface, "
"and this behavior has many ecological consequences. In tropical forests, "
Expand All @@ -11,13 +17,12 @@
),
)

package_path = Path(__file__).resolve().parent.parent / "datapackage.json"

updated_package_properties = sp.edit_package_properties(
path=package_path,
properties=properties,
updated_package_properties = sp.update_package_properties(
current_properties=current_properties,
update_properties=updated_properties,
)

package_path = sp.write_package_properties(
properties=updated_package_properties, path=package_path
sp.write_package_properties(
properties=updated_package_properties,
path=sp.PackagePath(package_path).properties(),
)