Skip to content

Commit

Permalink
fix: compatibility with Python 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
nalquas committed Nov 18, 2024
1 parent 1342aae commit a702f6c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ dependencies = [
"jsonschema>=4.4.0",
"fastjsonschema>=2.16.2",
"raillabel>=3.1.0, <4.0.0",
"pyyaml>=6.0.0"
"pyyaml>=6.0.0",
"numpy>=1.24.4",
]

[project.urls]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,14 @@ def _count_rails_per_track_in_frame(frame: raillabel.format.Frame) -> dict[str,
left_count: int = 0
right_count: int = 0
for poly2d in poly2ds:
match poly2d.attributes["railSide"]:
case "leftRail":
left_count += 1
case "rightRail":
right_count += 1
case _:
# NOTE: This is ignored because it is covered by validate_onthology
continue
rail_side = poly2d.attributes["railSide"]
if rail_side == "leftRail":
left_count += 1
elif rail_side == "rightRail":
right_count += 1
else:
# NOTE: This is ignored because it is covered by validate_onthology
continue

# Store counts of current track
counts[object_uid] = (left_count, right_count)
Expand Down
2 changes: 2 additions & 0 deletions tests/test_raillabel_providerkit/_util/test_filters.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Copyright DB Netz AG and contributors
# SPDX-License-Identifier: Apache-2.0

from __future__ import annotations

import pytest
import raillabel

Expand Down

0 comments on commit a702f6c

Please sign in to comment.