Skip to content

Preserve floating-point limits in EDS object dictionaries - #689

Open
timothyanderson096-ocdealcheck wants to merge 1 commit into
canopen-python:masterfrom
timothyanderson096-ocdealcheck:fix/eds-floating-limits
Open

timothyanderson096-ocdealcheck wants to merge 1 commit into
canopen-python:masterfrom
timothyanderson096-ocdealcheck:fix/eds-floating-limits

Conversation

@timothyanderson096-ocdealcheck

Copy link
Copy Markdown

REAL32/REAL64 LowLimit and HighLimit values such as -1.5 are currently discarded, even though floating defaults parse correctly. The existing sample EDS also loses its REAL32 lower bound of 4.5.

Parse limits with the existing integer grammar first, then decimal-float fallback. This preserves previously accepted integer values/types, including hex/octal forms and large exact integers, while retaining fractional limits through EDS/DCF export and reimport. Describe bounds as int | float | None and keep fractional values intact in existing warning-only diagnostics.

Related to the decimal-float guidance in #658; thanks to acolomb for that clarification. No IEEE bit-pattern reinterpretation or new range-enforcement behavior is introduced.

Validation on Linux / CPython 3.12.14 / pytest 8.4.2 / pytest-cov 5.0.0:

  • Identical selected regression tests on untouched original production: 3 failed, 1 passed; final candidate: 4 passed.
  • Full core coverage suite: 282 passed, 1 existing optional-dependency skip. With db_export / canmatrix 1.3.3: 283 passed, zero skips.
  • Fresh configured HTML docs, critical flake8 and whitespace checks pass.
  • Independent final review checks existing integer literal forms, fractions, missing/malformed limits, EDS/DCF round trips and warning-only behavior.

Supplemental mypy remains non-green: 45 baseline diagnostics versus 47 candidate diagnostics. The precise bound union expands two existing heterogeneous-input comparison reports at the same locations (str < float / str > float); both runs also share the missing generated-version module diagnostic. No ignores or suppressions were added, and no full typing-pass claim is made.

Exact tested head: b95ec7f208c09a740d71bfddc0b22916b7bb8456, based on 14b3336bc973023e82325426adf6d71046ebcf55. Hardware and hosted CI remain unverified.

Prepared with OpenAI Codex assistance and independent inspection.

Timothy Anderson — Spotted Ridge Engineering / OC Labs
Independent software verification · GDN (Global Decision Network)
timothyanderson096@gmail.com · Engineering evidence

Accept decimal floating-point limits for REAL32/REAL64 while retaining previously accepted integer literal forms and exact integer values. Preserve fractional values in existing warning-only bound diagnostics and describe the stored bound types accurately.

Add import/export/reimport and diagnostic regressions. Prepared with OpenAI Codex assistance and independent inspection.

Timothy Anderson — Spotted Ridge Engineering / OC Labs
Independent software verification · GDN (Global Decision Network)
timothyanderson096@gmail.com · https://github.com/timothyanderson096-ocdealcheck/gdn-engineering-benchmarks
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.

1 participant