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

Allowing CylindricalMesh and SphericalMesh to be fully made via constructor+ type hints #2619

Merged
merged 15 commits into from
Aug 5, 2023

Conversation

shimwell
Copy link
Member

@shimwell shimwell commented Jul 22, 2023

Description

I've been crawling through the code looking for classes that are not fully setable from their args and I found CylindricalMesh and SphericalMesh were just missing the origin arg.

So I've added that argument to their __ init __

While browsing the code I couldn't resist adding a few type hints

Fixes # (issue)

Checklist

  • I have performed a self-review of my own code
    - [ ] I have run clang-format 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)

openmc/mesh.py Outdated Show resolved Hide resolved
openmc/mesh.py Outdated Show resolved Hide resolved
openmc/mesh.py Outdated Show resolved Hide resolved
openmc/mesh.py Outdated Show resolved Hide resolved
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.

Thanks for this PR @shimwell!

openmc/mesh.py Outdated Show resolved Hide resolved
openmc/mesh.py Outdated Show resolved Hide resolved
openmc/stats/multivariate.py Outdated Show resolved Hide resolved
openmc/stats/multivariate.py Outdated Show resolved Hide resolved
openmc/stats/multivariate.py Outdated Show resolved Hide resolved
openmc/stats/univariate.py Outdated Show resolved Hide resolved
tests/unit_tests/test_mesh.py Outdated Show resolved Hide resolved
openmc/mesh.py Outdated Show resolved Hide resolved
openmc/mesh.py Outdated Show resolved Hide resolved
openmc/mesh.py Outdated Show resolved Hide resolved
openmc/mesh.py Outdated Show resolved Hide resolved
openmc/mesh.py Outdated Show resolved Hide resolved
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.

In addition to line comments below, it looks like more changes were now made in other files (not relevant to original purpose of PR) -- I'll review those but I'd appreciate if we can limit the scope of the PR in the future

openmc/mesh.py Outdated Show resolved Hide resolved
openmc/mesh.py Outdated Show resolved Hide resolved
openmc/mesh.py Outdated Show resolved Hide resolved
openmc/mesh.py Outdated Show resolved Hide resolved
openmc/mesh.py Outdated Show resolved Hide resolved
openmc/mesh.py Outdated Show resolved Hide resolved
openmc/stats/multivariate.py Outdated Show resolved Hide resolved
openmc/stats/multivariate.py Outdated Show resolved Hide resolved
openmc/stats/univariate.py Outdated Show resolved Hide resolved
tests/unit_tests/test_mesh.py Outdated Show resolved Hide resolved
tests/unit_tests/test_mesh.py Outdated Show resolved Hide resolved
@shimwell
Copy link
Member Author

I did have to tinker with a few extra test files that were calling openmc.CylindricalMesh() and openmc.SphericalMesh() without arguments (which is no longer not possible as we now have mandatory args) but looks like the CI is now passing 🎉

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.

Sorry for the delay on this -- thanks for the updates @shimwell!

@paulromano paulromano merged commit 557880a into openmc-dev:develop Aug 5, 2023
16 checks passed
@shimwell
Copy link
Member Author

shimwell commented Aug 5, 2023

Many thanks Paul, sorry it was not the most tidy PR.

stchaker pushed a commit to stchaker/openmc that referenced this pull request Oct 25, 2023
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