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

Assy solver fix #806

Merged
merged 6 commits into from
Jul 3, 2021
Merged

Assy solver fix #806

merged 6 commits into from
Jul 3, 2021

Conversation

adam-urbanczyk
Copy link
Member

@adam-urbanczyk adam-urbanczyk commented Jun 27, 2021

Will resolve #767, #790, #809

@codecov
Copy link

codecov bot commented Jun 27, 2021

Codecov Report

Merging #806 (7625432) into master (4c5816d) will decrease coverage by 0.09%.
The diff coverage is 97.77%.

❗ Current head 7625432 differs from pull request most recent head 245e44b. Consider uploading reports for the commit 245e44b to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master     #806      +/-   ##
==========================================
- Coverage   95.18%   95.09%   -0.10%     
==========================================
  Files          32       32              
  Lines        7413     7436      +23     
  Branches      796      797       +1     
==========================================
+ Hits         7056     7071      +15     
- Misses        220      225       +5     
- Partials      137      140       +3     
Impacted Files Coverage Δ
cadquery/occ_impl/solver.py 93.61% <97.14%> (-0.09%) ⬇️
cadquery/assembly.py 92.79% <100.00%> (+0.06%) ⬆️
tests/test_assembly.py 100.00% <100.00%> (ø)
cadquery/cqgi.py 79.09% <0.00%> (-2.46%) ⬇️
tests/test_workplanes.py 99.30% <0.00%> (-0.70%) ⬇️

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 4c5816d...245e44b. Read the comment docs.

@marcus7070
Copy link
Member

The docs on the CCSAQ method are an interesting read: https://nlopt.readthedocs.io/en/latest/NLopt_Algorithms/#mma-method-of-moving-asymptotes-and-ccsa

popular for topology optimization...

Sounds good @adam-urbanczyk!

@marcus7070
Copy link
Member

Tested on a random assembly with some kind of conflicting constraints. Old scipy.optimize solver:

Warning: Maximum number of iterations has been exceeded.
         Current function value: 0.000764
         Iterations: 1000
         Function evaluations: 1270
         Gradient evaluations: 1270

New nlopt solver:

{'cost': 6.476835679796388e-15, 'iters': 1554, 'status': -inf}

Assuming iterations and values are comparable between the two techniques, that's possibly an improvement for this one case. Certainly not a regression.

@adam-urbanczyk adam-urbanczyk marked this pull request as ready for review July 2, 2021 10:39
@jmwright jmwright self-requested a review July 2, 2021 10:42
cadquery/occ_impl/solver.py Outdated Show resolved Hide resolved
Co-authored-by: Marcus Boyd <[email protected]>
@marcus7070
Copy link
Member

marcus7070 commented Jul 2, 2021

The appveyor check failed on test_constrain.

@adam-urbanczyk
Copy link
Member Author

Yes, weird

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.

Looks good, but some comments in cadquery/occ_impl/solver.py would be very welcome.

@adam-urbanczyk
Copy link
Member Author

I did run the assy tests 1000 times locally and cannot reproduce the behavior.

@marcus7070
Copy link
Member

@slobberingant has reported this does resolve #767 and that test failure can not be reproduced, so I'm going to merge.

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.

Need to run Assemble.solve() twice.
3 participants