darwin-py
darwin-py copied to clipboard
[DAR-3771][External] Import of annotation-level properties
Problem
darwin-py is currently incapable of handling:
- 1: A per-property
granularity
field in the.v7/metadata.json
properties manifest file - 2:
frame_index=null
values for annotation-level property values
Both concepts must be supported by darwin-py to allow the same import functionality as section-level properties (which are currently supported properties)
Solution
- Extend the
Property
class withgranularity
- Introduce the
PropertyGranularity
enum to represent the 3 property granularities
Adjusted the properties import functions to ensure :
- Annotation-level property values can be imported, but that
granularity
is optional so that section-level property values can still be imported - Annotation-level property values present in the properties manifest but that are missing in the team can be created in the team
- Annotation-level properties present in the properties manifest but that are missing in the team can be created in the team
We also add unit tests for _import_annotations
, as none previously existed. These test that for both section & annotation-level properties:
- Existing property values can be imported as expected
- New property values can be created from the manifest file
- New properties themselves can be created from a manifest file, and section-level properties can still be created without specifying a
granularity
Changelog
Added support for annotation-level properties