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

adding BoundingBox.extent and RegularMesh.bounding_box #2507

Merged

Conversation

shimwell
Copy link
Member

I'm plotting a few regular meshes at the moment and would find it useful to be able to easily get the extent of the regular mesh.

Adding a bounding_box property to the RegularMesh and adding the extent property to the BoundingBox would make it easier when plotting.

example usage.

plt.imshow(
    slice_data,   # contains 2d slice of 3d regular mesh tally data
    origin='lower',
    norm=LogNorm(),
    extent=mesh.bounding_box.extent['xy']   # <- this PR enables getting the extent like this
) 

openmc/mesh.py Outdated Show resolved Hide resolved
@shimwell
Copy link
Member Author

shimwell commented May 2, 2023

Sorry for this mess of a PR, I accidentally merged a few branches together. I've tidied it up now. Great example of why squashing commits on merge is the way to go 😄

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.

Simple enough -- thanks @shimwell!

@paulromano paulromano merged commit 3a93929 into openmc-dev:develop May 22, 2023
17 checks passed
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.

None yet

2 participants