idaholab/MontePy

MontePy Can't agree on how long a line is

MicahGale opened this issue · 0 comments

Describe the bug

I had montepy generate a really long line, and wrap it. When MontePy re read it in it complained the lines were too long.

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:

def gen_mega_mat()
    mat = montepy.data_inputs.Material()
    mat.number = 1
    mat._is_atom_fraction = True
    classy = syntax_node.ClassifierNode()
    classy.prefix = syntax_node.ValueNode("M", str)
    classy.number = syntax_node.ValueNode("1", int, syntax_node.PaddingNode(" "))
    mat._tree = syntax_node.SyntaxNode(
        "foo",
        {
            "classifier": classy,
            "data": syntax_node.ListNode("hi"),
        },
    )
    for i in range(1, 93):
        iso = montepy.data_inputs.isotope.Isotope(f"{int(i*1000 + i*2.1)}.80c")
        mat.material_components[iso] = (
            montepy.data_inputs.material_component.MaterialComponent(iso, 0.01)
        )
    mat.add_thermal_scattering("grpht.20t")
    mat.thermal_scattering._tree = copy.deepcopy(mat._tree)
    return mat
problem.materials.append(gen_mega_mat())

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:

/home/mgale/mambaforge/lib/python3.10/site-packages/montepy/input_parser/input_syntax_reader.py:184: LineOverRunWarning: The line: M1 1002.80c 0.01 2004.80c 0.01 3006.80c 0.01 4008.80c 0.01 5010.80c 0.01 6012.80c 0.01 7014.80c 0.01 8016.80c 0.01 9018.80c 0.01
 exceeded the allowed line length of: 128 for MCNP (6, 2, 0)

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:

1 1 20
         -1000  $ dollar comment
        imp:n,p=1 U=350 trcl=5

C surfaces
1000 SO 1

C data
C materials
C UO2 5 atpt enriched
m1        92235.80c           5 &
92238.80c          95

Version

  • Version 0.4.0