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

fix unconstrained assembly.solve() #592

Merged
merged 4 commits into from
Jan 21, 2021
Merged

fix unconstrained assembly.solve() #592

merged 4 commits into from
Jan 21, 2021

Conversation

greyltc
Copy link
Contributor

@greyltc greyltc commented Jan 18, 2021

Fixes #591

cadquery/assembly.py Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Jan 19, 2021

Codecov Report

Merging #592 (48d7800) into master (4c77c87) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #592   +/-   ##
=======================================
  Coverage   94.26%   94.27%           
=======================================
  Files          29       29           
  Lines        6348     6353    +5     
  Branches      675      676    +1     
=======================================
+ Hits         5984     5989    +5     
  Misses        226      226           
  Partials      138      138           
Impacted Files Coverage Δ
cadquery/assembly.py 90.54% <100.00%> (+0.09%) ⬆️
tests/test_assembly.py 100.00% <100.00%> (ø)

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 4c77c87...48d7800. Read the comment docs.

@adam-urbanczyk
Copy link
Member

I reworked to raise a ValueError with a clear message. Anything against @greyltc ?

@greyltc
Copy link
Contributor Author

greyltc commented Jan 19, 2021

Yeah, it's very likely the user has made a mistake if they call solve() without setting up constraints.

I can imagine a case where it might be convenient for solve() to be a noop (or just throw a warning), like if you're troubleshooting constraints and you've commented them all out or something.

I'm fine with leaving it as an error though.

@adam-urbanczyk
Copy link
Member

I'm on the being explicit side on that one - solve only makes sense with constraints.

@adam-urbanczyk
Copy link
Member

Are you fine with merging @jmwright ?

@jmwright
Copy link
Member

+1

@jmwright jmwright merged commit c0ebeba into CadQuery:master Jan 21, 2021
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.

crash calling .solve() on an assembly with no constraints
4 participants