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

Adding minimal volume checking CI comparing CAD and CSG volumes #56

Merged
merged 4 commits into from
Apr 19, 2024
Merged

Adding minimal volume checking CI comparing CAD and CSG volumes #56

merged 4 commits into from
Apr 19, 2024

Conversation

shimwell
Copy link
Collaborator

@shimwell shimwell commented Apr 18, 2024

This PR adds to the CI with some tests that check the volume of the CAD file and the volume of the resulting CSG file.

The tests can be run locally or on the CI. When run locally the volume tolerance is decreased and the number of samples is increased in the stochastic volume calculation.

There were a few approaches that could have bee taken with this. I first made an implementation that did one stochastic volume calculation per model with a large bounding box over the whole model. While this worked I found it was quicker to do a stochastic volume calculation for every cell in every model. In this way the bound boxes were more compact around the solid and the stochastic volume calculation was more efficient.

Several of the stp files have been removed from the volume calculation test. While they all convert on the existing conversion testing CI they don't all result in the same volumes for both CSG and CAD. I've raised an issue for the simplest two stp files as they are single volumes that contain torus. I think the conversion bug can be tracked in that issue tackled separately and then we can introduce more of the stp files into the volume testing CI.

For now the volume testing CI doesn't cover all the stp files but I think it is still very useful to have as it makes sure that as we refactor and add to the code that we don't lose the capability of converting the stp files that are currently successfully converted.

As openmc runs best on linux I've only added these volume tests for ubuntu and excluded mac and windows from this testing.

As it is setup at the moment with the number of samples and acceptable tolerance and the removal of some step files the addition of these volume tests add about 1 min to the current CI. Naturally increasing the samples, reducing the acceptable tolerance or including some of the missing stp files will increase that 1 min.

Linux (Ubuntu) Windows Mac OS
Python 3.8 convert and volume
Python 3.9 convert and volume
Python 3.10 convert and volume
Python 3.11 convert and volume convert convert

@psauvan psauvan merged commit 6e7f883 into GEOUNED-org:dev Apr 19, 2024
6 checks passed
psauvan added a commit that referenced this pull request Apr 23, 2024
* update Fuzzy write function

* several stp file update

* script to color CAD document following material label

* fix rounding error of z value acos(z) evaluation

* Add a bug report template and .gitignore (#44)

* Removed unused imports and variables (#35)

* raise value error instead of exit (#41)

* Update to testing path (#40)

* changed hardcoded path to work for all users

* path update

* Update bug_report.md

* raising catchable error instead of exit (#47)

* raising catchable error instead of exit

* added new line

* added try for freecad import (#48)

* Solve SyntaxtError producing a bug (#49)

* Solve SyntaxtError producing a bug

* Limit the amount of decimals printed in the enclosure comment

* fixed error units in OpenMC output

* GEOUNED training presentation added (#53)

* Adding minimal ci to check cad converts (#52)

* added minimal CI

* all step files

* added ci yml

* removed freecadcmd arg

* Update pyproject.toml

Update url links to "GEOUNED-org"

* typo correction to test if CI is working (#54)

* typo correction

* [skip ci] added ci status badge

* opening up ci to all os systems

* fix small bug with torus (bad identification of closed mozaic faces)

* Adding minimal volume checking CI comparing CAD and CSG volumes (#56)

* added volume test to ci

* removed if os cond

* added csg vs cad volume for **most** stp files

* Added mkdocs (#57)

* added example docs

* added docs deps

* Reverting mkdocs PR 57 (#58)

* Revert "added example docs"

This reverts commit bd1c67a.

* Revert "added docs deps"

This reverts commit f31d241.

* Adding minimal particle transport tests on resulting csg files (#59)

* added transport tests

* removed files that break, raised issue

* [skip ci] remove prints

* added link to issue

* Add the name to the cells in OpenMC to improve identification (#61)

The name is the same that is used in MCNP inputs cell.Comments

* converting with no simplification = more geometry works (#62)

* reduced number of skiped geoms (#63)

* [skip ci] corrected bade to main branch (#64)

* Improved import statements (#65)

* changed single file from package to relative imports

* 2nd file converted to relative imports

* converted more fiels to relative import

* relative imports everywhere

* isort on all imports

* Add bug report and .gitignore to main (#45) (#66)

Co-authored-by: AlvaroCubi <55387701+AlvaroCubi@users.noreply.github.com>

* added standard gitignore for python project (#68)

---------

Co-authored-by: psauvan <psauvan@ind.uned.es>
Co-authored-by: Tony <63453741+repositony@users.noreply.github.com>
Co-authored-by: Jonathan Shimwell <drshimwell@gmail.com>
Co-authored-by: Aljaz Kolsek (F4E) <158494312+aljaz-kolsek@users.noreply.github.com>
Co-authored-by: Emilio Castro <emilio.castro@upm.es>
@AlvaroCubi AlvaroCubi mentioned this pull request Apr 24, 2024
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.

2 participants