Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Style changes to test file
  • Loading branch information
pshriwise committed Mar 5, 2025
commit 384e99ca8b253ce73564ab062ad2f0ca6dd601c5
16 changes: 4 additions & 12 deletions tests/unit_tests/test_deplete_continue.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Unit tests for openmc.deplete continue run capability.

These tests run in two steps: first a normal run and then a continue run based on the prev_results
These tests run in two steps: first a normal run and then a continue run using the previous results
"""

import pytest
Expand All @@ -9,14 +9,12 @@

from tests import dummy_operator


@pytest.mark.parametrize("scheme", dummy_operator.SCHEMES)
def test_continue(run_in_tmpdir, scheme):
"""Test to ensure that a properly defined continue run works"""

# set up the problem

bundle = dummy_operator.SCHEMES[scheme]

operator = dummy_operator.DummyOperator()

# initial depletion
Expand All @@ -29,26 +27,23 @@ def test_continue(run_in_tmpdir, scheme):
# if continue run happens, test passes
bundle.solver(operator, [1.0, 2.0, 3.0, 4.0], [1.0, 2.0, 3.0, 4.0], continue_timesteps=True).integrate()


@pytest.mark.parametrize("scheme", dummy_operator.SCHEMES)
def test_continue_for_null_previous(run_in_tmpdir, scheme):
"""Test to ensure that a continue run works even if there are no previous results"""
# set up the problem

bundle = dummy_operator.SCHEMES[scheme]

operator = dummy_operator.DummyOperator()

# initial depletion
bundle.solver(operator, [1.0, 2.0], [1.0, 2.0], continue_timesteps=True).integrate()


@pytest.mark.parametrize("scheme", dummy_operator.SCHEMES)
def test_mismatched_initial_times(run_in_tmpdir, scheme):
"""Test to ensure that a continue run with different initial steps is properly caught"""

# set up the problem

bundle = dummy_operator.SCHEMES[scheme]

operator = dummy_operator.DummyOperator()

# perform initial steps
Expand All @@ -72,11 +67,8 @@ def test_mismatched_initial_times(run_in_tmpdir, scheme):
@pytest.mark.parametrize("scheme", dummy_operator.SCHEMES)
def test_mismatched_initial_source_rates(run_in_tmpdir, scheme):
"""Test to ensure that a continue run with different initial steps is properly caught"""

# set up the problem

bundle = dummy_operator.SCHEMES[scheme]

operator = dummy_operator.DummyOperator()

# perform initial steps
Expand Down