Skip to content

Commit

Permalink
Merge pull request #26 from fusion-energy/cadquery_pip
Browse files Browse the repository at this point in the history
pip install cadquery
  • Loading branch information
shimwell authored Apr 5, 2023
2 parents e2ca526 + 1504810 commit f316198
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 33 deletions.
17 changes: 6 additions & 11 deletions .github/workflows/ci_with_install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,19 @@ jobs:
image: continuumio/miniconda3:4.12.0
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3

- 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
conda install -c conda-forge moab
conda install -c conda-forge gmsh
conda install -c conda-forge python-gmsh
conda install -c cadquery -c conda-forge cadquery=master
apt-get install -y libpangocairo-1.0-0
conda install -c conda-forge -y moab
conda install -c conda-forge -y gmsh
conda install -c conda-forge -y python-gmsh
conda install -c conda-forge -y "openmc=0.13.3=dagmc*nompi*"
- name: install package
run: |
Expand Down Expand Up @@ -112,12 +113,6 @@ jobs:
cd examples
python single_stp_file.py
- name: install non pypi dependencies for neutronics
run: |
conda remove cadquery -y
conda install -c conda-forge mamba -y
mamba install -c conda-forge -y "openmc=0.13.1=dagmc*nompi*"
- name: Run simulation tests
run: |
pip install .[tests]
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/conda-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ on:
jobs:
build:
runs-on: ubuntu-latest
container: continuumio/miniconda3:4.10.3
container: continuumio/miniconda3:4.12.0

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Set up conda
run: |
Expand Down
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,11 @@ mamba install -c fusion-energy -c cadquery -c conda-forge cad_to_dagmc
# Install (Conda + pip)

You will need to install some dependencies that are not available via PyPi.
This example uses mamba but conda could also be used.
This example uses Conda but Mamba could also be used.
```bash
conda install -c conda-forge mamba
mamba install -c conda-forge moab
mamba install -c conda-forge gmsh
mamba install -c conda-forge python-gmsh
mamba install -c cadquery -c conda-forge cadquery=master
conda install -c conda-forge moab
conda install -c conda-forge gmsh
conda install -c conda-forge python-gmsh
```

Then you can install the cad_to_dagmc package with ```pip```
Expand Down
2 changes: 0 additions & 2 deletions conda/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
python:
- 3.9
- 3.8
cadquery:
- master
6 changes: 3 additions & 3 deletions conda/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ requirements:
- setuptools_scm>=6.3.1
run:
- python {{ python }}
- brep_part_finder>=0.5.0
- brep_to_h5m>=0.4.0 # which brings in moab
- cadquery {{ cadquery }}
- cadquery>=2.2.0
- brep_to_h5m>=0.4.2 # which brings in moab
- brep_part_finder>=0.5.2

test:
imports:
Expand Down
8 changes: 3 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,9 @@ classifiers = [
"Operating System :: OS Independent",
]
dependencies = [
"numpy>=1.21.1",
"vertices_to_h5m",
"scipy",
"brep_to_h5m",
"brep_part_finder",
"cadquery>=2.2.0",
"brep_to_h5m>=0.4.2",
"brep_part_finder>=0.5.2",
]
dynamic = ["version"]

Expand Down
11 changes: 7 additions & 4 deletions tests/test_h5m_in_simulation.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# import dagmc_h5m_file_inspector as di
import openmc
import openmc_data_downloader as odd
import openmc_data_downloader


"""
Expand All @@ -18,13 +18,16 @@ def transport_particles_on_h5m_geometry(
for material_tag in material_tags:
# simplified material definitions have been used to keen this example minimal
mat_dag_material_tag = openmc.Material(name=material_tag)
mat_dag_material_tag.add_element("H", 1, "ao")
mat_dag_material_tag.add_nuclide("H1", 1, "ao")
mat_dag_material_tag.set_density("g/cm3", 2)

materials.append(mat_dag_material_tag)

# downloads the nuclear data and sets the openmc_cross_sections environmental variable
odd.just_in_time_library_generator(libraries="ENDFB-7.1-NNDC", materials=materials)
materials.download_cross_section_data(
libraries=["ENDFB-7.1-NNDC"],
set_OPENMC_CROSS_SECTIONS=True,
particles=["neutron"],
)

# makes use of the dagmc geometry
dag_univ = openmc.DAGMCUniverse(h5m_filename)
Expand Down

0 comments on commit f316198

Please sign in to comment.