Skip to content

Commit

Permalink
Fix issue count and assignment (#14)
Browse files Browse the repository at this point in the history
Signed-off-by: patrickpa <[email protected]>
  • Loading branch information
patrickpa authored Jun 7, 2024
1 parent 5220105 commit 6235b88
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions qc_opendrive/checks/semantic.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def check_invalid_road_lane_access_no_mix_of_deny_or_allow(
logging.info("Executing road.lane.access.no_mix_of_deny_or_allow check")

lanes = utils.get_lanes(root=root)
issue_count = 0

lane: etree._Element
for lane in lanes:
access_s_offset_info: List[SOffsetInfo] = []
Expand All @@ -51,10 +51,9 @@ def check_invalid_road_lane_access_no_mix_of_deny_or_allow(
abs(s_offset_info.s_offset - s_offset) <= 1e-6
and rule != s_offset_info.rule
):
result.register_issue(
issue_id = result.register_issue(
checker_bundle_name=constants.BUNDLE_NAME,
checker_id=CHECKER_ID,
issue_id=issue_count,
description="At a given s-position, either only deny or only allow values shall be given, not mixed.",
level=IssueSeverity.ERROR,
)
Expand All @@ -67,21 +66,21 @@ def check_invalid_road_lane_access_no_mix_of_deny_or_allow(
result.add_xml_location(
checker_bundle_name=constants.BUNDLE_NAME,
checker_id=CHECKER_ID,
issue_id=issue_count,
issue_id=issue_id,
xpath=path,
description=f"First encounter of {current_rule} having {previous_rule} before.",
)

issue_count += 1

access_s_offset_info.append(
SOffsetInfo(
s_offset=float(access_attr["sOffset"]),
rule=access_attr["rule"],
)
)

logging.info(f"Issues found - {issue_count}")
logging.info(
f"Issues found - {result.get_checker_issue_count(checker_bundle_name=constants.BUNDLE_NAME, checker_id=CHECKER_ID)}"
)


def run_checks(config: Configuration, result: Result) -> None:
Expand Down

0 comments on commit 6235b88

Please sign in to comment.