Skip to content

Can't make a material from scratch and export it. #512

@MicahGale

Description

@MicahGale

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:

import montepy

def gen_mega_mat():
    mat = montepy.data_inputs.Material()
    mat.number = 1
    mat._is_atom_fraction = True
    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)
    print(mat.format_for_mcnp_input((6,3,0)))

gen_mega_mat()                           

Error Message (if any)

Press ENTER or type command to continue
  File "/home/mgale/dev/montepy/gen_big_model.py", line 10
    print(mat.format_for_mcnp_input((6,3,0))
         ^
SyntaxError: '(' was never closed

shell returned 1

Press ENTER or type command to continue
Traceback (most recent call last):
  File "/home/mgale/dev/montepy/gen_big_model.py", line 12, in <module>
    gen_mega_mat()
  File "/home/mgale/dev/montepy/gen_big_model.py", line 10, in gen_mega_mat
    print(mat.format_for_mcnp_input((6,3,0)))
  File "/home/mgale/dev/montepy/montepy/data_inputs/material.py", line 145, in format_for_mcnp_input
    lines = super().format_for_mcnp_input(mcnp_version)
  File "/home/mgale/dev/montepy/montepy/mcnp_object.py", line 130, in format_for_mcnp_input
    self._update_values()
  File "/home/mgale/dev/montepy/montepy/data_inputs/material.py", line 155, in _update_values
    self._tree.nodes["data"] = new_list
AttributeError: 'Material' object has no attribute '_tree'

Version

  • Version 0.4.0

Metadata

Metadata

Assignees

Labels

bugsA deviation from expected behavior that does not reach the level of being reportable as an "Error".

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions