Skip to content

Commit

Permalink
remove comments from test
Browse files Browse the repository at this point in the history
  • Loading branch information
czaloom committed Aug 14, 2024
1 parent f784ec3 commit 8341e2b
Showing 1 changed file with 21 additions and 22 deletions.
43 changes: 21 additions & 22 deletions api/tests/functional-tests/crud/test_create_delete.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import numpy as np
import pytest
from geoalchemy2.functions import ST_AsText, ST_Count
from geoalchemy2.functions import ST_AsText, ST_Count, ST_Polygon
from PIL import Image
from sqlalchemy import func, select
from sqlalchemy.orm import Session
Expand Down Expand Up @@ -982,8 +982,7 @@ def test_gt_seg_as_mask_or_polys(
dataset_name: str,
):
"""Check that a ground truth segmentation can be created as a polygon or mask"""
# xmin, xmax, ymin, ymax = 11, 45, 37, 102
xmin, xmax, ymin, ymax = 10, 45, 40, 100
xmin, xmax, ymin, ymax = 11, 45, 37, 102
h, w = 150, 200
mask = np.zeros((h, w), dtype=bool)
mask[ymin:ymax, xmin:xmax] = True
Expand Down Expand Up @@ -1036,25 +1035,25 @@ def test_gt_seg_as_mask_or_polys(

crud.create_groundtruths(db=db, groundtruths=[gt])

# shapes = db.scalars(
# select(
# ST_AsText(ST_Polygon(models.Annotation.raster)),
# )
# ).all()
# assert len(shapes) == 2

# # check that the mask and polygon define the same polygons
# assert (
# db.scalar(
# select(
# func.ST_Equals(
# func.ST_GeomFromText(shapes[0]),
# func.ST_GeomFromText(shapes[1]),
# )
# )
# )
# is True
# )
shapes = db.scalars(
select(
ST_AsText(ST_Polygon(models.Annotation.raster)),
)
).all()
assert len(shapes) == 2

# check that the mask and polygon define the same polygons
assert (
db.scalar(
select(
func.ST_Equals(
func.ST_GeomFromText(shapes[0]),
func.ST_GeomFromText(shapes[1]),
)
)
)
is True
)

# verify we get the same segmentations back
segs = crud.get_groundtruth(
Expand Down

0 comments on commit 8341e2b

Please sign in to comment.