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

ListNode comparison is blocking contains for ListNode #552

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

ListNode comparison is blocking contains for ListNode #552

MicahGale opened this issue Sep 19, 2024 · 0 comments
Labels
bugs A deviation from expected behavior that does not reach the level of being reportable as an "Error".

Comments

@MicahGale
Copy link
Collaborator

Describe the bug

A clear and concise description of what the bug is.

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("foo.imcnp")

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:

MontePy/montepy/input_parser/input_reader.py:31: in read_input
    problem.parse_input(replace=replace)
MontePy/montepy/mcnp_problem.py:282: in parse_input
    obj = obj_parser(input)
MontePy/montepy/cell.py:100: in __init__
    self._parse_keyword_modifiers()
MontePy/montepy/cell.py:124: in _parse_keyword_modifiers
    input = input_class(in_cell_block=True, key=key, value=value)
MontePy/montepy/data_inputs/fill.py:46: in __init__
    self._parse_cell_input(key, value)
MontePy/montepy/data_inputs/fill.py:115: in _parse_cell_input
    if "(" in data.nodes:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = (shortcut:Shortcuts.REPEAT: deque([(Value, 2.0, padding: (Padding, [' '])), (Value, 2.0, padding: (Padding, [' '])), (...e, 2.0, padding: (Padding, [' '])), (Value, 2.0, padding: (Padding, [' '])), (Value, 2.0, padding: (Padding, [' ']))]))
other = '('

    def __eq__(self, other):
        if not isinstance(other, (type(self), list)):
>           raise TypeError(
                f"ListNode can only be compared to a ListNode or List. {other} given."
            )
E           TypeError: ListNode can only be compared to a ListNode or List. ( given.

MontePy/montepy/input_parser/syntax_node.py:1703: TypeError

MCNP input file snippet

See: tests/models/icsbep/HEU-COMP-THERM-021_case_007.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 19, 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".
Projects
None yet
Development

No branches or pull requests

1 participant