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

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

Merged
merged 3 commits into from
Jan 23, 2024

Conversation

paulromano
Copy link
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
Copy link
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.

Copy link
Contributor

@pshriwise pshriwise left a comment

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
18 checks passed
@paulromano paulromano deleted the mesh-bin-plotting branch January 23, 2024 12:54
@shimwell
Copy link
Member

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

@paulromano
Copy link
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