-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 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 <[email protected]> * added standard gitignore for python project (#68) --------- Co-authored-by: psauvan <[email protected]> Co-authored-by: Tony <[email protected]> Co-authored-by: Jonathan Shimwell <[email protected]> Co-authored-by: Aljaz Kolsek (F4E) <[email protected]> Co-authored-by: Emilio Castro <[email protected]>
- Loading branch information
1 parent
c426387
commit 8bc7bd0
Showing
51 changed files
with
892 additions
and
302 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: CI testing | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- dev | ||
- main | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
testing: | ||
name: CI (Python=${{ matrix.python-version }}, OS=${{ matrix.os }}) | ||
runs-on: ${{ matrix.os }} | ||
defaults: | ||
run: | ||
shell: bash -el {0} | ||
strategy: | ||
matrix: | ||
os: ["ubuntu-latest", "macos-latest", "windows-latest"] | ||
python-version: ["3.11"] | ||
|
||
include: | ||
- python-version: "3.8" | ||
os: "ubuntu-latest" | ||
- python-version: "3.9" | ||
os: "ubuntu-latest" | ||
- python-version: "3.10" | ||
os: "ubuntu-latest" | ||
steps: | ||
- name: checkout actions | ||
uses: actions/checkout@v4 | ||
- uses: conda-incubator/setup-miniconda@v3 | ||
with: | ||
auto-update-conda: true | ||
python-version: ${{ matrix.python-version }} | ||
channels: conda-forge | ||
|
||
- name: install dependencies | ||
run: conda install -c conda-forge freecad -y | ||
|
||
- name: install package | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install . | ||
python -c 'import GEOUNED' | ||
python -c 'from GEOReverse import reverse' | ||
python -m pip install .[tests] | ||
- name: testing GEOUNED functionality | ||
run: python -m pytest -v tests/test_convert.py | ||
|
||
- name: install openmc | ||
if: ${{ matrix.os == 'ubuntu-latest'}} | ||
run: conda install -c conda-forge openmc -y | ||
|
||
- name: testing with OpenMC | ||
if: ${{ matrix.os == 'ubuntu-latest'}} | ||
run: | | ||
python -m pytest -v tests/test_volumes.py | ||
python -m pytest -v tests/test_transport.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,174 @@ | ||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
wheels/ | ||
share/python-wheels/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
MANIFEST | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.nox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*.cover | ||
*.py,cover | ||
.hypothesis/ | ||
.pytest_cache/ | ||
cover/ | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
*.log | ||
local_settings.py | ||
db.sqlite3 | ||
db.sqlite3-journal | ||
|
||
# Flask stuff: | ||
instance/ | ||
.webassets-cache | ||
|
||
# Scrapy stuff: | ||
.scrapy | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
||
# PyBuilder | ||
.pybuilder/ | ||
target/ | ||
|
||
# Jupyter Notebook | ||
.ipynb_checkpoints | ||
|
||
# IPython | ||
profile_default/ | ||
ipython_config.py | ||
|
||
# pyenv | ||
# For a library or package, you might want to ignore these files since the code is | ||
# intended to run in multiple environments; otherwise, check them in: | ||
# .python-version | ||
|
||
# pipenv | ||
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. | ||
# However, in case of collaboration, if having platform-specific dependencies or dependencies | ||
# having no cross-platform support, pipenv may install dependencies that don't work, or not | ||
# install all needed dependencies. | ||
#Pipfile.lock | ||
|
||
# poetry | ||
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. | ||
# This is especially recommended for binary packages to ensure reproducibility, and is more | ||
# commonly ignored for libraries. | ||
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control | ||
#poetry.lock | ||
|
||
# pdm | ||
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. | ||
#pdm.lock | ||
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it | ||
# in version control. | ||
# https://pdm.fming.dev/#use-with-ide | ||
.pdm.toml | ||
|
||
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm | ||
__pypackages__/ | ||
|
||
# Celery stuff | ||
celerybeat-schedule | ||
celerybeat.pid | ||
|
||
# SageMath parsed files | ||
*.sage.py | ||
|
||
# Environments | ||
.env | ||
.venv | ||
env/ | ||
venv/ | ||
ENV/ | ||
env.bak/ | ||
venv.bak/ | ||
|
||
# Spyder project settings | ||
.spyderproject | ||
.spyproject | ||
|
||
# Rope project settings | ||
.ropeproject | ||
|
||
# mkdocs documentation | ||
/site | ||
|
||
# mypy | ||
.mypy_cache/ | ||
.dmypy.json | ||
dmypy.json | ||
|
||
# Pyre type checker | ||
.pyre/ | ||
|
||
# pytype static type analyzer | ||
.pytype/ | ||
|
||
# Cython debug symbols | ||
cython_debug/ | ||
|
||
# PyCharm | ||
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can | ||
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore | ||
# and can be added to the global gitignore or merged into this file. For a more nuclear | ||
# option (not recommended) you can uncomment the following to ignore the entire idea folder. | ||
#.idea/ | ||
|
||
# openmc output files | ||
*.h5 | ||
*.xml | ||
|
||
# testing folder | ||
tests_outputs/ | ||
|
||
.vscode | ||
**/__pycache__ | ||
.coverage | ||
htmlcov/* | ||
docs/source/_build/** | ||
docs/build/** | ||
docs/source/_autosummary/* | ||
docs/jupyter_execute | ||
.pytest_cache/** | ||
build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[project] | ||
name = "GEOUNED" | ||
version = "1.0.0" | ||
version = "1.0.1" | ||
authors = [ | ||
{ name="Juan-Pablo Catalan", email="[email protected]" }, | ||
{ name="Patrick Sauvan", email="[email protected]" }, | ||
|
@@ -22,6 +22,11 @@ classifiers = [ | |
] | ||
|
||
[project.urls] | ||
Homepage = "https://github.com/GEOUNED-code" | ||
Repository = "https://github.com/GEOUNED-code/GEOUNED" | ||
Documentation = "https://github.com/GEOUNED-code/GEOUNED/docs" | ||
Homepage = "https://github.com/GEOUNED-org" | ||
Repository = "https://github.com/GEOUNED-org/GEOUNED" | ||
Documentation = "https://github.com/GEOUNED-org/GEOUNED/docs" | ||
|
||
[project.optional-dependencies] | ||
tests = [ | ||
"pytest", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import re | ||
import sys | ||
|
||
sys.path.append('/usr/lib64/freecad/lib64/') | ||
import ImportGui | ||
|
||
bd = 255 | ||
gd = 255*255 | ||
rd = 255* 255* 255 | ||
matNumber=re.compile(r"Material_(?P<matnum>\d+)") | ||
|
||
def getColor(num,vmin=0,vmax=rd): | ||
colRange = rd | ||
dnum = vmax - vmin | ||
dx = num - vmin | ||
scale = colRange/dnum | ||
snum = dx * scale + 1 | ||
|
||
red = snum//gd | ||
r = snum - red * gd | ||
green = r // bd | ||
blue = r - green * bd | ||
return (red/255,green/255,blue/255) | ||
|
||
def setColorMaterial(documents): | ||
featureObj = [] | ||
matMin = 999999999 | ||
matMax = 0 | ||
for obj in documents.Objects: | ||
if obj.TypeId == 'Part::Feature' : | ||
for o in obj.InListRecursive: | ||
m = matNumber.search(o.Label) | ||
if m : | ||
mat = int(m.group('matnum')) | ||
matMin = min(matMin,mat) | ||
matMax = max(matMax,mat) | ||
featureObj.append((obj,mat)) | ||
|
||
for obj,mat in featureObj: | ||
obj.ViewObject.ShapeColor = getColor(mat,matMin,matMax) | ||
|
||
|
||
# color solids in a Freecad document with respect to the material number | ||
doc = App.ActiveDocument | ||
setColorMaterial(doc) | ||
name = doc.Label | ||
outname = name+'_color' | ||
ImportGui.export(doc.RootObjects,outname+'.stp') | ||
doc.saveAs(outname+'.FCStd') | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.