Skip to content
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

Fixed parsing error with sigma baryons #673

Merged
merged 6 commits into from
Mar 3, 2025

Conversation

MicahGale
Copy link
Collaborator

@MicahGale MicahGale commented Mar 1, 2025

Pull Request Checklist for MontePy

Description

This fixes a bug where sigma baryon particles can't be parsed properly, these are + and -, but the biggest issue is that are special character particles, and should have been parsed as PARTICLE_SPECIAL tokens. However, due to token precedence this was not happening. This fixes this by changing token precedence, fixing a bug with ParticleNode for special character particles, and addressed a few issues from token precedence.

Fixes #671


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--673.org.readthedocs.build/en/673/

@MicahGale MicahGale added bugs A deviation from expected behavior that does not reach the level of being reportable as an "Error". parsers are hard Examples of where MCNP syntax is complicated and should be simplified. labels Mar 1, 2025
@MicahGale MicahGale linked an issue Mar 1, 2025 that may be closed by this pull request
@MicahGale MicahGale self-assigned this Mar 1, 2025
@MicahGale MicahGale requested a review from tjlaboss March 1, 2025 03:07
@MicahGale MicahGale marked this pull request as ready for review March 1, 2025 03:07
@tjlaboss
Copy link
Collaborator

tjlaboss commented Mar 3, 2025

MCNP 6.3 Manual Table 4.3:
image

Dear Mr. President, there are too many particles these days. Please eliminate 3.

@tjlaboss tjlaboss changed the title Fixed parsing error with sigma barryons Fixed parsing error with sigma baryons Mar 3, 2025
@MicahGale MicahGale enabled auto-merge March 3, 2025 18:44
@MicahGale MicahGale merged commit e71d1c4 into develop Mar 3, 2025
22 checks passed
@MicahGale MicahGale deleted the 671-valid-particles-are-causing-parsing-error branch March 3, 2025 18:46
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". parsers are hard Examples of where MCNP syntax is complicated and should be simplified.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Valid particles are causing parsing error
2 participants