Rename integrator classes to be PEP8 complaint

Changes:
- EPC_RK4_Integrator -> EPCRK4Integrator
- SI_Integrator -> SIIntegrator
- SI_CELI_Integrator -> SICELIIntegrator
- SI_LEQI_Integrator -> SICELIIntegrator
This commit is contained in:
Andrew Johnson 2019-08-06 17:54:12 -05:00
parent a4905c03af
commit 1bd663daf6
No known key found for this signature in database
GPG key ID: 253418E91B7F6FEB
10 changed files with 30 additions and 32 deletions

View file

@ -20,10 +20,10 @@ transport-depletion coupling algorithms <http://hdl.handle.net/1721.1/113721>`_.
integrator.CF4Integrator
integrator.CECMIntegrator
integrator.CELIIntegrator
integrator.EPC_RK4_Integrator
integrator.EPCRK4Integrator
integrator.LEQIIntegrator
integrator.SI_CELI_Integrator
integrator.SI_LEQI_Integrator
integrator.SICELIIntegrator
integrator.SILEQIIntegrator
Each of these functions expects a "transport operator" to be passed. An operator
specific to OpenMC is available using the following class:

View file

@ -170,7 +170,7 @@ class Integrator(ABC):
self.operator.write_bos_data(len(self) + self._i_res)
class SI_Integrator(Integrator):
class SIIntegrator(Integrator):
"""Abstract for the Stochastic Implicit Euler integrators
Does not provide a ``__call__`` method, but scales and resets

View file

@ -4,7 +4,7 @@ from .cram import timed_deplete
from .abc import Integrator
class EPC_RK4_Integrator(Integrator):
class EPCRK4Integrator(Integrator):
r"""Deplete using the EPC-RK4 algorithm.
Implements an extended predictor-corrector algorithm with traditional

View file

@ -2,20 +2,20 @@
import copy
from .abc import SI_Integrator
from .abc import SIIntegrator
from .cram import timed_deplete
from .celi import _celi_f1, _celi_f2
from ..abc import OperatorResult
class SI_CELI_Integrator(SI_Integrator):
r"""Deplete using the si-ce/li cfq4 algorithm.
class SICELIIntegrator(SIIntegrator):
r"""Deplete using the SI-CE/LI CFQ4 algorithm.
Implements the stochastic implicit ce/li predictor-corrector algorithm
Implements the stochastic implicit CE/LI predictor-corrector algorithm
using the `fourth order commutator-free integrator
<https://doi.org/10.1137/05063042>`_.
detailed algorithm can be found in section 3.2 in `colin josey's thesis
Detailed algorithm can be found in section 3.2 in `colin josey's thesis
<http://hdl.handle.net/1721.1/113721>`_.
"""
_num_stages = 2

View file

@ -1,18 +1,16 @@
"""The SI-LE/QI CFQ4 integrator."""
import copy
from collections.abc import Iterable
from itertools import repeat
from .abc import SI_Integrator
from .si_celi import SI_CELI_Integrator
from .abc import SIIntegrator
from .si_celi import SICELIIntegrator
from .leqi import _leqi_f1, _leqi_f2, _leqi_f3, _leqi_f4
from .cram import timed_deplete
from ..results import Results
from ..abc import OperatorResult
class SI_LEQI_Integrator(SI_Integrator):
class SILEQIIntegrator(SIIntegrator):
r"""Deplete using the SI-LE/QI CFQ4 algorithm.
Implements the Stochastic Implicit LE/QI Predictor-Corrector algorithm using
@ -55,7 +53,7 @@ class SI_LEQI_Integrator(SI_Integrator):
if self._i_res < 1:
self._prev_rates = bos_rates
# Perform CELI for initial steps
return SI_CELI_Integrator.__call__(
return SICELIIntegrator.__call__(
self, bos_conc, bos_rates, dt, power, i)
prev_res = self.operator.prev_res[-2]
prev_dt = self.timesteps[i] - prev_res.time[0]

View file

@ -4,7 +4,7 @@ These tests integrate a simple test problem described in dummy_geometry.py.
"""
from pytest import approx
from openmc.deplete import EPC_RK4_Integrator, ResultsList
from openmc.deplete import EPCRK4Integrator, ResultsList
from tests import dummy_operator
@ -18,7 +18,7 @@ def test_epc_rk4(run_in_tmpdir):
# Perform simulation using the epc_rk4 algorithm
dt = [0.75, 0.75]
power = 1.0
EPC_RK4_Integrator(op, dt, power).integrate()
EPCRK4Integrator(op, dt, power).integrate()
# Load the files
res = ResultsList(op.output_dir / "depletion_results.h5")

View file

@ -16,7 +16,7 @@ import pytest
from openmc.deplete import (
ReactionRates, Results, ResultsList, comm, OperatorResult,
PredictorIntegrator, SI_CELI_Integrator)
PredictorIntegrator, SICELIIntegrator)
def test_results_save(run_in_tmpdir):
@ -126,7 +126,7 @@ def test_bad_integrator_inputs(timesteps):
# SI integrator with bad steps
with pytest.raises(TypeError, match="n_steps"):
SI_CELI_Integrator(op, timesteps, [1], n_steps=2.5)
SICELIIntegrator(op, timesteps, [1], n_steps=2.5)
with pytest.raises(ValueError, match="n_steps"):
SI_CELI_Integrator(op, timesteps, [1], n_steps=0)
SICELIIntegrator(op, timesteps, [1], n_steps=0)

View file

@ -8,7 +8,7 @@ from pytest import approx, raises
import openmc.deplete
from openmc.deplete import (
CECMIntegrator, PredictorIntegrator, CELIIntegrator, LEQIIntegrator,
EPC_RK4_Integrator, CF4Integrator, SI_CELI_Integrator, SI_LEQI_Integrator
EPCRK4Integrator, CF4Integrator, SICELIIntegrator, SILEQIIntegrator
)
from tests import dummy_operator
@ -192,7 +192,7 @@ def test_restart_epc_rk4(run_in_tmpdir):
# Perform simulation
dt = [0.75]
power = 1.0
EPC_RK4_Integrator(op, dt, power).integrate()
EPCRK4Integrator(op, dt, power).integrate()
# Load the files
prev_res = openmc.deplete.ResultsList(op.output_dir / "depletion_results.h5")
@ -202,7 +202,7 @@ def test_restart_epc_rk4(run_in_tmpdir):
op.output_dir = output_dir
# Perform restarts simulation
EPC_RK4_Integrator(op, dt, power).integrate()
EPCRK4Integrator(op, dt, power).integrate()
# Load the files
res = openmc.deplete.ResultsList(op.output_dir / "depletion_results.h5")
@ -308,7 +308,7 @@ def test_restart_si_celi(run_in_tmpdir):
# Perform simulation
dt = [0.75]
power = 1.0
SI_CELI_Integrator(op, dt, power).integrate()
SICELIIntegrator(op, dt, power).integrate()
# Load the files
prev_res = openmc.deplete.ResultsList(op.output_dir / "depletion_results.h5")
@ -318,7 +318,7 @@ def test_restart_si_celi(run_in_tmpdir):
op.output_dir = output_dir
# Perform restarts simulation
SI_CELI_Integrator(op, dt, power).integrate()
SICELIIntegrator(op, dt, power).integrate()
# Load the files
res = openmc.deplete.ResultsList(op.output_dir / "depletion_results.h5")
@ -348,7 +348,7 @@ def test_restart_si_leqi(run_in_tmpdir):
dt = [0.75]
power = 1.0
nstages = 10
SI_LEQI_Integrator(op, dt, power, nstages).integrate()
SILEQIIntegrator(op, dt, power, nstages).integrate()
# Load the files
prev_res = openmc.deplete.ResultsList(op.output_dir / "depletion_results.h5")
@ -358,7 +358,7 @@ def test_restart_si_leqi(run_in_tmpdir):
op.output_dir = output_dir
# Perform restarts simulation
SI_LEQI_Integrator(op, dt, power, nstages).integrate()
SILEQIIntegrator(op, dt, power, nstages).integrate()
# Load the files
res = openmc.deplete.ResultsList(op.output_dir / "depletion_results.h5")

View file

@ -4,7 +4,7 @@ These tests integrate a simple test problem described in dummy_geometry.py.
"""
from pytest import approx
from openmc.deplete import SI_CELI_Integrator, ResultsList
from openmc.deplete import SICELIIntegrator, ResultsList
from tests import dummy_operator
@ -18,7 +18,7 @@ def test_si_celi(run_in_tmpdir):
# Perform simulation using the si_celi algorithm
dt = [0.75, 0.75]
power = 1.0
SI_CELI_Integrator(op, dt, power).integrate()
SICELIIntegrator(op, dt, power).integrate()
# Load the files
res = ResultsList(op.output_dir / "depletion_results.h5")

View file

@ -4,7 +4,7 @@ These tests integrate a simple test problem described in dummy_geometry.py.
"""
from pytest import approx
from openmc.deplete import SI_LEQI_Integrator, ResultsList
from openmc.deplete import SILEQIIntegrator, ResultsList
from tests import dummy_operator
@ -18,7 +18,7 @@ def test_si_leqi(run_in_tmpdir):
# Perform simulation using the si_leqi algorithm
dt = [0.75, 0.75]
power = 1.0
SI_LEQI_Integrator(op, dt, power, 10).integrate()
SILEQIIntegrator(op, dt, power, 10).integrate()
# Load the files
res = ResultsList(op.output_dir / "depletion_results.h5")