darwin-py icon indicating copy to clipboard operation
darwin-py copied to clipboard

[DAR-3771][External] Import of annotation-level properties

Open JBWilkie opened this issue 5 months ago • 1 comments

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 with granularity
  • Introduce the PropertyGranularity enum to represent the 3 property granularities

Adjusted the properties import functions to ensure :

  1. Annotation-level property values can be imported, but that granularity is optional so that section-level property values can still be imported
  2. Annotation-level property values present in the properties manifest but that are missing in the team can be created in the team
  3. 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

JBWilkie avatar Sep 12 '24 15:09 JBWilkie