From 5547ecf88f44524ff37fd5b26088a56d6a3eabce Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 10 Apr 2020 21:52:43 -0500 Subject: [PATCH] Add versionadded directive for new arguments/functions in 0.12 --- openmc/cell.py | 4 +++- openmc/data/library.py | 5 +++-- openmc/deplete/integrators.py | 16 ++++++++++++++++ openmc/deplete/nuclide.py | 2 ++ openmc/deplete/operator.py | 4 ++++ openmc/deplete/results_list.py | 5 ++++- openmc/element.py | 4 ++++ openmc/executor.py | 2 ++ openmc/filter.py | 2 ++ openmc/geometry.py | 6 +++++- openmc/material.py | 10 ++++++++++ openmc/mesh.py | 2 ++ openmc/model/model.py | 4 ++++ openmc/polynomial.py | 4 ++++ openmc/region.py | 6 ++++++ openmc/settings.py | 12 ++++++++++++ openmc/source.py | 2 ++ openmc/stats/multivariate.py | 4 ++++ openmc/surface.py | 10 ++++++++++ openmc/volume.py | 10 ++++++++-- 20 files changed, 107 insertions(+), 7 deletions(-) diff --git a/openmc/cell.py b/openmc/cell.py index a1709c516b..c55238df86 100644 --- a/openmc/cell.py +++ b/openmc/cell.py @@ -91,6 +91,8 @@ class Cell(IDManagerMixin): present in the cell, or in all of its instances for a 'distribmat' fill. For example, {'U235': 1.0e22, 'U238': 5.0e22, ...}. + .. versionadded:: 0.12 + """ next_id = 1 @@ -654,7 +656,7 @@ class Cell(IDManagerMixin): Returns ------- - Cell + openmc.Cell Cell instance """ diff --git a/openmc/data/library.py b/openmc/data/library.py index 3830334d23..a66260b929 100644 --- a/openmc/data/library.py +++ b/openmc/data/library.py @@ -31,8 +31,9 @@ class DataLibrary(EqualityMixin): name : str Name of material, e.g. 'Am241' data_type : str - Name of data type, e.g. 'neutron', 'photon', 'wmp', - or 'thermal' + Name of data type, e.g. 'neutron', 'photon', 'wmp', or 'thermal' + + .. versionadded:: 0.12 Returns ------- diff --git a/openmc/deplete/integrators.py b/openmc/deplete/integrators.py index 38a7c33b1f..ddb2130379 100644 --- a/openmc/deplete/integrators.py +++ b/openmc/deplete/integrators.py @@ -54,6 +54,8 @@ class PredictorIntegrator(Integrator): that the values are given in burnup (MW-d of energy deposited per kilogram of initial heavy metal). + .. versionadded:: 0.12 + Attributes ---------- operator : openmc.deplete.TransportOperator @@ -143,6 +145,8 @@ class CECMIntegrator(Integrator): that the values are given in burnup (MW-d of energy deposited per kilogram of initial heavy metal). + .. versionadded:: 0.12 + Attributes ---------- operator : openmc.deplete.TransportOperator @@ -240,6 +244,8 @@ class CF4Integrator(Integrator): that the values are given in burnup (MW-d of energy deposited per kilogram of initial heavy metal). + .. versionadded:: 0.12 + Attributes ---------- operator : openmc.deplete.TransportOperator @@ -354,6 +360,8 @@ class CELIIntegrator(Integrator): that the values are given in burnup (MW-d of energy deposited per kilogram of initial heavy metal). + .. versionadded:: 0.12 + Attributes ---------- operator : openmc.deplete.TransportOperator @@ -455,6 +463,8 @@ class EPCRK4Integrator(Integrator): that the values are given in burnup (MW-d of energy deposited per kilogram of initial heavy metal). + .. versionadded:: 0.12 + Attributes ---------- operator : openmc.deplete.TransportOperator @@ -576,6 +586,8 @@ class LEQIIntegrator(Integrator): that the values are given in burnup (MW-d of energy deposited per kilogram of initial heavy metal). + .. versionadded:: 0.12 + Attributes ---------- operator : openmc.deplete.TransportOperator @@ -693,6 +705,8 @@ class SICELIIntegrator(SIIntegrator): seconds, 'min' means minutes, 'h' means hours, and 'MWd/kg' indicates that the values are given in burnup (MW-d of energy deposited per kilogram of initial heavy metal). + + .. versionadded:: 0.12 n_steps : int, optional Number of stochastic iterations per depletion interval. Must be greater than zero. Default : 10 @@ -801,6 +815,8 @@ class SILEQIIntegrator(SIIntegrator): seconds, 'min' means minutes, 'h' means hours, and 'MWd/kg' indicates that the values are given in burnup (MW-d of energy deposited per kilogram of initial heavy metal). + + .. versionadded:: 0.12 n_steps : int, optional Number of stochastic iterations per depletion interval. Must be greater than zero. Default : 10 diff --git a/openmc/deplete/nuclide.py b/openmc/deplete/nuclide.py index 854a2abb07..06f217f222 100644 --- a/openmc/deplete/nuclide.py +++ b/openmc/deplete/nuclide.py @@ -470,6 +470,8 @@ class FissionYieldDistribution(Mapping): def restrict_products(self, possible_products): """Return a new distribution with select products + .. versionadded:: 0.12 + Parameters ---------- possible_products : iterable of str diff --git a/openmc/deplete/operator.py b/openmc/deplete/operator.py index c57d9b163c..7e7c2f9e1d 100644 --- a/openmc/deplete/operator.py +++ b/openmc/deplete/operator.py @@ -113,11 +113,15 @@ class Operator(TransportOperator): reduce_chain : bool, optional If True, use :meth:`openmc.deplete.Chain.reduce` to reduce the depletion chain up to ``reduce_chain_level``. Default is False. + + .. versionadded:: 0.12 reduce_chain_level : int, optional Depth of the search when reducing the depletion chain. Only used if ``reduce_chain`` evaluates to true. The default value of ``None`` implies no limit on the depth. + .. versionadded:: 0.12 + Attributes ---------- geometry : openmc.Geometry diff --git a/openmc/deplete/results_list.py b/openmc/deplete/results_list.py index db1f0ff9db..6267a0fccc 100644 --- a/openmc/deplete/results_list.py +++ b/openmc/deplete/results_list.py @@ -44,7 +44,6 @@ class ResultsList(list): """Get number of nuclides over time from a single material .. note:: - Initial values for some isotopes that do not appear in initial concentrations may be non-zero, depending on the value of :class:`openmc.deplete.Operator` ``dilute_initial``. @@ -59,10 +58,14 @@ class ResultsList(list): Nuclide name to evaluate nuc_units : {"atoms", "atom/b-cm", "atom/cm3"}, optional Units for the returned concentration. Default is ``"atoms"`` + + .. versionadded:: 0.12 time_units : {"s", "min", "h", "d"}, optional Units for the returned time array. Default is ``"s"`` to return the value in seconds. + .. versionadded:: 0.12 + Returns ------- time : numpy.ndarray diff --git a/openmc/element.py b/openmc/element.py index 1cf7cdf1fa..1a258715fe 100644 --- a/openmc/element.py +++ b/openmc/element.py @@ -59,9 +59,13 @@ class Element(str): enriched U. Default is None (natural composition). enrichment_target: str, optional Single nuclide name to enrich from a natural composition (e.g., 'O16') + + .. versionadded:: 0.12 enrichment_type: {'ao', 'wo'}, optional 'ao' for enrichment as atom percent and 'wo' for weight percent. Default is: 'ao' for two-isotope enrichment; 'wo' for U enrichment + + .. versionadded:: 0.12 cross_sections : str, optional Location of cross_sections.xml file. Default is None. diff --git a/openmc/executor.py b/openmc/executor.py index 55e16a711b..8d208795c7 100644 --- a/openmc/executor.py +++ b/openmc/executor.py @@ -184,6 +184,8 @@ def run(particles=None, threads=None, geometry_debug=False, event_based : bool, optional Turns on event-based parallelism, instead of default history-based + .. versionadded:: 0.12 + Raises ------ subprocess.CalledProcessError diff --git a/openmc/filter.py b/openmc/filter.py index 80827c6a45..f75770e267 100644 --- a/openmc/filter.py +++ b/openmc/filter.py @@ -530,6 +530,8 @@ class CellInstanceFilter(Filter): instances by default) and allows instances from different cells to be specified in a single filter. + .. versionadded:: 0.12 + Parameters ---------- bins : iterable of 2-tuples or numpy.ndarray diff --git a/openmc/geometry.py b/openmc/geometry.py index ac3da5368a..450f223b19 100644 --- a/openmc/geometry.py +++ b/openmc/geometry.py @@ -86,6 +86,8 @@ class Geometry: Whether or not to remove redundant surfaces from the geometry when exporting + .. versionadded:: 0.12 + """ # Find and remove redundant surfaces from the geometry if remove_surfs: @@ -389,7 +391,9 @@ class Geometry: return surfaces def get_redundant_surfaces(self): - """Return all of the topologically redundant surface ids + """Return all of the topologically redundant surface IDs + + .. versionadded:: 0.12 Returns ------- diff --git a/openmc/material.py b/openmc/material.py index 55d99d7232..92f5132c52 100644 --- a/openmc/material.py +++ b/openmc/material.py @@ -489,10 +489,14 @@ class Material(IDManagerMixin): Default is None (natural composition). enrichment_target: str, optional Single nuclide name to enrich from a natural composition (e.g., 'O16') + + .. versionadded:: 0.12 enrichment_type: {'ao', 'wo'}, optional 'ao' for enrichment as atom percent and 'wo' for weight percent. Default is: 'ao' for two-isotope enrichment; 'wo' for U enrichment + .. versionadded:: 0.12 + Notes ----- General enrichment procedure is allowed only for elements composed of @@ -561,6 +565,8 @@ class Material(IDManagerMixin): enrichment_target=None, enrichment_type=None): """Add a elements from a chemical formula to the material. + .. versionadded:: 0.12 + Parameters ---------- formula : str @@ -694,6 +700,8 @@ class Material(IDManagerMixin): def get_elements(self): """Returns all elements in the material + .. versionadded:: 0.12 + Returns ------- elements : list of str @@ -981,6 +989,8 @@ class Material(IDManagerMixin): def mix_materials(cls, materials, fracs, percent_type='ao', name=None): """Mix materials together based on atom, weight, or volume fractions + .. versionadded:: 0.12 + Parameters ---------- materials : Iterable of openmc.Material diff --git a/openmc/mesh.py b/openmc/mesh.py index d10ed1be87..86321df296 100644 --- a/openmc/mesh.py +++ b/openmc/mesh.py @@ -595,6 +595,8 @@ class RectilinearMesh(MeshBase): class UnstructuredMesh(MeshBase): """A 3D unstructured mesh + .. versionadded:: 0.12 + Parameters ---------- filename : str diff --git a/openmc/model/model.py b/openmc/model/model.py index 89dbfb3536..7d6acb281c 100644 --- a/openmc/model/model.py +++ b/openmc/model/model.py @@ -201,6 +201,10 @@ class Model: """Creates the XML files, runs OpenMC, and returns the path to the last statepoint file generated. + .. versionchanged:: 0.12 + Instead of returning the final k-effective value, this function now + returns the path to the final statepoint written. + Parameters ---------- **kwargs diff --git a/openmc/polynomial.py b/openmc/polynomial.py index c57b5fbdce..718fc668c5 100644 --- a/openmc/polynomial.py +++ b/openmc/polynomial.py @@ -42,6 +42,8 @@ class ZernikeRadial(Polynomial): The radial only Zernike polynomials are defined as in :class:`ZernikeRadialFilter`. + .. versionadded:: 0.12 + Parameters ---------- coef : Iterable of float @@ -85,6 +87,8 @@ class Zernike(Polynomial): The azimuthal Zernike polynomials are defined as in :class:`ZernikeFilter`. + .. versionadded:: 0.12 + Parameters ---------- coef : Iterable of float diff --git a/openmc/region.py b/openmc/region.py index 5016db651f..69273e5de9 100644 --- a/openmc/region.py +++ b/openmc/region.py @@ -64,6 +64,8 @@ class Region(ABC): def remove_redundant_surfaces(self, redundant_surfaces): """Recursively remove all redundant surfaces referenced by this region + .. versionadded:: 0.12 + Parameters ---------- redundant_surfaces : dict @@ -272,6 +274,8 @@ class Region(ABC): memo=None): r"""Rotate surface by angles provided or by applying matrix directly. + .. versionadded:: 0.12 + Parameters ---------- rotation : 3-tuple of float, or 3x3 iterable @@ -587,6 +591,8 @@ class Complement(Region): def remove_redundant_surfaces(self, redundant_surfaces): """Recursively remove all redundant surfaces referenced by this region + .. versionadded:: 0.12 + Parameters ---------- redundant_surfaces : dict diff --git a/openmc/settings.py b/openmc/settings.py index da7d52bb24..6774427554 100644 --- a/openmc/settings.py +++ b/openmc/settings.py @@ -49,6 +49,8 @@ class Settings: Indicate whether to scale the fission photon yield by (EGP + EGD)/EGP where EGP is the energy release of prompt photons and EGD is the energy release of delayed photons. + + .. versionadded:: 0.12 electron_treatment : {'led', 'ttb'} Whether to deposit all energy from electrons locally ('led') or create secondary bremsstrahlung photons ('ttb'). @@ -61,12 +63,18 @@ class Settings: event_based : bool Indicate whether to use event-based parallelism instead of the default history-based parallelism. + + .. versionadded:: 0.12 generations_per_batch : int Number of generations per batch max_lost_particles : int Maximum number of lost particles + + .. versionadded:: 0.12 rel_max_lost_particles : int Maximum number of lost particles, relative to the total number of particles + + .. versionadded:: 0.12 inactive : int Number of inactive batches keff_trigger : dict @@ -80,9 +88,13 @@ class Settings: material_cell_offsets : bool Generate an "offset table" for material cells by default. These tables are necessary when a particular instance of a cell needs to be tallied. + + .. versionadded:: 0.12 max_particles_in_flight : int Number of neutrons to run concurrently when using event-based parallelism. + + .. versionadded:: 0.12 max_order : None or int Maximum scattering order to apply globally when in multi-group mode. no_reduce : bool diff --git a/openmc/source.py b/openmc/source.py index a5e884cd5c..cc749c324f 100644 --- a/openmc/source.py +++ b/openmc/source.py @@ -22,6 +22,8 @@ class Source: Source file from which sites should be sampled library : str Path to a custom source library + + .. versionadded:: 0.12 strength : float Strength of the source particle : {'neutron', 'photon'} diff --git a/openmc/stats/multivariate.py b/openmc/stats/multivariate.py index 2b5f593536..664e760f71 100644 --- a/openmc/stats/multivariate.py +++ b/openmc/stats/multivariate.py @@ -378,6 +378,8 @@ class SphericalIndependent(Spatial): :math:`\theta`, and :math:`\phi` components are sampled independently from one another and centered on the coordinates (x0, y0, z0). + .. versionadded: 0.12 + Parameters ---------- r : openmc.stats.Univariate @@ -498,6 +500,8 @@ class CylindricalIndependent(Spatial): one another and in a reference frame whose origin is specified by the coordinates (x0, y0, z0). + .. versionadded:: 0.12 + Parameters ---------- r : openmc.stats.Univariate diff --git a/openmc/surface.py b/openmc/surface.py index 0b977b6d9b..d71e73788e 100644 --- a/openmc/surface.py +++ b/openmc/surface.py @@ -68,6 +68,8 @@ def _future_kwargs_warning_helper(cls, *args, **kwargs): def get_rotation_matrix(rotation, order='xyz'): r"""Generate a 3x3 rotation matrix from input angles + .. versionadded:: 0.12 + Parameters ---------- rotation : 3-tuple of float @@ -266,6 +268,8 @@ class Surface(IDManagerMixin, ABC): def normalize(self, coeffs=None): """Normalize coefficients by first nonzero value + .. versionadded:: 0.12 + Parameters ---------- coeffs : tuple, optional @@ -347,6 +351,8 @@ class Surface(IDManagerMixin, ABC): def rotate(self, rotation, pivot=(0., 0., 0.), order='xyz', inplace=False): r"""Rotate surface by angles provided or by applying matrix directly. + .. versionadded:: 0.12 + Parameters ---------- rotation : 3-tuple of float, or 3x3 iterable @@ -1223,6 +1229,8 @@ class Cylinder(QuadricMixin, Surface): def from_points(cls, p1, p2, r=1., **kwargs): """Return a cylinder given points that define the axis and a radius. + .. versionadded:: 0.12 + Parameters ---------- p1, p2 : 3-tuples @@ -2294,6 +2302,8 @@ class Halfspace(Region): memo=None): r"""Rotate surface by angles provided or by applying matrix directly. + .. versionadded:: 0.12 + Parameters ---------- rotation : 3-tuple of float, or 3x3 iterable diff --git a/openmc/volume.py b/openmc/volume.py index f7849ce0a0..65307a503e 100644 --- a/openmc/volume.py +++ b/openmc/volume.py @@ -45,8 +45,6 @@ class VolumeCalculation: Lower-left coordinates of bounding box used to sample points upper_right : Iterable of float Upper-right coordinates of bounding box used to sample points - threshold : float - Threshold for the maximum standard deviation of volume in the calculation atoms : dict Dictionary mapping unique IDs of domains to a mapping of nuclides to total number of atoms for each nuclide present in the domain. For @@ -58,11 +56,17 @@ class VolumeCalculation: Dictionary mapping unique IDs of domains to estimated volumes in cm^3. threshold : float Threshold for the maxmimum standard deviation of volumes. + + .. versionadded:: 0.12 trigger_type : {'variance', 'std_dev', 'rel_err'} Value type used to halt volume calculation + + .. versionadded:: 0.12 iterations : int Number of iterations over samples (for calculations with a trigger). + .. versionadded:: 0.12 + """ def __init__(self, domains, samples, lower_left=None, upper_right=None): self._atoms = {} @@ -225,6 +229,8 @@ class VolumeCalculation: def set_trigger(self, threshold, trigger_type): """Set a trigger on the voulme calculation + .. versionadded:: 0.12 + Parameters ---------- threshold : float