gumyr / build123d

A python CAD programming library
Apache License 2.0
505 stars 85 forks source link

Return `GeomType` enum, from `Shape.geom_type()` #559

Closed BogdanTheGeek closed 7 months ago

BogdanTheGeek commented 7 months ago

Fixes: #321 and #466

Solution: Return GeomType directly. Add type hints to LUTs

Compromises: Cannot return arbitrary strings or Shapes from GeomType (Eg. Vertex, Component, Face etc.) GeomType is now a str enum to maintain compatibility

Breaking changes:

BogdanTheGeek commented 7 months ago

Seeing how some of the LUTs are only used by geom_type(), should we make them "private" members of Shape?

codecov[bot] commented 7 months ago

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (72827ff) 96.24% compared to head (29663f7) 94.84%. Report is 11 commits behind head on dev.

Files Patch % Lines
src/build123d/topology.py 95.55% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## dev #559 +/- ## ========================================== - Coverage 96.24% 94.84% -1.40% ========================================== Files 24 24 Lines 7746 7745 -1 ========================================== - Hits 7455 7346 -109 - Misses 291 399 +108 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

BogdanTheGeek commented 7 months ago

also fixes #544