diff --git a/.github/workflows/ci_with_install.yml b/.github/workflows/ci_with_install.yml index 374a9a5..9f56a05 100644 --- a/.github/workflows/ci_with_install.yml +++ b/.github/workflows/ci_with_install.yml @@ -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 @@ -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 diff --git a/tests/create_statepoint_file_for_testing_one_batch.py b/examples/create_statepoint_file_for_testing.py similarity index 90% rename from tests/create_statepoint_file_for_testing_one_batch.py rename to examples/create_statepoint_file_for_testing.py index 9b33533..664440a 100644 --- a/tests/create_statepoint_file_for_testing_one_batch.py +++ b/examples/create_statepoint_file_for_testing.py @@ -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 @@ -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]) @@ -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() diff --git a/openmc_post_processor/utils.py b/openmc_post_processor/utils.py index 49bfa6c..acb2427 100644 --- a/openmc_post_processor/utils.py +++ b/openmc_post_processor/utils.py @@ -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) diff --git a/requirements-test.txt b/requirements-test.txt index a771257..4ff88ad 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -2,3 +2,4 @@ openmc_data_downloader openmc_dagmc_wrapper openmc_plasma_source pytest-cov>=2.12.1 +spectrum_plotter diff --git a/tests/create_statepoint_file_for_testing.py b/tests/create_statepoint_file_for_testing.py index d28b2e2..664440a 100644 --- a/tests/create_statepoint_file_for_testing.py +++ b/tests/create_statepoint_file_for_testing.py @@ -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 @@ -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]) @@ -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()