Skip to content

Commit

Permalink
add reference ids
Browse files Browse the repository at this point in the history
  • Loading branch information
marshHawk4 committed May 31, 2024
1 parent f49d594 commit ecae5d7
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 6 deletions.
10 changes: 9 additions & 1 deletion cdr_schemas/area_extraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,21 @@ class Area_Extraction(BaseModel):
The text within the extraction area.
""",
)
reference_id: str = Field(
default="",
description="""
If item is created from an already existing item reference_id is the original item id.
Helps track provenance.
""",
)

# Model Provenance
model: str = Field(description="Name of the model used to generate this data")
model_version: str = Field(
description="Version of the model used to generate this data"
)
model_config = ConfigDict(protected_namespaces=())
confidence: Optional[Union[float, int]] = Field(
default=None, description="The prediction confidence of the model"
)

model_config = ConfigDict(protected_namespaces=())
18 changes: 15 additions & 3 deletions cdr_schemas/features/line_features.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,22 @@ class LineProperty(BaseModel):
model_version: str = Field(
description="Version of the model used to generate this data"
)
model_config = ConfigDict(protected_namespaces=())
confidence: Optional[Union[float, int]] = Field(
default=None, description="The prediction confidence of the model"
)

# Line Properties
dash_pattern: Optional[DashType] = Field(
default=None, description="values = {solid, dash, dotted}"
)
symbol: str = Field(default="", description="TODO : Add description")

reference_id: str = Field(
default="",
description="""
If item is created from an already existing item reference_id is the original item id.
Helps track provenance.
""",
)
model_config = ConfigDict(protected_namespaces=())

class LineFeature(BaseModel):
"""
Expand Down Expand Up @@ -111,6 +116,13 @@ class LineLegendAndFeaturesResult(BaseModel):
label. Format is expected to be [x,y] coordinate pairs
where the top left is the origin (0,0).""",
)
reference_id: str = Field(
default="",
description="""
If item is created from an already existing item reference_id is the original item id.
Helps track provenance.
""",
)

# Segmentation Fields
crs: str = Field(
Expand Down
18 changes: 16 additions & 2 deletions cdr_schemas/features/point_features.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class PointProperties(BaseModel):
model_version: str = Field(
description="Version of the model used to generate this data"
)
model_config = ConfigDict(protected_namespaces=())

confidence: Optional[Union[float, int]] = Field(
default=None, description="The prediction confidence of the model"
)
Expand All @@ -50,7 +50,14 @@ class PointProperties(BaseModel):
dip_direction: Optional[int] = Field( # TODO add description
default=None, description="TODO : Add description"
)

reference_id: str = Field(
default="",
description="""
If item is created from an already existing item reference_id is the original item id.
Helps track provenance.
""",
)
model_config = ConfigDict(protected_namespaces=())

class PointFeature(BaseModel):
"""
Expand Down Expand Up @@ -111,6 +118,13 @@ class PointLegendAndFeaturesResult(BaseModel):
label. Format is expected to be [x,y] coordinate pairs
where the top left is the origin (0,0).""",
)
reference_id: str = Field(
default="",
description="""
If item is created from an already existing item reference_id is the original item id.
Helps track provenance.
""",
)

# Segmentation Fields
crs: str = Field(
Expand Down
14 changes: 14 additions & 0 deletions cdr_schemas/features/polygon_features.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ class PolygonProperty(BaseModel):

model: str = Field(description="Name of the model used for extraction")
model_version: str = Field(description="Version of the model used for extraction")
reference_id: str = Field(
default="",
description="""
If item is created from an already existing item reference_id is the original item id.
Helps track provenance.
""",
)
confidence: Optional[Union[float, int]] = Field(
default=None, description="The prediction confidence of the model"
)
Expand Down Expand Up @@ -117,6 +124,13 @@ class PolygonLegendAndFeaturesResult(BaseModel):
map_unit: Optional[MapUnit] = Field(
default=None, description="Human annotated information on the map unit"
)
reference_id: str = Field(
default="",
description="""
If item is created from an already existing item reference_id is the original item id.
Helps track provenance.
""",
)

# Segmentation Fields
crs: str = Field(
Expand Down

0 comments on commit ecae5d7

Please sign in to comment.