Repository: idaholab/MontePy

Issue:
Thermal Scattering laws get lost to the ether

**Describe the bug**

`ThermalScatteringLaw`s never get printed out to file with `problem.write_to_file`.

This is due to an older approach, where they are never loaded in `problem.data_inputs` and their parent `material` object is responsible for getting them to print.

**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:

``` python
problem = montepy.read_input("foo.imcnp")
problem.write_to_file("bar.imcnp")
```
Example file:

```
test
C cells
1 0 -1

C surfaces
1 so 5

C data
m2001
       1001.00c     2
       8016.00c     1
mt2001 h-h2o.40t
```

f 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.2.5


**Additional context**

Add any other context about the problem here.


Discussion:

Patch:
diff --git a/montepy/data_inputs/material.py b/montepy/data_inputs/material.py
index 022c20bc..44516538 100644
--- a/montepy/data_inputs/material.py
+++ b/montepy/data_inputs/material.py
@@ -116,6 +116,21 @@ class Material(data_input.DataInputAbstract, Numbered_MCNP_Object):
                 if cell.material == self:
                     yield cell
 
+    def format_for_mcnp_input(self, mcnp_version):
+        """
+        Creates a string representation of this MCNP_Object that can be
+        written to file.
+
+        :param mcnp_version: The tuple for the MCNP version that must be exported to.
+        :type mcnp_version: tuple
+        :return: a list of strings for the lines that this input will occupy.
+        :rtype: list
+        """
+        lines = super().format_for_mcnp_input(mcnp_version)
+        if self.thermal_scattering is not None:
+            lines += self.thermal_scattering.format_for_mcnp_input(mcnp_version)
+        return lines
+
     def add_thermal_scattering(self, law):
         """
         Adds thermal scattering law to the material


Test patch:
diff --git a/tests/test_integration.py b/tests/test_integration.py
index 7da34589..c4ba5afb 100644
--- a/tests/test_integration.py
+++ b/tests/test_integration.py
@@ -138,6 +138,10 @@ class testFullFileIntegration(TestCase):
             for i, data in enumerate(self.simple_problem.data_inputs):
                 if isinstance(data, material.Material):
                     self.assertEqual(data.number, test_problem.data_inputs[i].number)
+                    if data.thermal_scattering is not None:
+                        assert (
+                            test_problem.data_inputs[i].thermal_scattering is not None
+                        )
                 elif isinstance(data, volume.Volume):
                     self.assertEqual(str(data), str(test_problem.data_inputs[i]))
                 else: