Skip to content

Assy solver fix - #806

Merged
marcus7070 merged 6 commits into
masterfrom
solver-fix
Jul 3, 2021
Merged

Assy solver fix#806
marcus7070 merged 6 commits into
masterfrom
solver-fix

Conversation

@adam-urbanczyk

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

Copy link
Copy Markdown
Member

Will resolve #767, #790, #809

@adam-urbanczyk
adam-urbanczyk marked this pull request as draft June 27, 2021 16:19
@codecov

codecov Bot commented Jun 27, 2021

Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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
@adam-urbanczyk
adam-urbanczyk requested a review from marcus7070 July 2, 2021 10:39
@jmwright
jmwright self-requested a review July 2, 2021 10:42
Comment thread cadquery/occ_impl/solver.py Outdated
Co-authored-by: Marcus Boyd <mwb@geosol.com.au>
@marcus7070

marcus7070 commented Jul 2, 2021

Copy link
Copy Markdown
Member

The appveyor check failed on test_constrain.

@adam-urbanczyk

Copy link
Copy Markdown
Member Author

Yes, weird

@jmwright jmwright left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
Member Author

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

@marcus7070

Copy link
Copy Markdown
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