Skip to content

Expose general tolerance note contents and linear rules - #602

Merged
werk24 merged 3 commits into
mainfrom
codex/general-tolerance-notes
Oct 5, 2026
Merged

werk24 merged 3 commits into
mainfrom
codex/general-tolerance-notes

Conversation

@jmtts

@jmtts jmtts commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator

Expose the printed general tolerance note and its explicit linear rules in API v2. GeneralTolerances gains optional tolerance_note text and a default-empty tolerance_table containing decimal-place or nominal-range rules, signed deviations, and mm/inch units. Existing payloads remain valid; v1 models are unchanged.

Validation: 41 model and compatibility tests passed, including legacy payload parsing and JSON round trips. Field defaults preserve compatibility with responses that predate the new fields.

Questions for the owner

0 questions; none block merge.

Expose structured ISO 9013 cut quality on roughness
@werk24
werk24 marked this pull request as ready for review October 5, 2026 10:33
Copilot AI balanced review requested due to automatic review settings October 5, 2026 10:33
@werk24
werk24 merged commit f78e4f2 into main Oct 5, 2026
7 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Tolerance rows accept conflicting selectors and invalid intervals without enforcing their documented contract.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Extends the public client models with structured general-tolerance notes and thermal-cut-quality information.

Changes:

  • Adds optional v2 tolerance-note text and linear tolerance rules.
  • Adds shared ISO 9013 quality data to v1/v2 roughness models.
  • Adds compatibility, validation, and serialization tests.
File Description
werk24/​models/​v2/​models.py Adds tolerance-note fields, rule rows, and roughness quality data.
werk24/​models/​v1/​roughness.py Adds optional thermal-cut quality.
werk24/​models/​thermal_cut_quality.py Defines the shared ISO 9013 designation model.
tests/​test_thermal_cut_quality.py Tests designation validation, defaults, and serialization.
tests/​test_general_tolerance_note.py Tests legacy payloads and tolerance-note round trips.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +161 to +166
decimal_places: Optional[int] = Field(default=None, ge=0)
nominal_min: Optional[Decimal] = None
nominal_max: Optional[Decimal] = None
deviation_min: Decimal
deviation_max: Decimal
unit: str = Field(pattern=r"^(mm|inch)$", description="Length unit: mm or inch.")
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.

4 participants