Document special and abstract methods for Integrators

This commit is contained in:
Andrew Johnson 2019-08-07 09:13:14 -05:00
parent 18c4d5f432
commit 5adc3b5816
No known key found for this signature in database
GPG key ID: 253418E91B7F6FEB
3 changed files with 25 additions and 3 deletions

View file

@ -0,0 +1,9 @@
{{ fullname }}
{{ underline }}
.. currentmodule:: {{ module }}
.. autoclass:: {{ objname }}
:members:
:inherited-members:
:special-members: __call__, __len__, __iter__

View file

@ -14,7 +14,7 @@ transport-depletion coupling algorithms <http://hdl.handle.net/1721.1/113721>`_.
.. autosummary::
:toctree: generated
:nosignatures:
:template: myclassinherit.rst
:template: myintegrator.rst
integrator.PredictorIntegrator
integrator.CECMIntegrator
@ -95,7 +95,18 @@ The following classes are abstract classes that can be used to extend the
EnergyHelper
TransportOperator
Each of the integrator functions also relies on a number of "helper" functions
Custom integrators can be developed by subclassing from the following abstract
base classes:
.. autosummary::
:toctree: generated
:nosignatures:
:template: myintegrator.rst
Integrator
SIIntegrator
Each of the integrator classes also relies on a number of "helper" functions
as follows:
.. autosummary::

View file

@ -118,9 +118,11 @@ class Integrator(ABC):
"""
def __iter__(self):
"""Return pairs of time steps in [s] and powers in [W]"""
return zip(self.timesteps, self.power)
def __len__(self):
"""Return integer number of depletion intervals"""
return len(self.timesteps)
def _get_bos_data_from_operator(self, step_index, step_power, bos_conc):
@ -180,7 +182,7 @@ class Integrator(ABC):
class SIIntegrator(Integrator):
"""Abstract for the Stochastic Implicit Euler integrators
"""Abstract class for the Stochastic Implicit Euler integrators
Does not provide a ``__call__`` method, but scales and resets
the number of particles used in initial transport calculation