Skip to content

Commit

Permalink
Update optional (#39)
Browse files Browse the repository at this point in the history
* removed optional

* test passing
  • Loading branch information
marshHawk4 authored Jun 26, 2024
1 parent 5e8c806 commit 9e3c538
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion cdr_schemas/cdr_responses/area_extractions.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class AreaExtractionResponse(BaseModel):
reference_id: Union[str, None] = Field(
default=None, description="Legend id of older version of this legend item."
)
px_bbox: Optional[List[Union[float, int]]] = Field(
px_bbox: List[Union[float, int]] = Field(
default_factory=list,
description="""The rough 2 point bounding box of the item.
Format is expected to be [x1,y1,x2,y2].""",
Expand Down
6 changes: 3 additions & 3 deletions cdr_schemas/cdr_responses/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class ProjectedFeature(BaseModel):
class PolygonExtractionResponse(BaseModel):
polygon_id: str = Field(default="", description="CDR polygon id")
cog_id: str = Field(default="", description="Cog id")
px_bbox: Optional[List[Union[float, int]]] = Field(
px_bbox: List[Union[float, int]] = Field(
default_factory=list,
description="""The rough 2 point bounding box of the item.
Format is expected to be [x1,y1,x2,y2].""",
Expand Down Expand Up @@ -57,7 +57,7 @@ class PolygonExtractionResponse(BaseModel):
class PointExtractionResponse(BaseModel):
point_id: str = Field(default="", description="CDR point id")
cog_id: str = Field(default="", description="Cog id")
px_bbox: Optional[List[Union[float, int]]] = Field(
px_bbox: List[Union[float, int]] = Field(
default_factory=list,
description="""The rough 2 point bounding box of the item.
Format is expected to be [x1,y1,x2,y2].""",
Expand Down Expand Up @@ -100,7 +100,7 @@ class PointExtractionResponse(BaseModel):
class LineExtractionResponse(BaseModel):
line_id: str = Field(default="", description="CDR line id")
cog_id: str = Field(default="", description="Cog id")
px_bbox: Optional[List[Union[float, int]]] = Field(
px_bbox: List[Union[float, int]] = Field(
default_factory=list,
description="""The rough 2 point bounding box of the item.
Format is expected to be [x1,y1,x2,y2].""",
Expand Down
2 changes: 1 addition & 1 deletion cdr_schemas/cdr_responses/legend_items.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class LegendItemResponse(BaseModel):
default="",
description="If category of type polygon this can be filled in with pattern type",
)
px_bbox: Optional[List[Union[float, int]]] = Field(
px_bbox: List[Union[float, int]] = Field(
default_factory=list,
description="""The rough 2 point bounding box of the item.
Format is expected to be [x1,y1,x2,y2].""",
Expand Down
2 changes: 1 addition & 1 deletion cdr_schemas/features/point_features.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class PointProperties(BaseModel):
)

# Point Properties
bbox: Optional[List[Union[float, int]]] = Field(
bbox: List[Union[float, int]] = Field(
default=None,
description="""The extacted 2 point bounding box of the point item.
Format is expected to be [x1,y1,x2,y2] where the top left
Expand Down
5 changes: 4 additions & 1 deletion tests/test_point_extraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ def test_point_extraction_1():
{
"id": "11",
"geometry": {"coordinates": [23.33, 122]},
"properties": {"model": "test", "model_version": "1"},
"properties": {
"model": "test",
"model_version": "1",
"bbox":[]},
}
]
},
Expand Down

0 comments on commit 9e3c538

Please sign in to comment.