Skip to content

Add C API function for getting mesh bins for rasterized plot - #2854

Merged
paulromano merged 3 commits into
openmc-dev:developfrom
paulromano:mesh-bin-plotting
Jan 23, 2024
Merged

Add C API function for getting mesh bins for rasterized plot#2854
paulromano merged 3 commits into
openmc-dev:developfrom
paulromano:mesh-bin-plotting

Conversation

@paulromano

Copy link
Copy Markdown
Contributor

Description

This PR adds a new openmc_mesh_get_plot_bins function and corresponding openmc.lib.Mesh.get_plot_bins Python binding that allows you to determine the mesh bin indices for pixels on a 2D rasterized plot. I'm planning on integrating this into openmc-plotter to generalize our mesh plotting capabilities there. For example, here is a sneak peak of a tet mesh tally visualized in the plotter:
image

Checklist

  • I have performed a self-review of my own code
  • I have run clang-format (version 15) on any C++ source files (if applicable)
  • I have followed the style guidelines for Python source files (if applicable)
  • I have made corresponding changes to the documentation (if applicable)
  • I have added tests that prove my fix is effective or that my feature works (if applicable)

@paulromano
paulromano requested a review from pshriwise January 21, 2024 23:26
@paulromano

Copy link
Copy Markdown
Contributor Author

FYI It looks like there were a bunch of CI test failures related to a new release of scipy. I've limited the range of valid scipy versions to <1.12 to avoid this for now while I look into what's going on with the new version.

@pshriwise pshriwise left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Awesome PR @paulromano! I'll keep an eye on CI. Once that passes, I don't see a reason not to get this merged in soon. 🕵🏻

@paulromano
paulromano merged commit e6a36ff into openmc-dev:develop Jan 23, 2024
@paulromano
paulromano deleted the mesh-bin-plotting branch January 23, 2024 12:54
@shimwell

Copy link
Copy Markdown
Member

Do we have to update the conda meta.yml to also have this scipy restriction

@paulromano

Copy link
Copy Markdown
Contributor Author

@shimwell I'm going to look into what is going wrong with scipy 1.12 and get it fixed before the next release, so we shouldn't need to worry about conda.

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.

3 participants