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 importance objects can't be printed #549

Open
MicahGale opened this issue Sep 18, 2024 · 0 comments
Open

Blank importance objects can't be printed #549

MicahGale opened this issue Sep 18, 2024 · 0 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

Comments

@MicahGale
Copy link
Collaborator

Describe the bug

Importance is missing a default _tree and when str is called this leads to an AttributeError.

To Reproduce

A short code snippet of what you have ran. Please change or remove any specific values or anything that can't be public. For example:

problem = montepy.read_input("tests/inputs/test_importance.imcnp")
print(problem.cells._importance)

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:

    print(self)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = Importance: in_cell_block: False, set_in_cell_block False,
{}

    def __str__(self):
        if not self.in_cell_block and self._problem is None:
>           return " ".join(self.input_lines)
E           AttributeError: 'Importance' object has no attribute 'input_lines'

montepy/data_inputs/importance.py:165: AttributeError

MCNP input file snippet

see tests/inputs/test_importance.imcnp

Version

  • Version 0.4.1
@MicahGale MicahGale added the bugs A deviation from expected behavior that does not reach the level of being reportable as an "Error". label Sep 18, 2024
@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
Projects
None yet
Development

No branches or pull requests

1 participant