Adding fix and tests for spherical mesh as spatial distribution#3428
Adding fix and tests for spherical mesh as spatial distribution#3428paulromano merged 14 commits intoopenmc-dev:developfrom
Conversation
gonuke
left a comment
There was a problem hiding this comment.
Thanks for this quick fix @pshriwise - Have a couple of implementation quetions?
|
Like a vine on the wall, the scope has crept after thinking over some of the discussion above. I noticed that there were some issues with the I've also added an I also now need to add tests for |
|
I should also note that these updates do change the behavior of the |
gonuke
left a comment
There was a problem hiding this comment.
A couple of last questions...
Co-authored-by: Paul Wilson <paul.wilson@wisc.edu>
|
I opted for |
(I don't see that change yet, FYI...) |
gonuke
left a comment
There was a problem hiding this comment.
This looks good to me. Thanks @pshriwise. Hopefully the tests will pass and it can be merged soon
paulromano
left a comment
There was a problem hiding this comment.
Thanks @pshriwise. I just made one update, which is to introduce a HasBoundingBox protocol for the domain so that if there is some future type with a bounding_box attribute, we don't need to change the type annotation to account for it.
One other thought -- instead of having arguments like name, mesh_id, phi_grid_bounds, etc. in from_domain that just get passed on to the normal constructor, we could just take **kwargs that get passed. That way if the constructor changes, we don't need to update it in two places. What do you think of that?
I like it! Good call.
I like this as well. 👍🏻 I'm going to vote for that happening in a separate PR though as we haven't had too much call for it and this PR has crept a fair amount in scope already. |
|
@pshriwise Are you OK with me taking a stab at the |
I guess I'd prefer we cut this one off where it is an start a new one. The scope crept a fair amount already (mainly to make test patterns consistent with other mesh classes) so I think a further refactor like that would make sense as a separate PR. |
…mc-dev#3428) Co-authored-by: Paul Wilson <paul.wilson@wisc.edu> Co-authored-by: Paul Romano <paul.k.romano@gmail.com>
Description
This passes the cosine of theta bound for a spherical mesh bin to
uniform_distributioninstead of the angles themselves. It also adds tests using regular, cylindrical, and spherical meshes withMeshSpatialwith some checks to ensure we're getting valid source values. To simplify said tests I've also added aSphericalMesh.from_domainclassmethod.Small additional change: the
originattribute is now written as part of theSphericalMesh.__repr__.Fixes #3427
Checklist
I have made corresponding changes to the documentation (if applicable)