Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added missing functions and classes to openmc.lib docs #2847

Merged
merged 2 commits into from
Apr 7, 2024

Conversation

shimwell
Copy link
Member

@shimwell shimwell commented Jan 18, 2024

Description

When trying to help with this forum post I spotted a few functions and classes that were not in the readthedocs webpage or rst doc file for openmc.lib so I thought they could be added.

To get the complete list I ran python in -i mode and used tab to auto complete. Here is the list for interest. I didn't include everything from this list as it contains things like c_char which I guess is not openmc specifc.

I also reordered a few that were not quite in alphabetical order

openmc.lib.
Display all 125 possibilities? (y or n)
openmc.lib.AzimuthalFilter(           openmc.lib.c_bool(                    openmc.lib.keff(
openmc.lib.CDLL(                      openmc.lib.c_char(                    openmc.lib.load_nuclide(
openmc.lib.Cell(                      openmc.lib.c_char_p(                  openmc.lib.master(
openmc.lib.CellFilter(                openmc.lib.c_double(                  openmc.lib.material
openmc.lib.CellInstanceFilter(        openmc.lib.c_int(                     openmc.lib.materials
openmc.lib.CellbornFilter(            openmc.lib.c_int32(                   openmc.lib.math
openmc.lib.CellfromFilter(            openmc.lib.c_int64(                   openmc.lib.maxwell_spectrum(
openmc.lib.CollisionFilter(           openmc.lib.c_size_t(                  openmc.lib.mesh
openmc.lib.CylindricalMesh(           openmc.lib.c_uint64(                  openmc.lib.meshes
openmc.lib.DelayedGroupFilter(        openmc.lib.c_void_p(                  openmc.lib.ndpointer(
openmc.lib.DistribcellFilter(         openmc.lib.calc_pn(                   openmc.lib.next_batch(
openmc.lib.EnergyFilter(              openmc.lib.calc_rn(                   openmc.lib.normal_variate(
openmc.lib.EnergyFunctionFilter(      openmc.lib.calc_zn(                   openmc.lib.np
openmc.lib.EnergyoutFilter(           openmc.lib.calc_zn_rad(               openmc.lib.nuclide
openmc.lib.Filter(                    openmc.lib.calculate_volumes(         openmc.lib.nuclides
openmc.lib.LegendreFilter(            openmc.lib.cell                       openmc.lib.num_realizations(
openmc.lib.Material(                  openmc.lib.cells                      openmc.lib.openmc
openmc.lib.MaterialFilter(            openmc.lib.contextmanager(            openmc.lib.os
openmc.lib.MaterialFromFilter(        openmc.lib.core                       openmc.lib.pkg_resources
openmc.lib.MeshFilter(                openmc.lib.create_string_buffer(      openmc.lib.plot
openmc.lib.MeshSurfaceFilter(         openmc.lib.current_batch(             openmc.lib.plot_geometry(
openmc.lib.MuFilter(                  openmc.lib.error                      openmc.lib.property_map(
openmc.lib.Nuclide(                   openmc.lib.evaluate_legendre(         openmc.lib.quiet_dll(
openmc.lib.POINTER(                   openmc.lib.exc                        openmc.lib.reset(
openmc.lib.ParticleFilter(            openmc.lib.export_properties(         openmc.lib.reset_timers(
openmc.lib.PathLike(                  openmc.lib.export_weight_windows(     openmc.lib.rotate_angle(
openmc.lib.PolarFilter(               openmc.lib.filter                     openmc.lib.run(
openmc.lib.RectilinearMesh(           openmc.lib.filters                    openmc.lib.run_in_memory(
openmc.lib.RegularMesh(               openmc.lib.finalize(                  openmc.lib.sample_external_source(
openmc.lib.SpatialLegendreFilter(     openmc.lib.find_cell(                 openmc.lib.settings
openmc.lib.SphericalHarmonicsFilter(  openmc.lib.find_material(             openmc.lib.simulation_finalize(
openmc.lib.SphericalMesh(             openmc.lib.getrandbits(               openmc.lib.simulation_init(
openmc.lib.Structure(                 openmc.lib.global_bounding_box(       openmc.lib.source_bank(
openmc.lib.SurfaceFilter(             openmc.lib.global_tallies(            openmc.lib.statepoint_write(
openmc.lib.Tally(                     openmc.lib.hard_reset(                openmc.lib.sys
openmc.lib.UniverseFilter(            openmc.lib.id_map(                    openmc.lib.t_percentile(
openmc.lib.UnstructuredMesh(          openmc.lib.import_properties(         openmc.lib.tallies
openmc.lib.WeightWindows(             openmc.lib.import_weight_windows(     openmc.lib.tally
openmc.lib.ZernikeFilter(             openmc.lib.init(                      openmc.lib.warn(
openmc.lib.ZernikeRadialFilter(       openmc.lib.is_initialized             openmc.lib.watt_spectrum(
openmc.lib.as_array(                  openmc.lib.is_statepoint_batch(       openmc.lib.weight_windows
openmc.lib.broaden_wmp_polynomials(   openmc.lib.iter_batches(             

Fixes # (issue)

Checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation (if applicable)

@shimwell shimwell requested a review from paulromano as a code owner April 7, 2024 15:22
Copy link
Contributor

@paulromano paulromano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shimwell I took the liberty to make some updates in here. Most of what was added to the "functions" list didn't actually need to be there for the following reasons:

  • The math functions (like calc_pn) are not really supposed to be exposed and were just there for testing purposes. I just filed Replace math function unit tests in Python with C++ tests #2943 to address that.
  • Some of what was added was actually data, not functions. I moved them into a new "Data" section
  • Some of them were module names that shouldn't have been added.

Most of the classes you added were indeed missing so I've left those. However, some global names crept in as well (e.g., CDLL and Structure). In any case, all good to go now. Thanks for helping to clean this up!

@paulromano paulromano enabled auto-merge (squash) April 7, 2024 15:25
@paulromano paulromano merged commit db3b6f3 into openmc-dev:develop Apr 7, 2024
17 checks passed
church89 pushed a commit to openmsr/openmc that referenced this pull request Jul 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants