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

Line number is not consistently reported in check mode. #629

Open
MicahGale opened this issue Jan 9, 2025 · 0 comments
Open

Line number is not consistently reported in check mode. #629

MicahGale opened this issue Jan 9, 2025 · 0 comments
Labels
bugs A deviation from expected behavior that does not reach the level of being reportable as an "Error".

Comments

@MicahGale
Copy link
Collaborator

Describe the bug

The error message for the line number in a parsing error is not consistent

To Reproduce

Run a check of the attached model

python -m montepy -c test.imcnp

Error Message (if any)

If an error message was printed please include the entire stacktrace. If it includes any specific values please change or remove them. For example:

********** Checking: test.imcnp *********

/home/mgale/dev/montepy/montepy/__main__.py:60: UserWarning: ParsingError:     test.imcnp, line 12

    >   12|     20000 1
          |     ^^^^^ not expected here.
There was an error parsing "20000".
sly: Syntax error at line 1, token=NUMBER


  problem.parse_input(True)
/home/mgale/dev/montepy/montepy/__main__.py:60: UserWarning: ParsingError:     test.imcnp, line 13

    >   13|     90000 1
          |     ^^^^^ not expected here.
There was an error parsing "90000".
sly: Syntax error at line 1, token=NUMBER


  problem.parse_input(True)

MCNP input file snippet

material test
10 1 0.01 -10    imp:p=1
11 2 0.01 10 -11 imp:p=1
99 0      11     imp:p=0

10 so 1
11 so 2

mode p
sdef pos=0 0 0 erg=1
m1  1000  1 $ column 5 or less --> BAD
    20000 1
    90000 1
m2   1000 1 $ column 6 or greater --> GOOD
     20000 1
     90000 1
nps 1000
print 40

Version

  • Version 0.5.3.post2.dev20+g3b137bdf

Additional context

This came from a test to demonstrate an invalid material.

@MicahGale MicahGale added the bugs A deviation from expected behavior that does not reach the level of being reportable as an "Error". label Jan 9, 2025
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

No branches or pull requests

1 participant