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 type hints to meshes #2601

Merged
merged 6 commits into from
Jul 21, 2023

Conversation

shimwell
Copy link
Member

Description

Added a few more type hints for the meshes.

I am looking to help get a few more features into the meshes including (SphericalMesh.from_domain and bounding boxes for Cylindrical and Spherical) and I think that adding type hints will help when implementing these changes.

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)

✔️ I have run pytest on test_mesh_from_domain.py, test_mesh_from_lattice.py and test_mesh.py

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

CI is failing with TypeError: Subscripted generics cannot be used with class and instance checks error and I think I've seen this before when trying to use PathLike as a type.

openmc/mesh.py Outdated Show resolved Hide resolved
openmc/mesh.py Outdated Show resolved Hide resolved
openmc/mesh.py 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/mesh.py Outdated Show resolved Hide resolved
openmc/mesh.py Outdated Show resolved Hide resolved
openmc/mesh.py Outdated Show resolved Hide resolved
Co-authored-by: Paul Romano <paul.k.romano@gmail.com>
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 @shimwell!

@paulromano paulromano enabled auto-merge (squash) July 21, 2023 16:07
@paulromano paulromano merged commit 50c3103 into openmc-dev:develop Jul 21, 2023
16 checks passed
stchaker pushed a commit to stchaker/openmc that referenced this pull request Oct 25, 2023
Co-authored-by: Paul Romano <paul.k.romano@gmail.com>
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.

2 participants