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

Blank sdef is not supported #636

Open
tjlaboss opened this issue Jan 14, 2025 · 1 comment
Open

Blank sdef is not supported #636

tjlaboss opened this issue Jan 14, 2025 · 1 comment
Labels
bugs A deviation from expected behavior that does not reach the level of being reportable as an "Error". good first issue Good for newcomers low priority parsers are hard Examples of where MCNP syntax is complicated and should be simplified.

Comments

@tjlaboss
Copy link
Collaborator

tjlaboss commented Jan 14, 2025

Describe the bug

The sdef card in MCNP allows the user to specify a number of keyword-value pairs to define a source distribution. All keywords have a default value, as documented in the MCNP manual. Therefore, a bare sdef card is valid syntax.

MontePy throws a parsing error with a blank sdef.

To Reproduce

>>> montepy.parse_data("sdef")

or read in an otherwise parseable input file with a blank sdef.

Error Message (if any)

Traceback (most recent call last):
  File "montepy/mcnp_object.py", line 138, in __init__
    raise ParsingError(
montepy.errors.ParsingError:     , line -1

         0| sdef
The input ended prematurely.
sly: Parse error in input. EOF

MCNP input file snippet

If applicable, please include a small section of the input file you were working on. If it includes any specific values please change or remove them. For example:

MWE
1 1 20 -1000  imp:n,p=1 
1 0    +1000  imp:n,p=0

C surfaces
1000 SO 1

C data
sdef
C materials
C UO2 5 atpt enriched
m1        92235.80c           5 92238.80c          95

Version

All. Example is shown with alpha-test-dev at 57aaac5

Additional context

MCNP 6.3 Manual § 5.8.1:

Image

@tjlaboss tjlaboss added bugs A deviation from expected behavior that does not reach the level of being reportable as an "Error". good first issue Good for newcomers labels Jan 14, 2025
@MicahGale MicahGale added the parsers are hard Examples of where MCNP syntax is complicated and should be simplified. label Jan 14, 2025
@MicahGale
Copy link
Collaborator

sigh I don't think this is a high priority. Is deleting sdef not a viable workaround?

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". good first issue Good for newcomers low priority parsers are hard Examples of where MCNP syntax is complicated and should be simplified.
Projects
None yet
Development

No branches or pull requests

2 participants