Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

popPendingEdges and Wires #678

Merged
merged 3 commits into from
Mar 10, 2021
Merged

popPendingEdges and Wires #678

merged 3 commits into from
Mar 10, 2021

Conversation

marcus7070
Copy link
Member

Will close #621. To summarise:

  • More informative exception when pendingWires or pendingEdges is empty
  • Minimise code duplication
  • More consistent method to pop pending Edges/Wires

I'm keeping this a draft PR until I see the test coverage, if it goes down then I'll fix that.

@marcus7070
Copy link
Member Author

Just FYI, I tried two ways of solving this.

  1. A single method, def getPending(edges: bool = False, wires: bool = True):
  2. The two methods, popPendingEdges and popPendingWires, that you can see in this PR.

The first way needed a lot of overloads and casts to satisfy mypy. The experience has made me realise that two methods is the better solution, each method returning a single type.

@codecov
Copy link

codecov bot commented Mar 8, 2021

Codecov Report

Merging #678 (d7e7812) into master (48deb19) will increase coverage by 0.06%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #678      +/-   ##
==========================================
+ Coverage   94.21%   94.27%   +0.06%     
==========================================
  Files          31       31              
  Lines        6702     6742      +40     
  Branches      726      727       +1     
==========================================
+ Hits         6314     6356      +42     
+ Misses        253      252       -1     
+ Partials      135      134       -1     
Impacted Files Coverage Δ
cadquery/cq.py 91.02% <100.00%> (+0.22%) ⬆️
tests/test_cadquery.py 99.12% <100.00%> (+0.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 48deb19...d7e7812. Read the comment docs.

@marcus7070 marcus7070 marked this pull request as ready for review March 8, 2021 04:39
Copy link
Member

@jmwright jmwright left a comment

Choose a reason for hiding this comment

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

Thanks @marcus7070 !

@jmwright jmwright merged commit f0308ce into CadQuery:master Mar 10, 2021
@marcus7070 marcus7070 deleted the getPending branch March 10, 2021 11:08
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.

Improved error when pendingWires/pendingEdges is empty
3 participants