Skip to content

Adding type hints to meshes - #2601

Merged
paulromano merged 6 commits into
openmc-dev:developfrom
shimwell:typo_fix_return_type
Jul 21, 2023
Merged

paulromano merged 6 commits into
openmc-dev:developfrom
shimwell:typo_fix_return_type

Conversation

@shimwell

Copy link
Copy Markdown
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

Comment thread openmc/mesh.py Outdated
@shimwell

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

Comment thread openmc/mesh.py Outdated
Comment thread openmc/mesh.py Outdated
Comment thread openmc/mesh.py
Comment thread openmc/mesh.py Outdated
Comment thread openmc/mesh.py Outdated
Comment thread openmc/mesh.py Outdated
Comment thread openmc/mesh.py Outdated
Comment thread openmc/mesh.py Outdated
Comment thread openmc/mesh.py Outdated
Comment thread openmc/mesh.py Outdated
Comment thread openmc/mesh.py Outdated
Co-authored-by: Paul Romano <paul.k.romano@gmail.com>
Comment thread openmc/mesh.py Outdated

@paulromano paulromano left a comment

Copy link
Copy Markdown
Contributor

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
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>
apingegno pushed a commit to apingegno/openmc that referenced this pull request May 7, 2026
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