Skip to content

Add slots, retaining ring grooves and threaded center holes - #599

Merged
jmtts merged 2 commits into
mainfrom
claude/daily-monitoring-skills-mhh818
Sep 30, 2026
Merged

jmtts merged 2 commits into
mainfrom
claude/daily-monitoring-skills-mhh818

Conversation

@werk24

@werk24 werk24 commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

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).
    • width is 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 Ø.
    • length is the larger size, as written.
    • It is distinct from KeySlot, which is named by the key it takes.
  • RetainingRingGroove, with the enum RetainingRingSide (SHAFT / BORE): a groove for a retaining ring, named by the ring it takes.
    • Fields: standard (e.g. DIN 471), ring_side, nominal_diameter (the shaft or bore diameter), ring_thickness, and a maker's designation and manufacturer when the drawing names the ring that way.
  • CenterHole.thread: the thread of a threaded center hole (DIN 332-2 forms D, DR, DS, e.g. DIN 332-D M16).
    • It is embedded like FastenerSpecification.thread.
    • None for a center hole without a thread.
    • The form, pilot_diameter and outer_diameter descriptions now cover the threaded forms too.
  • ResponseFeaturesComponentDrawing gains slots and retaining_ring_grooves, both empty by default.
  • Exports: all new names are exported from werk24.

Compatibility: every addition is optional or defaults to empty. A response without the new fields, and a CenterHole without thread, still parse, and tests pin both.

Tests: .venv/bin/python -m pytest gives 1009 passed, 5 skipped (997 passed, 5 skipped on main). The 12 new tests are in tests/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.

  1. Keep Seeger RB 042 as the example of a maker's designation?

    • It appears in the RetainingRingGroove docstring, 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.
    • Recommendation: keep it if it is a real designation. Otherwise replace it with one from the catalogue before the next release.
  2. Is DIN 472 42x1,75 right as the bore example?

    • It is the example for a bore ring in the RetainingRingGroove docstring and the retaining_ring_grooves description: a 42 mm bore taking a 1.75 mm ring.
    • Recommendation: yes, if it matches the DIN 472 table. Otherwise use a row that does.

Not questions, for after the merge:

  • Release it, so clients installing from PyPI get the new models.
  • Document the two new lists in the features response on the docs site.

🤖 Generated with Claude Code

https://claude.ai/code/session_013aeHb3dRVKHNVQLbu3idcS


Generated by Claude Code

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>
Copilot AI balanced review requested due to automatic review settings September 30, 2026 10:30

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

The DIN 332-2 diameter mapping is inaccurate and cannot represent both dimensions in the documented callout.

Review effort: Balanced
Findings: 1 High severity

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.

Comment thread werk24/models/v2/models.py Outdated
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
jmtts merged commit e0362c7 into main Sep 30, 2026
7 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.

4 participants