Repository navigation
Conversation
…ue's type The XML parser turned numeric-looking values into numbers, so "01" became 1 and could never match an IFCLABEL "01", and reals were compared exactly. Values now stay text; evalRequirement compares a string as text, a number within the IDS tolerance (|x - v| < |v| * 1e-6 + 1e-6) and a boolean case-insensitively. Bound and length limits are converted with Number(). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
IDS values are text, but
IDSSpecifications.xmlParserparses numeric-looking values (parseAttributeValue: true,numberParseOptions: { leadingZeros: true, hex: true }).<simpleValue>01</simpleValue>becomes1, an enumeration value007becomes7, and1e3becomes1000. The string fallback from #731 then compares"1"with the model's"01"and fails. Numbers are also compared exactly, so0.1 + 0.2doesn't match0.3. That accounts for thetolerancedisagreements listed in #831.evalRequirementcomparessimpleandenumerationvalues by the type of the model value. Strings compare as text. Numbers compare within the IDS tolerancev ± (|v|·1e-6 + 1e-6)(tolerance.md). Values exactly on those bounds pass, as the test cases expect, and a tiny relative margin absorbs double rounding.xs:range restrictions stay exact, as that document requires. Booleans compare asxs:boolean(true/1,false/0).Number()inimporters/parameter.ts, since they are no longer parsed.IDSProperty.evalValueis no longer needed and is removed.Additional context
TestCases/tolerance): 36 of 36 agree (22 on main). Across all 307 non-invalid-cases, 14 more agree and none stops agreeing.facets/value-comparison.test.ts: loading keeps01,007and1e3as written; leading zeros; bound andxs:lengthlimits; tolerance, including values on the bounds; booleans; enumerations.vitest --run(IDS folder) passes andtsc -p tsconfig-build.json --noEmitis clean.Property.ts, around the IDS wrong auto conversion #731 workaround this PR removes. The textual conflict is small; I'm happy to rebase whichever lands second.What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following:
🤖 Generated with Claude Code