From 64b35afdc2d377503cd6a273cc0809f3e5a13491 Mon Sep 17 00:00:00 2001 From: Jonathan Shimwell Date: Thu, 18 Jan 2024 13:07:27 +0000 Subject: [PATCH 1/2] added missing funcs and classes --- docs/source/pythonapi/capi.rst | 59 ++++++++++++++++++++++++++++++++-- 1 file changed, 56 insertions(+), 3 deletions(-) diff --git a/docs/source/pythonapi/capi.rst b/docs/source/pythonapi/capi.rst index ef713801ccc..8e704749a5a 100644 --- a/docs/source/pythonapi/capi.rst +++ b/docs/source/pythonapi/capi.rst @@ -12,11 +12,19 @@ Functions :nosignatures: :template: myfunction.rst + broaden_wmp_polynomials + calc_pn + calc_rn + calc_zn_rad calculate_volumes + cell + cells current_batch + evaluate_legendre export_properties export_weight_windows - import_weight_windows + filter + filters finalize find_cell find_material @@ -25,25 +33,42 @@ Functions hard_reset id_map import_properties + import_weight_windows init + is_initialized is_statepoint_batch iter_batches keff load_nuclide master + material + materials + maxwell_spectrum + mesh + meshes next_batch + normal_variate + nuclide + nuclides num_realizations + plot plot_geometry property_map reset reset_timers + rotate_angle run run_in_memory sample_external_source - simulation_init + settings simulation_finalize + simulation_init source_bank statepoint_write + tallies + tally + watt_spectrum + weight_windows Classes ------- @@ -53,15 +78,43 @@ Classes :nosignatures: :template: myclass.rst + AzimuthalFilter + CDLL Cell + CellFilter + CellInstanceFilter + CellbornFilter + CellfromFilter + CollisionFilter CylindricalMesh + DelayedGroupFilter + DistribcellFilter EnergyFilter - MaterialFilter + EnergyFunctionFilter + EnergyoutFilter + Filter + LegendreFilter Material + MaterialFilter + MaterialFromFilter MeshFilter MeshSurfaceFilter + MuFilter Nuclide + POINTER + ParticleFilter + PathLike + PolarFilter RectilinearMesh RegularMesh + SpatialLegendreFilter + SphericalHarmonicsFilter SphericalMesh + Structure + SurfaceFilter Tally + UniverseFilter + UnstructuredMesh + WeightWindows + ZernikeFilter + ZernikeRadialFilter \ No newline at end of file From 8f740fdb9e279d94d087ec82e6a1997da95231b1 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Sun, 7 Apr 2024 17:21:45 +0200 Subject: [PATCH 2/2] Clean up listings in capi.rst --- docs/source/pythonapi/capi.rst | 77 +++++++++++++++++++++------------- openmc/arithmetic.py | 12 +++--- openmc/lib/mesh.py | 6 ++- 3 files changed, 58 insertions(+), 37 deletions(-) diff --git a/docs/source/pythonapi/capi.rst b/docs/source/pythonapi/capi.rst index 8e704749a5a..95b37061013 100644 --- a/docs/source/pythonapi/capi.rst +++ b/docs/source/pythonapi/capi.rst @@ -12,19 +12,10 @@ Functions :nosignatures: :template: myfunction.rst - broaden_wmp_polynomials - calc_pn - calc_rn - calc_zn_rad calculate_volumes - cell - cells current_batch - evaluate_legendre export_properties export_weight_windows - filter - filters finalize find_cell find_material @@ -35,40 +26,24 @@ Functions import_properties import_weight_windows init - is_initialized is_statepoint_batch iter_batches keff load_nuclide master - material - materials - maxwell_spectrum - mesh - meshes next_batch - normal_variate - nuclide - nuclides num_realizations - plot plot_geometry property_map reset reset_timers - rotate_angle run run_in_memory sample_external_source - settings simulation_finalize simulation_init source_bank statepoint_write - tallies - tally - watt_spectrum - weight_windows Classes ------- @@ -79,7 +54,6 @@ Classes :template: myclass.rst AzimuthalFilter - CDLL Cell CellFilter CellInstanceFilter @@ -97,24 +71,67 @@ Classes Material MaterialFilter MaterialFromFilter + Mesh MeshFilter MeshSurfaceFilter MuFilter Nuclide - POINTER ParticleFilter - PathLike PolarFilter RectilinearMesh RegularMesh SpatialLegendreFilter SphericalHarmonicsFilter SphericalMesh - Structure SurfaceFilter Tally UniverseFilter UnstructuredMesh WeightWindows ZernikeFilter - ZernikeRadialFilter \ No newline at end of file + ZernikeRadialFilter + +Data +---- + +.. data:: cells + + Mapping of cell ID to :class:`openmc.lib.Cell` instances. + + :type: dict + +.. data:: filters + + Mapping of filter ID to :class:`openmc.lib.Filter` instances. + + :type: dict + +.. data:: materials + + Mapping of material ID to :class:`openmc.lib.Material` instances. + + :type: dict + +.. data:: meshes + + Mapping of mesh ID to :class:`openmc.lib.Mesh` instances. + + :type: dict + +.. data:: nuclides + + Mapping of nuclide name to :class:`openmc.lib.Nuclide` instances. + + :type: dict + +.. data:: tallies + + Mapping of tally ID to :class:`openmc.lib.Tally` instances. + + :type: dict + +.. data:: weight_windows + + Mapping of weight window ID to :class:`openmc.lib.WeightWindows` instances. + + :type: dict diff --git a/openmc/arithmetic.py b/openmc/arithmetic.py index 5ca7cc66682..c66efe5b81b 100644 --- a/openmc/arithmetic.py +++ b/openmc/arithmetic.py @@ -188,9 +188,9 @@ class CrossFilter: Parameters ---------- - left_filter : Filter or CrossFilter + left_filter : openmc.Filter or CrossFilter The left filter in the outer product - right_filter : Filter or CrossFilter + right_filter : openmc.Filter or CrossFilter The right filter in the outer product binary_op : str The tally arithmetic binary operator (e.g., '+', '-', etc.) used to @@ -200,9 +200,9 @@ class CrossFilter: ---------- type : str The type of the crossfilter (e.g., 'energy / energy') - left_filter : Filter or CrossFilter + left_filter : openmc.Filter or CrossFilter The left filter in the outer product - right_filter : Filter or CrossFilter + right_filter : openmc.Filter or CrossFilter The right filter in the outer product binary_op : str The tally arithmetic binary operator (e.g., '+', '-', etc.) used to @@ -517,7 +517,7 @@ class AggregateFilter: Parameters ---------- - aggregate_filter : Filter or CrossFilter + aggregate_filter : openmc.Filter or CrossFilter The filter included in the aggregation bins : Iterable of tuple The filter bins included in the aggregation @@ -529,7 +529,7 @@ class AggregateFilter: ---------- type : str The type of the aggregatefilter (e.g., 'sum(energy)', 'sum(cell)') - aggregate_filter : filter + aggregate_filter : openmc.Filter The filter included in the aggregation aggregate_op : str The tally aggregation operator (e.g., 'sum', 'avg', etc.) used diff --git a/openmc/lib/mesh.py b/openmc/lib/mesh.py index 72d61cc6650..783999d066e 100644 --- a/openmc/lib/mesh.py +++ b/openmc/lib/mesh.py @@ -11,7 +11,10 @@ from .core import _FortranObjectWithID from .error import _error_handler -__all__ = ['RegularMesh', 'RectilinearMesh', 'CylindricalMesh', 'SphericalMesh', 'UnstructuredMesh', 'meshes'] +__all__ = [ + 'Mesh', 'RegularMesh', 'RectilinearMesh', 'CylindricalMesh', + 'SphericalMesh', 'UnstructuredMesh', 'meshes' +] # Mesh functions _dll.openmc_extend_meshes.argtypes = [c_int32, c_char_p, POINTER(c_int32), @@ -405,6 +408,7 @@ def set_grid(self, r_grid, phi_grid, z_grid): _dll.openmc_cylindrical_mesh_set_grid(self._index, r_grid, nr, phi_grid, nphi, z_grid, nz) + class SphericalMesh(Mesh): """SphericalMesh stored internally.