Skip to content

Commit

Permalink
Merge pull request #2 from traMectory/main
Browse files Browse the repository at this point in the history
Bugfix: Ensure coordinates are converted to FieldNumber before Point construction
  • Loading branch information
d-krupke authored Oct 10, 2024
2 parents ed8ba20 + 3302dcf commit 310ae59
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/cgshop2025_pyutils/verifier/verifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from cgshop2025_pyutils.data_schemas.instance import Cgshop2025Instance
from cgshop2025_pyutils.data_schemas.solution import Cgshop2025Solution
from cgshop2025_pyutils.geometry import Point, VerificationGeometryHelper
from cgshop2025_pyutils.geometry import Point, VerificationGeometryHelper, FieldNumber


class VerificationResult(BaseModel):
Expand All @@ -21,7 +21,7 @@ def verify(
# Combine instance and solution points into one loop to simplify the logic
all_points = [Point(x, y) for x, y in zip(instance.points_x, instance.points_y)]
all_points.extend(
Point(x, y)
Point(FieldNumber(x), FieldNumber(y))
for x, y in zip(solution.steiner_points_x, solution.steiner_points_y)
)

Expand Down
4 changes: 2 additions & 2 deletions tests/test_verify.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ def test_verify_correct_solution_extra_points():
)
solution = Cgshop2025Solution(
instance_uid=instance.instance_uid,
steiner_points_x=[272, 320],
steiner_points_y=[512, 512],
steiner_points_x=["272/1", 320],
steiner_points_y=[512, "1024/2"],
edges=[
[0, 5],
[5, 6],
Expand Down

0 comments on commit 310ae59

Please sign in to comment.