Skip to content

Conversation

MicahGale
Copy link
Collaborator

@MicahGale MicahGale commented Aug 31, 2025

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:

  1. \n was being considered part of the line. This was fixed with rstrip
  2. >= 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

  • I have performed a self-review of my own code.
  • The code follows the standards outlined in the development documentation.
  • I have formatted my code with black version 25.
  • I have added tests that prove my fix is effective or that my feature works (if applicable).

Documentation Checklist

  • I have documented all added classes and methods.
  • For infrastructure updates, I have updated the developer's guide.
  • For significant new features, I have added a section to the getting started guide.

First-Time Contributor Checklist

  • If this is your first contribution, add yourself to pyproject.toml if you wish to do so.

Additional Notes for Reviewers

Ensure that:

  • The submitted code is consistent with the merge checklist outlined here.
  • The PR covers all relevant aspects according to the development guidelines.
  • 100% coverage of the patch is achieved, or justification for a variance is given.

📚 Documentation preview 📚: https://montepy--799.org.readthedocs.build/en/799/

@MicahGale MicahGale linked an issue Aug 31, 2025 that may be closed by this pull request
@MicahGale MicahGale added the bugs A deviation from expected behavior that does not reach the level of being reportable as an "Error". label Aug 31, 2025
@MicahGale MicahGale self-assigned this Aug 31, 2025
@MicahGale MicahGale requested a review from tjlaboss August 31, 2025 17:11
@tjlaboss tjlaboss changed the title Fix bug with over gressive lin expansion warning Fix bug with over-agressive LineOverRunWarning Sep 2, 2025
@MicahGale MicahGale merged commit 727aa0c into develop Sep 2, 2025
28 checks passed
@MicahGale MicahGale deleted the 517-montepy-cant-agree-on-how-long-a-line-is branch September 2, 2025 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugs A deviation from expected behavior that does not reach the level of being reportable as an "Error".
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MontePy Can't agree on how long a line is
2 participants