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

🎉500 Issues🎉 The 'xM' shortcut can fail to parse #500

Open
tjlaboss opened this issue Aug 22, 2024 · 8 comments
Open

🎉500 Issues🎉 The 'xM' shortcut can fail to parse #500

tjlaboss opened this issue Aug 22, 2024 · 8 comments
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

Comments

@tjlaboss
Copy link
Collaborator

tjlaboss commented Aug 22, 2024

Describe the bug

image

Parsing the XM shortcut in a U (Universe) input leads to node being None

To Reproduce

montepy.read_input("testi.i")

Error Message

Traceback (most recent call last):
  File "./badinterp/mwe.py", line 2, in <module>
    deck = montepy.read_input("testi.i")
  File "./badinterp/montepy/input_parser/input_reader.py", line 29, in read_input
    problem.parse_input(replace=replace)
  File "./badinterp/montepy/mcnp_problem.py", line 272, in parse_input
    obj = obj_parser(input)
  File "./badinterp/montepy/data_inputs/data_parser.py", line 46, in parse_data
    return data_class(input)
  File "./badinterp/montepy/data_inputs/universe_input.py", line 44, in __init__
    node.is_negatable_identifier = True
AttributeError: 'NoneType' object has no attribute 'is_negatable_identifier'

MCNP input file snippet

MCNP Test Model
C Cells
C Graveyard
99    0 +1010
C Seven spheres within a sphere
1 1 -10 -1001
2 1 -10 -1002
3 1 -10 -1003
4 1 -10 -1004
5 1 -10 -1005
6 1 -10 -1006
7 1 -10 -1007
8     0 -1010  1001  1002  1003  1004  1005  1006  1007

C surfaces
1001 SO      0.1
1002 SX -1.1 0.1
1003 SX +1.1 0.1
1004 SY -1.1 0.1
1005 SY +1.1 0.1
1006 SZ -1.1 0.1
1007 SZ +1.1 0.1
1010 SO 3

C data
C mX fails to parse
C     _ 1  2 10 _ 3 21 21
U     J 1 2M 5M J 3 7M 1M
C materials
C UO2 5 atpt enriched
m1        92235.80c           5
          92238.80c          95
C execution
ksrc 0 0 0
kcode 100000 1.000 50 1050
mode n p

Version

  • Version 0.2.10 - 0.3.3

Additional context

Other shortcut issues: #397, #489, and #499

This one appears to be just a code bug, rather than a problem with shortcut expansions.

@tjlaboss tjlaboss added the bugs A deviation from expected behavior that does not reach the level of being reportable as an "Error". label Aug 22, 2024
@tjlaboss
Copy link
Collaborator Author

Worth noting: this isn't due to the Jump entry. Any Universe number works as well.

@MicahGale
Copy link
Collaborator

Should we jump a shark?

@tjlaboss
Copy link
Collaborator Author

image

@MicahGale
Copy link
Collaborator

Wait wait wait wait:

U J 1 2X 5X J 3 7X 1X

Is valid syntax? The documentation clearly says it should be 2M...

@tjlaboss
Copy link
Collaborator Author

tjlaboss commented Aug 22, 2024

Oops, my brain is tired from opening so many issues. That should have been an M. The issue still occurs.

I'll update the issue description to specifically be for Universe inputs.

@MicahGale
Copy link
Collaborator

Ohhh ok. I was about to have an existential crisis.

@MicahGale
Copy link
Collaborator

How critical is this? I feel like not super critical given there's a workaround.

@tjlaboss
Copy link
Collaborator Author

This is a low-priority issue. Perhaps we should add a tag for such.

@MicahGale MicahGale added the good first issue Good for newcomers label Oct 15, 2024
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
Projects
None yet
Development

No branches or pull requests

2 participants