-
Notifications
You must be signed in to change notification settings - Fork 18
Implemented automated Type and Value Checking #842
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
Open
MicahGale
wants to merge
197
commits into
develop
Choose a base branch
from
alpha-test-checkvalue
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* Vendor "checkvalue.py" from OpenMC and add license * The OpenMC codebase is released under the MIT license. This commit includes a module from OpenMC to add value checking capabilities to MontePy. The LICENSE is updated accordingly. * Update CHANGELOG * Don't require sphinx docs checkvalue for now * Rename checkvalue -> _check_value * Update LICENSE * Copy license VERBATIM and add serial commas to MontePy's license * Update LICENSE to reflect checkvalue's 2014 date
This reverts commit 8a5e980.
Collaborator
Author
|
Docs changes: |
Draft
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
code improvement
A feature request that will improve the software and its maintainability, but be invisible to users.
feature request
An issue that improves the user interface.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request Checklist for MontePy
Description
MontePy does a lot of type and value checking, which consists of a lot of conditional raising of
TypeErrorandValueErroras noted in #674. Thanks @kordusas for bugging us to actually do this. This fixes this by using decorator magic to automatically run these tests at call time every time with minimal code per new function.This has been a large effort to:
check_value.pyfrom OpenMCcheck_value.pyto:@args_checkeddecoratortyping.Annotatedfor value checkingmontepy.typesfor common types@args_checkedandmontepy.typesFixes #674, fixes #91, fixes #393?
General Checklist
blackversion 25.LLM Disclosure
Were any large language models (LLM or "AI") used in to generate any of this code?
Documentation Checklist
First-Time Contributor Checklist
pyproject.tomlif you wish to do so.Additional Notes for Reviewers
Ensure that:
📚 Documentation preview 📚: https://montepy--842.org.readthedocs.build/en/842/