Skip to content

Improve COMPU-RATIONAL-COEFFS scaling robustness#887

Merged
ebroecker merged 1 commit into
ebroecker:developmentfrom
BohdanBuinich:fix/arxml-compu-rational-robustness
Dec 10, 2025
Merged

Improve COMPU-RATIONAL-COEFFS scaling robustness#887
ebroecker merged 1 commit into
ebroecker:developmentfrom
BohdanBuinich:fix/arxml-compu-rational-robustness

Conversation

@BohdanBuinich

Copy link
Copy Markdown
Contributor

Enhance the decode_compu_method function to handle edge cases and comply with AUTOSAR specifications:

  • Add null safety checks for numerator/denominator parents
  • Default missing denominator to 1 per AUTOSAR spec
  • Detect and warn about polynomial scaling (unsupported)
  • Handle constant mappings (single coefficient)
  • Handle empty coefficient lists gracefully
  • Catch IndexError and InvalidOperation in addition to DivisionByZero
  • Improve warning messages with actual coefficient values for debugging

This prevents crashes when parsing ARXML files with malformed or edge-case COMPU-RATIONAL-COEFFS definitions.

Enhance the decode_compu_method function to handle edge cases and
comply with AUTOSAR specifications:

- Add null safety checks for numerator/denominator parents
- Default missing denominator to 1 per AUTOSAR spec
- Detect and warn about polynomial scaling (unsupported)
- Handle constant mappings (single coefficient)
- Handle empty coefficient lists gracefully
- Catch IndexError and InvalidOperation in addition to DivisionByZero
- Improve warning messages with actual coefficient values for debugging

This prevents crashes when parsing ARXML files with malformed or
edge-case COMPU-RATIONAL-COEFFS definitions.
@ebroecker ebroecker merged commit 08a24da into ebroecker:development Dec 10, 2025
15 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants