-
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
Add Tuple support to CQGI #1373
Conversation
@jmwright I'm new to CQGI. I expected the default value of the parameter to match the value of the script. model = cqgi.parse(user_script)
params = model.metadata.parameters
for p, v in params.items():
print(v.name, v.default_value) I get 'pnt (0, 0, 0)' instead of 'pnt (0.5, 0.5, 0.5)'
Line 786 in 76dbeef
|
Codecov Report
@@ Coverage Diff @@
## master #1373 +/- ##
==========================================
+ Coverage 94.24% 94.29% +0.04%
==========================================
Files 28 28
Lines 5790 5804 +14
Branches 987 991 +4
==========================================
+ Hits 5457 5473 +16
+ Misses 199 198 -1
+ Partials 134 133 -1
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
@lorenzncode That should be fixed now. |
Thanks @jmwright. Should tuples of arbitrary length be supported? Say I have a parameter used with |
@lorenzncode Tuples of varying length are supported now. |
@jmwright I tried another tuple case with CQGI. import cadquery as cq
pts = ((0, 0), (0, 10))
result = cq.Workplane().pushPoints(pts).box(1, 2, 3, False)
show_object(result) This results in |
@lorenzncode How much tuple nesting should we allow? |
@jmwright A few thoughts on the CQGI input parameter issue:
|
@lorenzncode are you actually using it? Maybe it is not the best thing to work on in terms of ROI? |
@adam-urbanczyk No, I'm not. Agree, this was hypothetical based on my understanding of the purpose of CQGI. |
@lorenzncode My suggestion would be that we move your thoughts above into another CQGI issue, and I'll see about supporting a tuple of (vector-like) tuples via the ast.tuple class. |
@lorenzncode @adam-urbanczyk This PR does not have all the extra features mentioned above, but it seems work solve the immediate problem of CQGI not handling tuples at all. Please review when you have time. |
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 @jmwright. Here is a friendly reminder to squash if you end up doing the merge.
Closes #1370
Missing Tuple support was mentioned in this commit. @lorenzncode Are there changes that need to be made in this PR to recapture your original intent from #1367 ?