Skip to content

Commit

Permalink
Merge pull request #26 from fusion-energy/develop
Browse files Browse the repository at this point in the history
added specific version of h5py to CI
  • Loading branch information
shimwell authored Nov 2, 2021
2 parents 57e8a36 + 9f39c03 commit 410dd27
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 11 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/ci_with_install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ jobs:

- name: install package
run: |
conda install -c conda-forge h5py=3.2.1
conda install -c conda-forge moab
conda install -c conda-forge openmc
python setup.py install
Expand All @@ -36,13 +38,14 @@ jobs:
- name: Run test_utils
run: |
python tests/create_statepoint_file_for_testing.py
python tests/create_statepoint_file_for_testing_one_batch.py
python tests/create_statepoint_file_for_testing.py --batches 2 --particles 100
python tests/create_statepoint_file_for_testing.py --batches 1 --particles 100
pytest tests/ -v --cov=openmc_post_processor --cov-append --cov-report term --cov-report xml
- name: Run examples
run: |
cd examples
python create_statepoint_file_for_testing.py --batches 2 --particles 100
python processing_2d_mesh_effective_dose_tally.py
python processing_cell_damage-energy_tally.py
python processing_cell_effective_dose_tally.py
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,15 @@
import openmc_dagmc_wrapper as odw
import openmc_plasma_source as ops
import openmc_data_downloader as odd
import argparse

parser = argparse.ArgumentParser()

parser.add_argument("-b", "--batches", type=int, default=2, help="number of batches")
parser.add_argument(
"-p", "--particles", type=int, default=1000000, help="number of particles"
)
args = parser.parse_args()

# MATERIALS
breeder_material = openmc.Material(1, "PbLi") # Pb84.2Li15.8
Expand All @@ -22,7 +30,7 @@

iron = openmc.Material(name="iron")
iron.set_density("g/cm3", 7.75)
iron.add_element("Fe", 0.95, percent_type="wo")
iron.add_element("Pb", 0.95, percent_type="wo")

materials = openmc.Materials([breeder_material, iron])

Expand Down Expand Up @@ -158,9 +166,10 @@
]
)


settings = odw.FusionSettings()
settings.batches = 1
settings.particles = 1000000
settings.batches = args.batches
settings.particles = args.particles
# assigns a ring source of DT energy neutrons to the source using the
# openmc_plasma_source package
settings.source = ops.FusionPointSource()
Expand Down
5 changes: 2 additions & 3 deletions openmc_post_processor/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,8 @@ def process_tally(
"EnergyFunctionFilter are not known to OpenMC. Therefore "
"the units of this tally can not be found. If you have "
"applied dose coefficients to an EnergyFunctionFilter "
"the units of these are known and yo can use the "
"get_tally_units_dose function instead of the "
"get_tally_units"
"the units of these are known and you can use the "
"process_dose_tally function instead of the process_tally"
)
raise ValueError(msg)

Expand Down
1 change: 1 addition & 0 deletions requirements-test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ openmc_data_downloader
openmc_dagmc_wrapper
openmc_plasma_source
pytest-cov>=2.12.1
spectrum_plotter
14 changes: 11 additions & 3 deletions tests/create_statepoint_file_for_testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,15 @@
import openmc_dagmc_wrapper as odw
import openmc_plasma_source as ops
import openmc_data_downloader as odd
import argparse

parser = argparse.ArgumentParser()

parser.add_argument("-b", "--batches", type=int, default=2, help="number of batches")
parser.add_argument(
"-p", "--particles", type=int, default=1000000, help="number of particles"
)
args = parser.parse_args()

# MATERIALS
breeder_material = openmc.Material(1, "PbLi") # Pb84.2Li15.8
Expand All @@ -22,7 +30,7 @@

iron = openmc.Material(name="iron")
iron.set_density("g/cm3", 7.75)
iron.add_element("Fe", 0.95, percent_type="wo")
iron.add_element("Pb", 0.95, percent_type="wo")

materials = openmc.Materials([breeder_material, iron])

Expand Down Expand Up @@ -160,8 +168,8 @@


settings = odw.FusionSettings()
settings.batches = 2
settings.particles = 1000000
settings.batches = args.batches
settings.particles = args.particles
# assigns a ring source of DT energy neutrons to the source using the
# openmc_plasma_source package
settings.source = ops.FusionPointSource()
Expand Down

0 comments on commit 410dd27

Please sign in to comment.