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

geometry caching #1650

Merged
merged 40 commits into from
Nov 29, 2022
Merged

geometry caching #1650

merged 40 commits into from
Nov 29, 2022

Conversation

ivanmaione
Copy link
Contributor

@ivanmaione ivanmaione commented Nov 21, 2022

Linked Issues

related to Issue #1196
Closes #682
Closes #1090

Description

This PR implements the shape caching in BluemiraGeo objects. Geometry functions are modified in such a way that shape and boundary are always consistent.

Interface Changes

BluemiraGeo.shape and BluemiraGeo.boundary are readonly now.

Checklist

I confirm that I have completed the following checks:

  • Tests run locally and pass pytest tests --reactor
  • Code quality checks run locally and pass flake8 and black .
  • Documentation built locally and checked sphinx-build -W documentation/source documentation/build

Check tests

tests/geometry

  • test_coordinates.py
  • test_deprecated_base.py
  • test_deprecated_loop.py
  • test_deprecated_offset.py
  • test_deprecated_tools.py
  • test_face.py
  • test_geometry.py
  • test_inscribed_rect.py
  • test_offset.py -> necessary to change test_data/offset_wire2022-04-08_10-19-27.json to be compliant with the new serialization structure.
  • test_optimisation.py
  • test_parameterisations.py
  • test_orientation.py -> since the FreeCAD shape is directly cached, the only orientation test that could have meaning is that in which two wires are joined -> maybe it would be worth discussing this point.
  • test_placement.py
  • test_plane.py
  • test_sweep.py
  • test_tools.py
  • test_wire.py

@ivanmaione ivanmaione requested review from a team as code owners November 21, 2022 14:52
@CoronelBuendia CoronelBuendia mentioned this pull request Nov 22, 2022
3 tasks
@CoronelBuendia CoronelBuendia requested a review from a team as a code owner November 22, 2022 13:39
@github-actions
Copy link
Contributor

github-actions bot commented Nov 22, 2022

⚠️ Warning Report

Found 0 new warnings, 0 fixed warnings. 🎉

Copy link
Contributor

@CoronelBuendia CoronelBuendia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking really good! I fixed the last remaining test failure and made a couple of minor aesthetic changes. A couple of comments / queries beyond what we had discussed.

I'd really like to get rid of the orientation stuff in general, but without the EU-DEMO build stuff running in full with the caching, I'm too scared to take it out. I will create a separate issue to remove the orientation tracking, now that we no longer handle reconstruction.

bluemira/geometry/base.py Outdated Show resolved Hide resolved
bluemira/geometry/solid.py Show resolved Hide resolved
bluemira/geometry/tools.py Show resolved Hide resolved
examples/geometry/geometry_test.py Outdated Show resolved Hide resolved
bluemira/builders/cryostat.py Show resolved Hide resolved
@ivanmaione ivanmaione requested a review from a team as a code owner November 24, 2022 08:04
Copy link
Contributor

@je-cook je-cook left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy just a few minors

examples/geometry/geometry_tutorial.py Outdated Show resolved Hide resolved
examples/geometry/geometry_tutorial.py Outdated Show resolved Hide resolved
bluemira/geometry/base.py Outdated Show resolved Hide resolved
bluemira/geometry/base.py Outdated Show resolved Hide resolved
@CoronelBuendia CoronelBuendia self-assigned this Nov 29, 2022
@sonarcloud
Copy link

sonarcloud bot commented Nov 29, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

@codecov-commenter
Copy link

Codecov Report

Merging #1650 (45533ab) into develop (ebec2de) will decrease coverage by 0.07%.
The diff coverage is 80.32%.

@@             Coverage Diff             @@
##           develop    #1650      +/-   ##
===========================================
- Coverage    74.65%   74.57%   -0.08%     
===========================================
  Files          162      162              
  Lines        19213    19382     +169     
===========================================
+ Hits         14343    14455     +112     
- Misses        4870     4927      +57     
Impacted Files Coverage Δ
bluemira/codes/_freecadapi.py 81.91% <54.76%> (-1.83%) ⬇️
bluemira/geometry/solid.py 76.19% <74.19%> (-13.56%) ⬇️
bluemira/geometry/compound.py 82.35% <77.77%> (-8.56%) ⬇️
bluemira/geometry/shell.py 82.69% <77.77%> (-14.09%) ⬇️
bluemira/geometry/face.py 75.23% <78.94%> (+3.64%) ⬆️
bluemira/geometry/wire.py 87.82% <84.21%> (-2.94%) ⬇️
bluemira/geometry/base.py 83.79% <91.46%> (+0.98%) ⬆️
bluemira/geometry/tools.py 81.34% <94.44%> (ø)
bluemira/builders/cryostat.py 100.00% <100.00%> (ø)
bluemira/display/displayer.py 96.84% <100.00%> (ø)
... and 8 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@CoronelBuendia CoronelBuendia merged commit 7e6b8a3 into develop Nov 29, 2022
@CoronelBuendia CoronelBuendia deleted the ivanmaione/develop_simple_caching3 branch November 29, 2022 13:22
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.

Faling build of hollow torus solid Add fix_face and include when faces are created
4 participants