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

Support poorly formatted Material definitions #182

Open
MicahGale opened this issue Sep 15, 2023 · 3 comments
Open

Support poorly formatted Material definitions #182

MicahGale opened this issue Sep 15, 2023 · 3 comments
Assignees
Labels
feature request An issue that improves the user interface. lanl did something When LANL makes a change to MCNP that needs to be evaluated. parsers are hard Examples of where MCNP syntax is complicated and should be simplified.
Milestone

Comments

@MicahGale
Copy link
Collaborator

LANL apparently doesn't know how to write a syntax specification. From LA-UR-17-29981 Section 3.3.2.1 a material specification shall take the form:

Mm zaid1 fraction1 zaid2 fraction2 ... [KEYWORD=value(s) ...]

Which makes sense.

Until you notice

Input Parameter Description
Keyword * Value

And finally notice the asterisk:

* M card keywords may appear anywhere among the zaid-fraction pairs, but must not separate a pair.

Yep The syntax specification from before is a lie. The key-value pairs can appear anywhere they like!

Why did the developers do this? I don't know.

Is this a context-free grammar? Probably not.

However, it is officially (in the worst documented ways possible) supported, so it needs to be supported in MOntePy.

@MicahGale
Copy link
Collaborator Author

I am leaning towards possibly just raising UnsupportedFeature and just moving on.

@MicahGale MicahGale mentioned this issue Sep 4, 2024
30 tasks
@MicahGale MicahGale self-assigned this Sep 4, 2024
@MicahGale MicahGale added the parsers are hard Examples of where MCNP syntax is complicated and should be simplified. label Sep 11, 2024
MicahGale added a commit that referenced this issue Oct 12, 2024
@MicahGale
Copy link
Collaborator Author

MicahGale commented Oct 24, 2024

So I managed to fix this in #507 with 1f14326. Should we prioritize to ship this before 1.0.0 with a few cherry-picks? @tjlaboss

@tjlaboss
Copy link
Collaborator

No, it's less common than the other priorities.

@MicahGale MicahGale added this to the 1.0.0-alpha milestone Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request An issue that improves the user interface. lanl did something When LANL makes a change to MCNP that needs to be evaluated. 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