Add slots, retaining ring grooves and threaded center holes - #599
Merged
Merged
Conversation
A drawing sizes an elongated hole with round ends by its width and length (`2x Langloch 14x15`, `3x Langloch Ø 10`), and names the groove for a retaining ring by the ring it takes (`DIN 471 30x1,5`, or a maker's designation such as `Seeger RB 042`). ResponseFeaturesComponentDrawing now carries them as slots and retaining_ring_grooves, with the models Slot and RetainingRingGroove and the enum RetainingRingSide (shaft or bore). CenterHole gains an optional thread for the threaded forms D, DR and DS of DIN 332-2 (`DIN 332-D M16`). The descriptions of form, pilot_diameter and outer_diameter now say how those forms are written, including a callout that states the two countersink diameters instead of the thread. The new lists default to empty and the thread to None, so responses from servers that predate them still parse, and clients that predate them ignore them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The DIN 332-2 diameter mapping is inaccurate and cannot represent both dimensions in the documented callout.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Adds v2 model support for slots, retaining-ring grooves, and threaded center holes.
Changes:
- Adds new feature models and retaining-ring side enum.
- Extends component responses with compatible default-empty lists.
- Adds serialization, validation, export, and compatibility tests.
| File | Description |
|---|---|
werk24/models/v2/responses.py |
Exposes the new feature lists. |
werk24/models/v2/models.py |
Defines the models and center-hole thread support. |
werk24/models/v2/enums.py |
Adds retaining-ring placement values. |
tests/test_standard_features.py |
Covers new models and compatibility. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
For DIN 332-D 8,4x12,2 the two numbers are d3 x d4 of the M8 row. d4 is the outer diameter; d3 is fixed by the thread, so the example carries the M8 thread instead of leaving it empty. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jmtts
approved these changes
Sep 30, 2026
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.

Three additions to the v2 models, so a response can carry three kinds of feature it could not describe before.
Slot: an elongated hole with round ends, sized by its width and, if stated, its length (2x Langloch 14x15,3x Langloch Ø 10).widthis the smaller of two written sizes, and also the diameter of the round ends. It is a linear size even when written withØ; the label keeps theØ.lengthis the larger size, as written.KeySlot, which is named by the key it takes.RetainingRingGroove, with the enumRetainingRingSide(SHAFT/BORE): a groove for a retaining ring, named by the ring it takes.standard(e.g.DIN 471),ring_side,nominal_diameter(the shaft or bore diameter),ring_thickness, and a maker'sdesignationandmanufacturerwhen the drawing names the ring that way.CenterHole.thread: the thread of a threaded center hole (DIN 332-2 formsD,DR,DS, e.g.DIN 332-D M16).FastenerSpecification.thread.Nonefor a center hole without a thread.form,pilot_diameterandouter_diameterdescriptions now cover the threaded forms too.ResponseFeaturesComponentDrawinggainsslotsandretaining_ring_grooves, both empty by default.werk24.Compatibility: every addition is optional or defaults to empty. A response without the new fields, and a
CenterHolewithoutthread, still parse, and tests pin both.Tests:
.venv/bin/python -m pytestgives 1009 passed, 5 skipped (997 passed, 5 skipped onmain). The 12 new tests are intests/test_standard_features.py: a round-trip of each model, a center hole with and without a thread, a slot written withØ, a designation-only groove, and the two compatibility cases.Questions for the owner
Two questions. Neither blocks the merge; each has a recommendation.
Keep
Seeger RB 042as the example of a maker's designation?RetainingRingGroovedocstring, a test and the commit message, as the example of a ring named by its maker rather than by a standard. It has not been checked against the maker's catalogue.Is
DIN 472 42x1,75right as the bore example?RetainingRingGroovedocstring and theretaining_ring_groovesdescription: a 42 mm bore taking a 1.75 mm ring.Not questions, for after the merge:
🤖 Generated with Claude Code
https://claude.ai/code/session_013aeHb3dRVKHNVQLbu3idcS
Generated by Claude Code