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

Problem formatting material with "plib" for MCNP input #521

Closed
tjlaboss opened this issue Aug 28, 2024 · 1 comment · Fixed by #537
Closed

Problem formatting material with "plib" for MCNP input #521

tjlaboss opened this issue Aug 28, 2024 · 1 comment · Fixed by #537
Assignees
Labels
bugs A deviation from expected behavior that does not reach the level of being reportable as an "Error". critical An issue that seriously limits user adoption or hampers current use.

Comments

@tjlaboss
Copy link
Collaborator

Describe the bug

#484 introduced a bug where MontePy can no longer write out a material input with "plib"

To Reproduce

Successfully load the deck, and then try to write it out again.

Error Message (if any)

Traceback (most recent call last):
  File "testit.py", line 3, in <module>
    deck.write_problem("out.imcnp", overwrite=True)
  File "montepy/mcnp_problem.py", line 413, in write_problem
    self._write_to_stream(fh)
  File "montepy/mcnp_problem.py", line 455, in _write_to_stream
    lines = obj.format_for_mcnp_input(self.mcnp_version)
  File "montepy/data_inputs/material.py", line 145, in format_for_mcnp_input
    lines = super().format_for_mcnp_input(mcnp_version)
  File "montepy/mcnp_object.py", line 131, in format_for_mcnp_input
    self._tree.check_for_graveyard_comments()
  File "montepy/input_parser/syntax_node.py", line 145, in check_for_graveyard_comments
    flatpack = self.flatten()
  File "montepy/input_parser/syntax_node.py", line 275, in flatten
    ret += node.flatten()
  File "montepy/input_parser/syntax_node.py", line 2279, in flatten
    ret += node.flatten()
  File "montepy/input_parser/syntax_node.py", line 275, in flatten
    ret += node.flatten()
AttributeError: 'NoneType' object has no attribute 'flatten'

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:

plib example
C Cells
1   1 -1.0    -1  
2   1 -0.5    -2 +1
3   0            +2

C Surfaces
1    so 0
2    so 2

c Data
m1      8016.71c  2-02
        8017.71c  9-09
        plib=84p
imp:p   2 1 0 
mode p
nps 1

Version

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

image

@MicahGale MicahGale added the critical An issue that seriously limits user adoption or hampers current use. label Aug 28, 2024
@MicahGale MicahGale self-assigned this Sep 9, 2024
MicahGale added a commit that referenced this issue Sep 9, 2024
@MicahGale MicahGale linked a pull request Sep 9, 2024 that will close this issue
3 tasks
MicahGale added a commit that referenced this issue Sep 9, 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". critical An issue that seriously limits user adoption or hampers current use.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants