Skip to content

Commit

Permalink
Merge pull request #49 from fusion-energy/tidy_up
Browse files Browse the repository at this point in the history
removed unused functions
  • Loading branch information
shimwell authored Dec 17, 2023
2 parents 0525832 + 9948913 commit 643eb53
Show file tree
Hide file tree
Showing 20 changed files with 435 additions and 646 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/black.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
pip install black
- name: Run black
run: |
black .
black --line-length 100 .
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "[skip ci] Apply formatting changes"
44 changes: 19 additions & 25 deletions .github/workflows/ci_with_benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,36 +19,30 @@ on:
jobs:
testing:
runs-on: ubuntu-latest
container:
image: continuumio/miniconda3:23.3.1-0
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: install non pypi dependencies for cad creation
run: |
apt-get --allow-releaseinfo-change update
apt-get update -y
apt-get upgrade -y
apt-get install -y libgl1-mesa-glx libgl1-mesa-dev libglu1-mesa-dev freeglut3-dev libosmesa6 libosmesa6-dev libgles2-mesa-dev libarchive-dev libpangocairo-1.0-0
conda install -y -c conda-forge mamba
mamba install -c conda-forge -c cadquery ocp
mamba install -y -c cadquery -c conda-forge moab gmsh python-gmsh cadquery=master
- name: install package
run: |
pip install --upgrade pip
pip install .[tests]
python -c "import cad_to_dagmc"
mamba install -c conda-forge openmc -y
pip install cad_to_dagmc openmc_data_downloader
openmc_data_downloader -l ENDFB-7.1-NNDC -i Fe56 Be9
- name: run benchmarks
env:
OPENMC_CROSS_SECTIONS: /__w/cad_to_dagmc/cad_to_dagmc/cross_sections.xml
OPENMC_CROSS_SECTIONS: /home/runner/work/cad_to_dagmc/cad_to_dagmc/cross_sections.xml
shell: bash
run: |
wget -O Miniforge3.sh "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh"
bash Miniforge3.sh -b -p "${HOME}/conda"
source "${HOME}/conda/etc/profile.d/conda.sh"
source "${HOME}/conda/etc/profile.d/mamba.sh"
sudo apt-get --allow-releaseinfo-change update
sudo apt-get update -y
sudo apt-get upgrade -y
sudo apt-get install -y libgl1-mesa-glx libgl1-mesa-dev libglu1-mesa-dev freeglut3-dev libosmesa6 libosmesa6-dev libgles2-mesa-dev libarchive-dev libpangocairo-1.0-0
mamba activate
mamba install -y -c cadquery -c conda-forge moab gmsh python-gmsh cadquery=master "openmc=0.13.3=dagmc*nompi*"
mamba install -y -c conda-forge "openmc=0.13.3=dagmc*nompi*"
python -m pip install --upgrade pip
python -m pip install cad_to_dagmc openmc_data_downloader
openmc_data_downloader -l ENDFB-7.1-NNDC -i Fe56 Be9
git clone https://github.com/fusion-energy/model_benchmark_zoo.git
cd model_benchmark_zoo
pip install .
pytest tests
python -m pip install .[tests]
pytest tests/test_cad_to_dagmc -v
87 changes: 18 additions & 69 deletions .github/workflows/ci_with_install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,91 +24,40 @@ on:
jobs:
testing:
runs-on: ubuntu-latest
container:
image: continuumio/miniconda3:23.3.1-0
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

# - uses: conda-incubator/setup-miniconda@v2

- name: install non pypi dependencies for cad creation
run: |
apt-get --allow-releaseinfo-change update
apt-get update -y
apt-get upgrade -y
apt-get install -y libgl1-mesa-glx libgl1-mesa-dev libglu1-mesa-dev freeglut3-dev libosmesa6 libosmesa6-dev libgles2-mesa-dev libarchive-dev libpangocairo-1.0-0
conda install -y -c conda-forge mamba
mamba install -c conda-forge -c cadquery ocp
- name: install non pypi dependencies
shell: bash
run: |
wget -O Miniforge3.sh "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh"
bash Miniforge3.sh -b -p "${HOME}/conda"
source "${HOME}/conda/etc/profile.d/conda.sh"
source "${HOME}/conda/etc/profile.d/mamba.sh"
sudo apt-get --allow-releaseinfo-change update
sudo apt-get update -y
sudo apt-get upgrade -y
sudo apt-get install -y libgl1-mesa-glx libgl1-mesa-dev libglu1-mesa-dev freeglut3-dev libosmesa6 libosmesa6-dev libgles2-mesa-dev libarchive-dev libpangocairo-1.0-0
mamba activate
mamba install -y -c cadquery -c conda-forge moab gmsh python-gmsh cadquery=master
- name: install package
run: |
pip install --upgrade pip
pip install .
python -m pip install --upgrade pip
python -m pip install .
python -c "import cad_to_dagmc"
mamba install -c conda-forge openmc -y
- name: run examples
run: |
mamba install -y -c conda-forge "openmc=0.13.3=dagmc*nompi*"
python -m pip install .[tests]
pytest tests -v
cd examples
python create_stp_files_for_examples.py
- name: run examples
run: |
cd examples
python cadquery_assembly.py
- name: run examples
run: |
cd examples
python cadquery_compound.py
- name: run examples
run: |
cd examples
python cadquery_object_and_stp_file.py
- name: run examples
run: |
cd examples
python cadquery_text.py
- name: run examples 1
run: |
cd examples
python curved_cadquery_object.py
- name: run examples 2
run: |
cd examples
python multiple_cadquery_objects.py
- name: run examples 3
run: |
cd examples
python multiple_stp_files.py
- name: run examples 4
run: |
cd examples
python single_stp_file_multiple_volumes.py
- name: run examples 5
run: |
cd examples
- name: run examples 6
run: |
cd examples
python single_cadquery_object.py
- name: run examples 7
run: |
cd examples
python single_stp_file.py
- name: Run pytest
run: |
pip install .[tests]
pytest tests -v
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,4 @@ dmypy.json
*.vtk
*.stp
src/_version.py
*.msh
7 changes: 1 addition & 6 deletions examples/cadquery_compound.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,7 @@
cq_shape_1 = r.extrude(-1)

s2 = cq.Workplane("XY")
r2 = (
s2.lineTo(3.0, 0)
.lineTo(3.0, 1.0)
.spline(spline_points, includeCurrent=True)
.close()
)
r2 = s2.lineTo(3.0, 0).lineTo(3.0, 1.0).spline(spline_points, includeCurrent=True).close()
cq_shape_2 = r2.extrude(1)


Expand Down
4 changes: 1 addition & 3 deletions examples/cadquery_object_and_stp_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,5 @@

my_model = CadToDagmc()
my_model.add_cadquery_object(object=result, material_tags=["mat1"])
my_model.add_stp_file(
filename="single_cube.stp", material_tags=["mat2"], scale_factor=0.1
)
my_model.add_stp_file(filename="single_cube.stp", material_tags=["mat2"], scale_factor=0.1)
my_model.export_dagmc_h5m_file(max_mesh_size=0.2, min_mesh_size=0.1)
4 changes: 1 addition & 3 deletions examples/cadquery_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,4 @@
], # 5 volumes one for each letter
)

my_model.export_dagmc_h5m_file(
filename="cadquery_text.h5m", max_mesh_size=0.2, min_mesh_size=0.1
)
my_model.export_dagmc_h5m_file(filename="cadquery_text.h5m", max_mesh_size=0.2, min_mesh_size=0.1)
7 changes: 1 addition & 6 deletions examples/create_stp_files_for_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,7 @@
(0.5, 1.0),
(0, 1.0),
]
r = (
result.lineTo(3.0, 0)
.lineTo(3.0, 1.0)
.spline(spline_points, includeCurrent=True)
.close()
)
r = result.lineTo(3.0, 0).lineTo(3.0, 1.0).spline(spline_points, includeCurrent=True).close()
result = r.extrude(1.5)
assembly = Assembly()
assembly.add(result)
Expand Down
4 changes: 1 addition & 3 deletions examples/single_stp_file_multiple_volumes.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,5 @@

my_model = CadToDagmc()
# the d and c from the word dagmc would be tagged with one material and the agm are tagged with another material
my_model.add_stp_file(
"text_dagmc.stp", material_tags=["mat1", "mat2", "mat2", "mat2", "mat1"]
)
my_model.add_stp_file("text_dagmc.stp", material_tags=["mat1", "mat2", "mat2", "mat2", "mat1"])
my_model.export_dagmc_h5m_file()
7 changes: 1 addition & 6 deletions src/cad_to_dagmc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,4 @@

__all__ = ["__version__"]

from .core import CadToDagmc
from .vertices_to_h5m import vertices_to_h5m
from .brep_part_finder import *
from .brep_to_h5m import *

[CadToDagmc, vertices_to_h5m]
from .core import *
36 changes: 0 additions & 36 deletions src/cad_to_dagmc/brep_part_finder.py

This file was deleted.

Loading

0 comments on commit 643eb53

Please sign in to comment.