Fix bug with over-agressive LineOverRunWarning #799
Merged
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
This fixes a bug where a file that was line-wrapped by MontePy would trigger a
LineOverrunWarning
when read by MontePy. The line-wrapping was manually confirmed to be producing lines that were valid MCNP lengths. This bug was caused by two issues:\n
was being considered part of the line. This was fixed withrstrip
>=
was being used instead of>
. This was not allowing lines that were exactly at the limit.This also made the Warning message more helpful. The one question I struggled with is: should the information past the line length limit be truncated or not? Current behavior is that it is.
Fixes #517
General Checklist
black
version 25.Documentation Checklist
First-Time Contributor Checklist
pyproject.toml
if you wish to do so.Additional Notes for Reviewers
Ensure that:
📚 Documentation preview 📚: https://montepy--799.org.readthedocs.build/en/799/