-
Notifications
You must be signed in to change notification settings - Fork 291
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
Location implementation and CQ typing #380
Conversation
wraps TopLoc_Location
@jmwright @dcowden I did more or less finish annotating The other thing I changed (for better I hope) is the All in all I think it is worth it, although slightly breaking. |
Codecov Report
@@ Coverage Diff @@
## master #380 +/- ##
==========================================
+ Coverage 93.31% 93.42% +0.10%
==========================================
Files 19 19
Lines 4847 4925 +78
Branches 483 510 +27
==========================================
+ Hits 4523 4601 +78
+ Misses 210 204 -6
- Partials 114 120 +6
Continue to review full report at Codecov.
|
@adam-urbanczyk When you say "anymore", are you saying that the process of annotation caused this problem?
Changing something so fundamental in the core of CQ makes me nervous. Are you saying the CQ alias prevent will prevent breakage of all existing scripts, or just some of them? |
@jmwright I meant that somewhere along the way we ended up in the situation where methods of CQ call methods of Workplane. Probably at the beginning there was a nice design, but it was not enforced and a somewhat entangled situation materialized. We can either fix it (move methods around and break backward compatibility) or merge the two classes into one (which I did in this PR). Annotating+mypy check revealed the issue. I start to appreciate mypy more and more. To be honest merging of What did change is the way plugins need to be written - they need to accept |
To be more specific, here is an example of the entanglement I was referring to above: Line 169 in f522899
CQ.split calls self.rect which is not defined in the class CQ .
|
I see now. It doesn't sound like as much of a breaking change as I expected. It would be nice to hear from someone who uses the plugin system about those changes. |
Absolutely @jmwright , I'm curious though if such a person exists. An alternative approach would be to add another method, say |
Maybe not. I know that we have pointed some people to plugins over the years, but I don't know how many are using it. I do know that a couple of spots in our codebase were designed to test the plugin functionality. cadquery/tests/test_cadquery.py Line 118 in f9fe7b1
If the tests like that work, we're probably ok. |
The changes to |
@michaelgale I'd like to start using |
I think I'm happy with this PR. We can let it sink in for a couple of days, maybe some user of the plugin system will still show up here. I'd still like to annotate the |
+1 for merging on the 25th if there are no issues brought up by the community. |
There seem to be no complaints, so I'd propose to move forward with this. |
@adam-urbanczyk I see there's now a merge conflict. |
Resolved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for putting this together.
I think everything is fixed @jmwright |
Great, thanks for all the work you've put into this! Merging. |
I'm a few weeks late, but I just want to report that while the changes did initially break my plugins, it did not take long to implement a fix once I took a look at the changes. |
Good to hear @maderero ! Are you planning to share your code? It is always interesting to see what people are doing with CQ. |
At some point I could share the plugins, which are essentially shortcuts to make common structural steel shapes . Here's a sample of some wide-flange beams in the cq-editor window. |
Cool @maderero , thanks for sharing! BTW: you might be interested in the |
I'm glad you like it, @adam-urbanczyk! I will keep that function in mind as well. |
This is related to #118 and #247. I think it will be a solid basis for further extending of CQ.
TopLoc_Location
eachpoint
and related methodsobjects
, handle ineachpoint
andval
. This makes usingadd
more intuitive.