Open MicahGale opened 3 months ago
This is #84
Also surfaces:
SURFACE: 1, CZ
Traceback (most recent call last):
File "/home/mgale/dev/montepy/gen_big_model.py", line 65, in <module>
gen_geometry(mat)
File "/home/mgale/dev/montepy/gen_big_model.py", line 59, in gen_geometry
problem.write_problem("big_model.imcnp")
File "/home/mgale/dev/montepy/montepy/mcnp_problem.py", line 409, in write_problem
self._write_to_stream(fh)
File "/home/mgale/dev/montepy/montepy/mcnp_problem.py", line 454, in _write_to_stream
lines = obj.format_for_mcnp_input(self.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/surfaces/surface.py", line 271, in _update_values
modifier = self._tree["surface_num"]["modifier"]
^^^^^^^^^^
AttributeError: 'CylinderOnAxis' object has no attribute '_tree'
ThermalScatteringLaw too:
File "/home/mgale/dev/montepy/gen_big_model.py", line 85, in <module>
gen_geometry(mat)
File "/home/mgale/dev/montepy/gen_big_model.py", line 81, in gen_geometry
problem.write_problem("big_model.imcnp", overwrite=True)
File "/home/mgale/dev/montepy/montepy/mcnp_problem.py", line 409, in write_problem
self._write_to_stream(fh)
File "/home/mgale/dev/montepy/montepy/mcnp_problem.py", line 454, in _write_to_stream
lines = obj.format_for_mcnp_input(self.mcnp_version)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/mgale/dev/montepy/montepy/data_inputs/material.py", line 147, in format_for_mcnp_input
lines += self.thermal_scattering.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/thermal_scattering.py", line 112, in _update_values
self._tree["classifier"].number.value = self.parent_material.number
^^^^^^^^^^
AttributeError: 'ThermalScatteringLaw' object has no attribute '_tree'
Traceback (most recent call last):
File "/home/mgale/dev/montepy/gen_big_model.py", line 86, in <module>
gen_geometry(mat)
File "/home/mgale/dev/montepy/gen_big_model.py", line 82, in gen_geometry
problem.write_problem("big_model.imcnp", overwrite=True)
File "/home/mgale/dev/montepy/montepy/mcnp_problem.py", line 409, in write_problem
self._write_to_stream(fh)
File "/home/mgale/dev/montepy/montepy/mcnp_problem.py", line 469, in _write_to_stream
for line in self.cells._run_children_format_for_mcnp(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/mgale/dev/montepy/montepy/cells.py", line 167, in _run_children_format_for_mcnp
if buf := getattr(self, attr).format_for_mcnp_input(mcnp_version):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/mgale/dev/montepy/montepy/data_inputs/cell_modifier.py", line 265, in format_for_mcnp_input
if (self.in_cell_block != print_in_data_block) and self._is_worth_printing:
^^^^^^^^^^^^^^^^^^^^^^^
File "/home/mgale/dev/montepy/montepy/data_inputs/cell_modifier.py", line 170, in _is_worth_printing
for cell in self._problem.cells:
^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'cells'
cell = montepy.Cell()
cell.link_to_problem()
problem.cells.append_renumber(cell)
Traceback (most recent call last):
File "/home/mgale/dev/montepy/gen_big_model.py", line 86, in <module>
gen_geometry(mat)
File "/home/mgale/dev/montepy/gen_big_model.py", line 80, in gen_geometry
problem.cells.append_renumber(cell)
File "/home/mgale/dev/montepy/montepy/numbered_object_collection.py", line 236, in append_renumber
self.append(obj)
File "/home/mgale/dev/montepy/montepy/numbered_object_collection.py", line 205, in append
f"{obj} to {type(self)}. Conflict was with {self[obj.number]}"
~~~~^^^^^^^^^^^^
File "/home/mgale/dev/montepy/montepy/numbered_object_collection.py", line 323, in __getitem__
raise TypeError("index must be an int or slice")
TypeError: index must be an int or slice
shell returned 1
Traceback (most recent call last): File "/home/mgale/dev/montepy/gen_big_model.py", line 86, in <module> gen_geometry(mat) File "/home/mgale/dev/montepy/gen_big_model.py", line 82, in gen_geometry problem.write_problem("big_model.imcnp", overwrite=True) File "/home/mgale/dev/montepy/montepy/mcnp_problem.py", line 409, in write_problem self._write_to_stream(fh) File "/home/mgale/dev/montepy/montepy/mcnp_problem.py", line 469, in _write_to_stream for line in self.cells._run_children_format_for_mcnp( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/mgale/dev/montepy/montepy/cells.py", line 167, in _run_children_format_for_mcnp if buf := getattr(self, attr).format_for_mcnp_input(mcnp_version): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/mgale/dev/montepy/montepy/data_inputs/cell_modifier.py", line 265, in format_for_mcnp_input if (self.in_cell_block != print_in_data_block) and self._is_worth_printing: ^^^^^^^^^^^^^^^^^^^^^^^ File "/home/mgale/dev/montepy/montepy/data_inputs/cell_modifier.py", line 170, in _is_worth_printing for cell in self._problem.cells: ^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'cells'
This is actually the problem.cells.cell_modifier that's the issue.
In general update_values
is not being used.
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:
Error Message (if any)
Version