seedcase-project / seedcase-sprout

Upload your research data to formally structure it for better, more reliable, and easier research.
https://sprout.seedcase-project.org/
MIT License
0 stars 0 forks source link

Create and test `edit_package_properties()` #715

Closed signekb closed 1 month ago

signekb commented 2 months ago

Signature: edit_package_properties(path: Path, properties: json/dict) -> json/dict:

Context: See diagram in the Core Python functions post.

Depends on:

martonvago commented 2 months ago

@lwjohnst86 Just wondering, if we don't verify the properties coming from the datapackage.json in read_properties, when should we check that the result of joining the current and new properties is a valid set of properties?

martonvago commented 1 month ago

So, basically, we have two checks: the required fields check and the frictionless spec check. We want both for properties derived from PackageProperties, but only the spec check for properties loaded from the datapackage.json.

So we could have two functions: verify_package_properties_well_formed doing the spec check and verify_package_properties_complete doing the required check. We can still have a verify_package_properties function calling both, as a sort of standard verify function for package properties.

Something like this @lwjohnst86 ?

Ah, this wouldn't work, sorry, ignore