-
Notifications
You must be signed in to change notification settings - Fork 10
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
Make Particle Type errors into a warning and a NotImplementedError #656
Conversation
Also, throughout, 'assertEqual' and 'assertAlmostEqual' were used interchangeably to test floating-point importances. I have changed them all to be 'assert x == y'. Alternatively, one could compare values with 'pytest.approx'
@MicahGale what version of |
Regarding the |
It always installs the latest stable from pypi, which is |
Going to leave this as a draft while we think about the way to implement this logic. Raising a warning for every cell without an importance set is annoying (a single warning is still appropriate). Something like the following seems to make sense:
There is some additional complicated logic that worthy of at least one independent issue. Perhaps, for the scope of this PR, the unspecified importance should just be set to |
So in MontePy However, this will have different consequences: From section 5.12.1 further on:
I think for now a fatal Error will have the lowest unintended consequences to users. |
I agree. Related issue #657 has been opened for full default importance logic implementation. |
I agree: split #657 as separate scope. Constrict this scope to just parsing-time warnings. |
Went for a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The patch coverage is 85%. I need to investigate further what is missed in coverage.
|
Make it so. |
tests/test_importance.py
Outdated
with pytest.raises(MalformedInputError): | ||
montepy.read_input(os.path.join("tests", "inputs", "test_imp_redundant.imcnp")) | ||
|
||
|
||
def test_not_imp(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switch to a more meaningful test name. I am going to be so confused by this in the future. Maybe: test_not_implement_on_export
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just need a clearer test name.
Pull Request Checklist for MontePy
Description
ParticleTypeNotInProblem and ParticleTypeNotInCell are fatal errors. These exceptions arise when the importances of the cells do not agree with those of the run mode. The MCNP6.3 manual does not indicate that these mismatches necessarily result in an unrunnable MCNP model. Therefore, these exceptions have been changed from errors to warnings.
This PR also converts the entirety of test_importance.py from unittest to pytest.
Fixes #381
General Checklist
Documentation Checklist
Additional Notes for Reviewers
Ensure that:
📚 Documentation preview 📚: https://montepy--656.org.readthedocs.build/en/656/