Repository: Fusion4Energy/F4Enix

Issue:
[BUG] - Bad writing of irradiation file when irradiation times are added to the file
**Describe the bug**
If one tries to write an Irradiation file where time correction factors were added to a nuclide (e.g. usage with IRS= flag of D1SUNED), the original formatting is kept and the file is not written correctly. Plus, in D1S_Input class, it would be convenient to add a method that checks if too low irradiation factors are present in the Irradiation file to remove them and update the Reaction File and MCNP input (PIKMT and libraries) accordingly.

**To Reproduce**
Steps to reproduce the behavior:
for example:
1. Read an irradiation file
`` for schedule in irr_file.irr_schedules:
            daughter = schedule.daughter
            if schedule.daughter != "731820":
                schedule.times = schedule.times * (len(new_df["Irradiation Scenario"])+1)
            else:
                schedules_list = new_df["D1S Irradiation factor"].tolist()
                schedule.times += schedules_list
``

**Expected behavior**
The format should adapt to the new times length, something like:
             # write schedules
            ```for schedule in self.irr_schedules:
                args = schedule._get_format_args()
                if (format):
                    outfile.write(self._irrformat.format(*args) + "\n")
                else:
                    # write the unformatted text
                    fmt = ""
                    for s in args:
                        fmt += "{:<" + str(len(str(s)) + 1) + "}"
                    outfile.write(fmt.format(*args) + "\n")```


**Desktop (please complete the following information):**
 - OS: Windows
 - F4Enix version: 0.14
 - Python version: 3.10.16

Hints from issue comments:

Solution patch:
diff --git a/docs/source/examples/input/jupyters/d1suned.ipynb b/docs/source/examples/input/jupyters/d1suned.ipynb
index 0437ea8..6d72020 100644
--- a/docs/source/examples/input/jupyters/d1suned.ipynb
+++ b/docs/source/examples/input/jupyters/d1suned.ipynb
@@ -32,7 +32,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 13,
+   "execution_count": 23,
    "metadata": {},
    "outputs": [
     {
@@ -45,7 +45,7 @@
        "comment: fake reaction"
       ]
      },
-     "execution_count": 13,
+     "execution_count": 23,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -60,27 +60,27 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 14,
+   "execution_count": 24,
    "metadata": {},
    "outputs": [
     {
      "data": {
       "text/plain": [
-       "       Parent     MT Daughter                                 Comment\n",
-       "    26054.99c    102    26055                                    Fe55\n",
-       "    26054.99c    103    25054                                    Mn54\n",
-       "    26054.99c    107    24051                                    Cr51\n",
-       "    26056.99c    105    25054                                    Mn54\n",
-       "    26056.99c    103    25056                                    Mn56\n",
-       "    26056.99c     16    26055                                    Fe55\n",
-       "    26057.99c     28    25056                                    Mn56\n",
-       "    26057.99c    104    25056                                    Mn56\n",
-       "    26058.99c    102    26059                                    Fe59\n",
-       "    26058.99c    105    25056                                    Mn56\n",
-       "    78195.99c    304 78195900                                  Pt195m"
+       "       Parent     MT    Daughter                                 Comment\n",
+       "    26054.99c    102       26055                                    Fe55\n",
+       "    26054.99c    103       25054                                    Mn54\n",
+       "    26054.99c    107       24051                                    Cr51\n",
+       "    26056.99c    105       25054                                    Mn54\n",
+       "    26056.99c    103       25056                                    Mn56\n",
+       "    26056.99c     16       26055                                    Fe55\n",
+       "    26057.99c     28       25056                                    Mn56\n",
+       "    26057.99c    104       25056                                    Mn56\n",
+       "    26058.99c    102       26059                                    Fe59\n",
+       "    26058.99c    105       25056                                    Mn56\n",
+       "    78195.99c    304    78195900                                  Pt195m"
       ]
      },
-     "execution_count": 14,
+     "execution_count": 24,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -101,25 +101,25 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 15,
+   "execution_count": 25,
    "metadata": {},
    "outputs": [
     {
      "name": "stdout",
      "output_type": "stream",
      "text": [
-      "       Parent     MT Daughter                                 Comment\n",
-      "    26054.98c    102    26055                                    Fe55\n",
-      "    26054.98c    103    25054                                    Mn54\n",
-      "    26054.98c    107    24051                                    Cr51\n",
-      "    26056.98c    105    25054                                    Mn54\n",
-      "    26056.98c    103    25056                                    Mn56\n",
-      "    26056.98c     16    26055                                    Fe55\n",
-      "    26057.98c     28    25056                                    Mn56\n",
-      "    26057.98c    104    25056                                    Mn56\n",
-      "    26058.98c    102    26059                                    Fe59\n",
-      "    26058.98c    105    25056                                    Mn56\n",
-      "    78195.98c    304 78195900                                  Pt195m\n",
+      "       Parent     MT    Daughter                                 Comment\n",
+      "    26054.98c    102       26055                                    Fe55\n",
+      "    26054.98c    103       25054                                    Mn54\n",
+      "    26054.98c    107       24051                                    Cr51\n",
+      "    26056.98c    105       25054                                    Mn54\n",
+      "    26056.98c    103       25056                                    Mn56\n",
+      "    26056.98c     16       26055                                    Fe55\n",
+      "    26057.98c     28       25056                                    Mn56\n",
+      "    26057.98c    104       25056                                    Mn56\n",
+      "    26058.98c    102       26059                                    Fe59\n",
+      "    26058.98c    105       25056                                    Mn56\n",
+      "    78195.98c    304    78195900                                  Pt195m\n",
       "\n",
       "Parent list:\n"
      ]
@@ -130,7 +130,7 @@
        "['26054', '26056', '26057', '26058', '78195']"
       ]
      },
-     "execution_count": 15,
+     "execution_count": 25,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -168,7 +168,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 16,
+   "execution_count": 26,
    "metadata": {},
    "outputs": [
     {
@@ -178,7 +178,7 @@
       "\n",
       "Daughter: 26059\n",
       "lambda [1/s]: 1800.0\n",
-      "times: ['4e3', '5e3']\n",
+      "times: ('4e3', '5e3')\n",
       "comment: Fake irr\n",
       "\n"
      ]
@@ -194,7 +194,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 17,
+   "execution_count": 27,
    "metadata": {},
    "outputs": [
     {
@@ -207,7 +207,7 @@
        " ['27062900', '8.305e-04', '4.151e-01', '1', 'Co62m']]"
       ]
      },
-     "execution_count": 17,
+     "execution_count": 27,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -228,7 +228,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 18,
+   "execution_count": 28,
    "metadata": {},
    "outputs": [
     {
@@ -238,7 +238,7 @@
       "\n",
       "Daughter: 24051\n",
       "lambda [1/s]: 2.896e-07\n",
-      "times: ['5.982e+00', '5.697e+00']\n",
+      "times: ('5.982e+00', '5.697e+00')\n",
       "comment: Cr51\n",
       "\n",
       "['24051', '25054', '26055', '27062', '27062900']\n"
@@ -253,6 +253,89 @@
     "print(irrad_file.get_daughters())"
    ]
   },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "You can also add/remove irradiation schedules and modify them:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 29,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "\n",
+      "Daughter: 24051\n",
+      "lambda [1/s]: 2.896e-07\n",
+      "times: ('5.982e+00', '5.697e+00', '5.982e+00', '5.697e+00')\n",
+      "comment: Cr51\n",
+      "\n"
+     ]
+    }
+   ],
+   "source": [
+    "new_times = {\n",
+    "    \"24051\": [\"5.982e+00\", \"5.697e+00\"],\n",
+    "    \"25054\": [\"5.881e+00\", \"1.829e+00\"],\n",
+    "    \"26055\": [\"4.487e+00\", \"6.364e-01\"],\n",
+    "    \"27062\": [\"1.336e+00\", \"4.151e-01\"],\n",
+    "    \"27062900\": [\"4.151e-01\", \"4.151e-01\"],\n",
+    "}\n",
+    "irrad_file.add_irradiation_times(new_times)\n",
+    "print(irrad_file.get_irrad('24051'))"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 30,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "\n",
+      "Daughter: 24051\n",
+      "lambda [1/s]: 2.896e-07\n",
+      "times: ('5.982e+00', '5.697e+00', '5.982e+00', '4.560e+00')\n",
+      "comment: Cr51\n",
+      "\n"
+     ]
+    }
+   ],
+   "source": [
+    "irrad_file.irr_schedules[0].modify_time_val(3, 4.56)\n",
+    "print(irrad_file.get_irrad('24051'))"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 31,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "\n",
+      "Daughter: 24051\n",
+      "lambda [1/s]: 2.896e-07\n",
+      "times: ('5.982e+00', '5.697e+00', '5.982e+00')\n",
+      "comment: Cr51\n",
+      "\n"
+     ]
+    }
+   ],
+   "source": [
+    "irrad_file.remove_irradiation_time(3)\n",
+    "print(irrad_file.get_irrad('24051'))"
+   ]
+  },
   {
    "attachments": {},
    "cell_type": "markdown",
@@ -275,7 +358,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 19,
+   "execution_count": 32,
    "metadata": {},
    "outputs": [
     {
@@ -314,7 +397,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 20,
+   "execution_count": 33,
    "metadata": {},
    "outputs": [
     {
@@ -328,22 +411,22 @@
     {
      "data": {
       "text/plain": [
-       "       Parent     MT Daughter                                 Comment\n",
-       "    24050.99c    102    24051                          Cr-50 -> Cr-51\n",
-       "    24052.99c     16    24051                          Cr-52 -> Cr-51\n",
-       "    25055.99c     16    25054                          Mn-55 -> Mn-54\n",
-       "    26054.99c    102    26055                          Fe-54 -> Fe-55\n",
-       "    26054.99c    103    25054                          Fe-54 -> Mn-54\n",
-       "    26054.99c    107    24051                          Fe-54 -> Cr-51\n",
-       "    26056.99c    105    25054                          Fe-56 -> Mn-54\n",
-       "    26056.99c     16    26055                          Fe-56 -> Fe-55\n",
-       "    26058.99c    102    26059                          Fe-58 -> Fe-59\n",
-       "    27059.99c    103    26059                          Co-59 -> Fe-59\n",
-       "    28058.99c    112    25054                          Ni-58 -> Mn-54\n",
-       "    28062.99c    107    26059                          Ni-62 -> Fe-59"
+       "       Parent     MT    Daughter                                 Comment\n",
+       "    24050.99c    102       24051                          Cr-50 -> Cr-51\n",
+       "    24052.99c     16       24051                          Cr-52 -> Cr-51\n",
+       "    25055.99c     16       25054                          Mn-55 -> Mn-54\n",
+       "    26054.99c    102       26055                          Fe-54 -> Fe-55\n",
+       "    26054.99c    103       25054                          Fe-54 -> Mn-54\n",
+       "    26054.99c    107       24051                          Fe-54 -> Cr-51\n",
+       "    26056.99c    105       25054                          Fe-56 -> Mn-54\n",
+       "    26056.99c     16       26055                          Fe-56 -> Fe-55\n",
+       "    26058.99c    102       26059                          Fe-58 -> Fe-59\n",
+       "    27059.99c    103       26059                          Co-59 -> Fe-59\n",
+       "    28058.99c    112       25054                          Ni-58 -> Mn-54\n",
+       "    28062.99c    107       26059                          Ni-62 -> Fe-59"
       ]
      },
-     "execution_count": 20,
+     "execution_count": 33,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -376,7 +459,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 21,
+   "execution_count": 34,
    "metadata": {},
    "outputs": [
     {
@@ -399,7 +482,7 @@
        " comment: Cr-52 -> Cr-51]"
       ]
      },
-     "execution_count": 21,
+     "execution_count": 34,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -427,7 +510,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 22,
+   "execution_count": 35,
    "metadata": {},
    "outputs": [
     {
@@ -435,26 +518,23 @@
      "output_type": "stream",
      "text": [
       "before:\n",
-      "0E-5     $        AB(%)     \n",
-      "      74182.99c        6.254000E-7     $        AB(%)     \n",
-      "      74183.21c        3.377160E-7     $        AB(%)     \n",
-      "      74184.21c        7.231040E-7     $        AB(%)     \n",
-      "      74186.99c        6.709480E-7     $        AB(%)     \n",
-      "      82206.21c        4.048800E-7     $        AB(%)     \n",
-      "      82207.21c        3.712800E-7     $        AB(%)     \n",
-      "      82208.21c        8.803200E-7     $        AB(%)     \n",
-      "      83209.21c        1.660000E-6     $        AB(%)     \n",
+      "AB(%)     \n",
+      "      74183.21c        3.377160E-7     $        WEIGHT(%)  AB(%)     \n",
+      "      74184.21c        7.231040E-7     $        WEIGHT(%)  AB(%)     \n",
+      "      74186.99c        6.709480E-7     $        WEIGHT(%)  AB(%)     \n",
+      "      82206.21c        4.048800E-7     $        WEIGHT(%)  AB(%)     \n",
+      "      82207.21c        3.712800E-7     $        WEIGHT(%)  AB(%)     \n",
+      "      82208.21c        8.803200E-7     $        WEIGHT(%)  AB(%)     \n",
+      "      83209.21c        1.660000E-6     $        WEIGHT(%)  AB(%)     \n",
       "\n",
       "after:\n",
-      "1 AB(%) 100.0\n",
-      "      74182.98c        6.254000E-7     $ W-182  AB(%) 26.532\n",
-      "      74183.31c        3.377160E-7     $ W-183  AB(%) 14.327\n",
-      "      74184.31c        7.231040E-7     $ W-184  AB(%) 30.677\n",
-      "      74186.98c        6.709480E-7     $ W-186  AB(%) 28.464\n",
-      "      82206.31c        4.048800E-7     $ Pb-206 AB(%) 24.442\n",
-      "      82207.31c        3.712800E-7     $ Pb-207 AB(%) 22.414\n",
-      "      82208.31c        8.803200E-7     $ Pb-208 AB(%) 53.144\n",
-      "      83209.31c        1.660000E-6     $ Bi-209 AB(%) 100.0\n",
+      "%) 14.327\n",
+      "      74184.31c        7.231040E-7     $ W-184  WEIGHT(%) 0.00096798 AB(%) 30.677\n",
+      "      74186.98c        6.709480E-7     $ W-186  WEIGHT(%) 0.00096798 AB(%) 28.464\n",
+      "      82206.31c        4.048800E-7     $ Pb-206 WEIGHT(%) 0.00076688 AB(%) 24.442\n",
+      "      82207.31c        3.712800E-7     $ Pb-207 WEIGHT(%) 0.00076688 AB(%) 22.414\n",
+      "      82208.31c        8.803200E-7     $ Pb-208 WEIGHT(%) 0.00076688 AB(%) 53.144\n",
+      "      83209.31c        1.660000E-6     $ Bi-209 WEIGHT(%) 0.00077488 AB(%) 100.0\n",
       "\n",
       "reac file:\n"
      ]
@@ -462,21 +542,21 @@
     {
      "data": {
       "text/plain": [
-       "       Parent     MT Daughter                                 Comment\n",
-       "    26054.98c    102    26055                                    Fe55\n",
-       "    26054.98c    103    25054                                    Mn54\n",
-       "    26054.98c    107    24051                                    Cr51\n",
-       "    26056.98c    105    25054                                    Mn54\n",
-       "    26056.98c    103    25056                                    Mn56\n",
-       "    26056.98c     16    26055                                    Fe55\n",
-       "    26057.98c     28    25056                                    Mn56\n",
-       "    26057.98c    104    25056                                    Mn56\n",
-       "    26058.98c    102    26059                                    Fe59\n",
-       "    26058.98c    105    25056                                    Mn56\n",
-       "    78195.98c    304 78195900                                  Pt195m"
+       "       Parent     MT    Daughter                                 Comment\n",
+       "    26054.98c    102       26055                                    Fe55\n",
+       "    26054.98c    103       25054                                    Mn54\n",
+       "    26054.98c    107       24051                                    Cr51\n",
+       "    26056.98c    105       25054                                    Mn54\n",
+       "    26056.98c    103       25056                                    Mn56\n",
+       "    26056.98c     16       26055                                    Fe55\n",
+       "    26057.98c     28       25056                                    Mn56\n",
+       "    26057.98c    104       25056                                    Mn56\n",
+       "    26058.98c    102       26059                                    Fe59\n",
+       "    26058.98c    105       25056                                    Mn56\n",
+       "    78195.98c    304    78195900                                  Pt195m"
       ]
      },
-     "execution_count": 22,
+     "execution_count": 35,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -519,43 +599,44 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 23,
+   "execution_count": 36,
    "metadata": {},
    "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "before:\n",
+      "      23050.31c        3.400000E-6     $ V-50   WEIGHT(%) 0.15475 AB(%) 0.25\n",
+      "      23051.31c        1.356600E-3     $ V-51   WEIGHT(%) 0.15475 AB(%) 99.75\n",
+      "      24050.31c        6.343700E-3     $ Cr-50  WEIGHT(%) 16.957 AB(%) 4.345\n",
+      "      24052.31c        1.223320E-1     $ Cr-52  WEIGHT(%) 16.957 AB(%) 83.789\n",
+      "      24053.31c        1.387150E-2     $ Cr-53  WEIGHT(%) 16.957 AB(%) 9.501\n",
+      "      24054.31c        3.452900E-3     $ Cr-54  WEIGHT(%) 16.957 AB(%) 2.365\n",
+      "      25055.31c        1.420000E-2  \n"
+     ]
+    },
     {
      "name": "stderr",
      "output_type": "stream",
      "text": [
-      "WARNING:root: The Default library 81c was used for zaid 1001\n"
+      "D:\\F4Enix\\src\\f4enix\\input\\libmanager.py:446: UserWarning:  The Default library 81c was used for zaid 1001\n",
+      "  warnings.warn(MSG_DEFLIB.format(self.defaultlib, zaid))\n"
      ]
     },
     {
      "name": "stdout",
      "output_type": "stream",
      "text": [
-      "before:\n",
-      "(%) 5.845\n",
-      "      26056.31c        4.615230E-1     $ Fe-56  AB(%) 91.754\n",
-      "      26057.31c        1.065860E-2     $ Fe-57  AB(%) 2.119\n",
-      "      26058.31c        1.418460E-3     $ Fe-58  AB(%) 0.282\n",
-      "      27059.31c        3.680000E-4     $ Co-59  AB(%) 100.0\n",
-      "      28058.31c        6.167770E-2     $ Ni-58  AB(%) 68.077\n",
-      "      28060.31c        2.375810E-2     $ Ni-60  AB(%) 26.223\n",
-      "      28061.31c        1.032750E-3     $ Ni-61  AB(%) 1.1399\n",
-      "      28062.31c        3.292860E-3     $ Ni-62  AB(%) 3.6345\n",
-      "     \n",
       "\n",
       "after:\n",
-      "(%) 5.845\n",
-      "      26056.99c        4.615230E-1     $ Fe-56  AB(%) 91.754\n",
-      "      26057.99c        1.065860E-2     $ Fe-57  AB(%) 2.119\n",
-      "      26058.99c        1.418460E-3     $ Fe-58  AB(%) 0.282\n",
-      "      27059.00c        3.680000E-4     $ Co-59  AB(%) 100.0\n",
-      "      28058.00c        6.167770E-2     $ Ni-58  AB(%) 68.077\n",
-      "      28060.00c        2.375810E-2     $ Ni-60  AB(%) 26.223\n",
-      "      28061.00c        1.032750E-3     $ Ni-61  AB(%) 1.1399\n",
-      "      28062.00c        3.292860E-3     $ Ni-62  AB(%) 3.6345\n",
-      "     \n"
+      "      23050.00c        3.400000E-6     $ V-50   WEIGHT(%) 0.15475 AB(%) 0.25\n",
+      "      23051.00c        1.356600E-3     $ V-51   WEIGHT(%) 0.15475 AB(%) 99.75\n",
+      "      24050.00c        6.343700E-3     $ Cr-50  WEIGHT(%) 16.957 AB(%) 4.345\n",
+      "      24052.00c        1.223320E-1     $ Cr-52  WEIGHT(%) 16.957 AB(%) 83.789\n",
+      "      24053.00c        1.387150E-2     $ Cr-53  WEIGHT(%) 16.957 AB(%) 9.501\n",
+      "      24054.00c        3.452900E-3     $ Cr-54  WEIGHT(%) 16.957 AB(%) 2.365\n",
+      "      25055.00c        1.420000E-2  \n"
      ]
     }
    ],
@@ -584,7 +665,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 24,
+   "execution_count": 37,
    "metadata": {},
    "outputs": [
     {
@@ -598,12 +679,9 @@
       "         26058    0\n",
       "         78195    0\n",
       "\n",
-      "c\n",
-      "C ---------------- Dose Calculation --------------------------------------------\n",
-      "C    tally  *    ICF           *      DF        *   Sv/pSv       *     s/h    \n",
-      "C [p/cm^2/#]* 1.0714e17 [#/s]) * [pSv/(p/cm^2)] * 1e-12 [Sv/pSv] * 3600 [s/h] \n",
-      "C ------------------------------------------------------------------------------\n",
-      "F124:p 10 11 12 13\n",
+      "DF124 LOG  0.0485 0.1254 0.205 0.2999 0.3381 0.3572 0.378 0.4066 0.4399\n",
+      "          0.5172 0.7523 1.0041 1.5083 1.9958 2.4657 2.9082 3.7269 4.4834\n",
+      "          7.4896 12.0153 15.9873 19.9191 23.76\n",
       "FU124 0\n",
       "         -26054\n",
       "\n"
@@ -626,7 +704,7 @@
  ],
  "metadata": {
   "kernelspec": {
-   "display_name": "pipenv",
+   "display_name": "jade",
    "language": "python",
    "name": "python3"
   },
@@ -640,7 +718,7 @@
    "name": "python",
    "nbconvert_exporter": "python",
    "pygments_lexer": "ipython3",
-   "version": "3.11.7"
+   "version": "3.10.16"
   }
  },
  "nbformat": 4,
diff --git a/docs/source/examples/output/jupyters/mcnp_out.ipynb b/docs/source/examples/output/jupyters/mcnp_out.ipynb
index 2abaac7..45295c5 100644
--- a/docs/source/examples/output/jupyters/mcnp_out.ipynb
+++ b/docs/source/examples/output/jupyters/mcnp_out.ipynb
@@ -23,7 +23,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 1,
+   "execution_count": 2,
    "metadata": {},
    "outputs": [
     {
@@ -32,7 +32,7 @@
        "'1.30E+06'"
       ]
      },
-     "execution_count": 1,
+     "execution_count": 2,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -50,7 +50,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 2,
+   "execution_count": 3,
    "metadata": {},
    "outputs": [
     {
@@ -59,7 +59,7 @@
        "'6.2'"
       ]
      },
-     "execution_count": 2,
+     "execution_count": 3,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -71,7 +71,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 3,
+   "execution_count": 4,
    "metadata": {},
    "outputs": [
     {
@@ -337,7 +337,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 4,
+   "execution_count": 5,
    "metadata": {},
    "outputs": [
     {
@@ -374,7 +374,7 @@
        "      <th>Other TFC bins</th>\n",
        "    </tr>\n",
        "    <tr>\n",
-       "      <th>Cell</th>\n",
+       "      <th>Tally</th>\n",
        "      <th></th>\n",
        "      <th></th>\n",
        "      <th></th>\n",
@@ -716,86 +716,86 @@
        "</div>"
       ],
       "text/plain": [
-       "     mean behaviour rel error value rel error decrease  \\\n",
-       "Cell                                                     \n",
-       "4               yes             yes                yes   \n",
-       "6               yes             yes                yes   \n",
-       "14              yes             yes                yes   \n",
-       "16              yes             yes                yes   \n",
-       "24              yes             yes                yes   \n",
-       "26              yes             yes                yes   \n",
-       "34              yes             yes                yes   \n",
-       "44              yes             yes                yes   \n",
-       "54              yes             yes                yes   \n",
-       "64              yes             yes                yes   \n",
-       "74              yes             yes                yes   \n",
-       "84              yes             yes                yes   \n",
-       "94              yes             yes                yes   \n",
-       "104             yes             yes                yes   \n",
-       "114             yes             yes                yes   \n",
-       "124             yes             yes                yes   \n",
-       "134             yes             yes                yes   \n",
-       "144             yes             yes                yes   \n",
-       "154             yes             yes                yes   \n",
-       "164             yes             yes                yes   \n",
-       "174             yes             yes                yes   \n",
-       "204             yes             yes                yes   \n",
-       "214             yes             yes                yes   \n",
+       "      mean behaviour rel error value rel error decrease  \\\n",
+       "Tally                                                     \n",
+       "4                yes             yes                yes   \n",
+       "6                yes             yes                yes   \n",
+       "14               yes             yes                yes   \n",
+       "16               yes             yes                yes   \n",
+       "24               yes             yes                yes   \n",
+       "26               yes             yes                yes   \n",
+       "34               yes             yes                yes   \n",
+       "44               yes             yes                yes   \n",
+       "54               yes             yes                yes   \n",
+       "64               yes             yes                yes   \n",
+       "74               yes             yes                yes   \n",
+       "84               yes             yes                yes   \n",
+       "94               yes             yes                yes   \n",
+       "104              yes             yes                yes   \n",
+       "114              yes             yes                yes   \n",
+       "124              yes             yes                yes   \n",
+       "134              yes             yes                yes   \n",
+       "144              yes             yes                yes   \n",
+       "154              yes             yes                yes   \n",
+       "164              yes             yes                yes   \n",
+       "174              yes             yes                yes   \n",
+       "204              yes             yes                yes   \n",
+       "214              yes             yes                yes   \n",
        "\n",
-       "     rel error decrease rate VoV value VoV decrease VoV decrease rate  \\\n",
-       "Cell                                                                    \n",
-       "4                        yes       yes          yes               yes   \n",
-       "6                        yes       yes          yes               yes   \n",
-       "14                       yes       yes          yes               yes   \n",
-       "16                       yes       yes          yes               yes   \n",
-       "24                       yes       yes          yes               yes   \n",
-       "26                       yes       yes          yes               yes   \n",
-       "34                       yes       yes          yes               yes   \n",
-       "44                       yes       yes          yes               yes   \n",
-       "54                       yes       yes          yes               yes   \n",
-       "64                       yes       yes          yes               yes   \n",
-       "74                       yes       yes          yes               yes   \n",
-       "84                       yes       yes          yes               yes   \n",
-       "94                       yes       yes          yes               yes   \n",
-       "104                      yes       yes          yes               yes   \n",
-       "114                      yes       yes          yes               yes   \n",
-       "124                      yes       yes          yes               yes   \n",
-       "134                      yes       yes          yes               yes   \n",
-       "144                      yes       yes          yes               yes   \n",
-       "154                      yes       yes          yes               yes   \n",
-       "164                      yes       yes          yes               yes   \n",
-       "174                      yes       yes          yes               yes   \n",
-       "204                      yes       yes          yes               yes   \n",
-       "214                      yes       yes          yes               yes   \n",
+       "      rel error decrease rate VoV value VoV decrease VoV decrease rate  \\\n",
+       "Tally                                                                    \n",
+       "4                         yes       yes          yes               yes   \n",
+       "6                         yes       yes          yes               yes   \n",
+       "14                        yes       yes          yes               yes   \n",
+       "16                        yes       yes          yes               yes   \n",
+       "24                        yes       yes          yes               yes   \n",
+       "26                        yes       yes          yes               yes   \n",
+       "34                        yes       yes          yes               yes   \n",
+       "44                        yes       yes          yes               yes   \n",
+       "54                        yes       yes          yes               yes   \n",
+       "64                        yes       yes          yes               yes   \n",
+       "74                        yes       yes          yes               yes   \n",
+       "84                        yes       yes          yes               yes   \n",
+       "94                        yes       yes          yes               yes   \n",
+       "104                       yes       yes          yes               yes   \n",
+       "114                       yes       yes          yes               yes   \n",
+       "124                       yes       yes          yes               yes   \n",
+       "134                       yes       yes          yes               yes   \n",
+       "144                       yes       yes          yes               yes   \n",
+       "154                       yes       yes          yes               yes   \n",
+       "164                       yes       yes          yes               yes   \n",
+       "174                       yes       yes          yes               yes   \n",
+       "204                       yes       yes          yes               yes   \n",
+       "214                       yes       yes          yes               yes   \n",
        "\n",
-       "     FoM value FoM behaviour PDF slope Other TFC bins  \n",
-       "Cell                                                   \n",
-       "4          yes           yes       yes         Passed  \n",
-       "6          yes           yes       yes         Passed  \n",
-       "14         yes           yes       yes         Passed  \n",
-       "16         yes           yes       yes         Passed  \n",
-       "24         yes           yes       yes         Passed  \n",
-       "26         yes           yes       yes         Passed  \n",
-       "34         yes           yes       yes         Passed  \n",
-       "44         yes           yes       yes         Passed  \n",
-       "54         yes           yes       yes         Passed  \n",
-       "64         yes           yes       yes         Passed  \n",
-       "74         yes            no       yes         Missed  \n",
-       "84         yes            no       yes         Missed  \n",
-       "94         yes            no       yes         Missed  \n",
-       "104        yes           yes       yes         Passed  \n",
-       "114        yes           yes       yes         Passed  \n",
-       "124        yes           yes       yes         Passed  \n",
-       "134        yes           yes       yes         Passed  \n",
-       "144        yes           yes       yes         Passed  \n",
-       "154        yes           yes       yes         Passed  \n",
-       "164        yes           yes       yes         Passed  \n",
-       "174        yes           yes       yes         Passed  \n",
-       "204        yes           yes       yes         Passed  \n",
-       "214        yes           yes       yes         Passed  "
+       "      FoM value FoM behaviour PDF slope Other TFC bins  \n",
+       "Tally                                                   \n",
+       "4           yes           yes       yes         Passed  \n",
+       "6           yes           yes       yes         Passed  \n",
+       "14          yes           yes       yes         Passed  \n",
+       "16          yes           yes       yes         Passed  \n",
+       "24          yes           yes       yes         Passed  \n",
+       "26          yes           yes       yes         Passed  \n",
+       "34          yes           yes       yes         Passed  \n",
+       "44          yes           yes       yes         Passed  \n",
+       "54          yes           yes       yes         Passed  \n",
+       "64          yes           yes       yes         Passed  \n",
+       "74          yes            no       yes         Missed  \n",
+       "84          yes            no       yes         Missed  \n",
+       "94          yes            no       yes         Missed  \n",
+       "104         yes           yes       yes         Passed  \n",
+       "114         yes           yes       yes         Passed  \n",
+       "124         yes           yes       yes         Passed  \n",
+       "134         yes           yes       yes         Passed  \n",
+       "144         yes           yes       yes         Passed  \n",
+       "154         yes           yes       yes         Passed  \n",
+       "164         yes           yes       yes         Passed  \n",
+       "174         yes           yes       yes         Passed  \n",
+       "204         yes           yes       yes         Passed  \n",
+       "214         yes           yes       yes         Passed  "
       ]
      },
-     "execution_count": 4,
+     "execution_count": 5,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -807,7 +807,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 5,
+   "execution_count": 6,
    "metadata": {},
    "outputs": [
     {
@@ -920,7 +920,7 @@
        "passed?                         yes       yes            no       yes  "
       ]
      },
-     "execution_count": 5,
+     "execution_count": 6,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -932,7 +932,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 6,
+   "execution_count": 7,
    "metadata": {},
    "outputs": [
     {
@@ -952,7 +952,7 @@
        "dtype: int64"
       ]
      },
-     "execution_count": 6,
+     "execution_count": 7,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -962,6 +962,33 @@
     "outp.get_warnings()[:10]  # show only 10"
    ]
   },
+  {
+   "cell_type": "code",
+   "execution_count": 8,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "['no m card for material no. 1',\n",
+       " 'surface        5 of tally       22 not found.',\n",
+       " 'FILES card is missing.',\n",
+       " 'photon material        1 is not defined.',\n",
+       " '1 tally volumes or areas were not input nor calculated.']"
+      ]
+     },
+     "execution_count": 8,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "# get all fatal errors encountered in the simulation\n",
+    "# Parse the output file\n",
+    "outp = Output(\"outp_fatal\")\n",
+    "outp.get_fatal_errors()"
+   ]
+  },
   {
    "attachments": {},
    "cell_type": "markdown",
@@ -972,7 +999,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 7,
+   "execution_count": 9,
    "metadata": {},
    "outputs": [
     {
@@ -981,7 +1008,7 @@
        "677"
       ]
      },
-     "execution_count": 7,
+     "execution_count": 9,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -994,7 +1021,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 8,
+   "execution_count": 10,
    "metadata": {},
    "outputs": [
     {
@@ -1003,7 +1030,7 @@
        "0.06763236763236763"
       ]
      },
-     "execution_count": 8,
+     "execution_count": 10,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -1015,7 +1042,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 9,
+   "execution_count": 11,
    "metadata": {},
    "outputs": [],
    "source": [
diff --git a/src/f4enix/input/d1suned.py b/src/f4enix/input/d1suned.py
index ad09bdd..0313b5b 100644
--- a/src/f4enix/input/d1suned.py
+++ b/src/f4enix/input/d1suned.py
@@ -100,25 +100,36 @@ class IrradiationFile:
         None.
 
         """
-        self.nsc = nsc
+        self._nsc = nsc
         self.irr_schedules = irr_schedules
         self.header = header
         self.formatting = formatting
 
+        self._update_irrformat()  # Update the irradiation format string
+
+        self.name = name
+
+    @property
+    def nsc(self) -> int:
+        """Get the number of irradiation schedules."""
+        return self._nsc
+
+    def _update_irrformat(self) -> None:
+        """
+        Update the irradiation format string (_irrformat) based on self.nsc and self.formatting.
+        """
         # Compute irradiation header
-        w1 = str(formatting[0])
-        w2 = str(formatting[1])
-        w3 = str(formatting[2])
-        w4 = str(formatting[3])
+        w1 = str(self.formatting[0])
+        w2 = str(self.formatting[1])
+        w3 = str(self.formatting[2])
+        w4 = str(self.formatting[3])
 
         head = "{:>" + w1 + "s}{:>" + w2 + "s}{:>"
-        for i in range(nsc):
+        for _ in range(self.nsc):
             head += w3 + "s}{:>"
 
         head += w4 + "s}"
-
         self._irrformat = head
-        self.name = name
 
     def get_daughters(self) -> list[str]:
         """
@@ -269,6 +280,91 @@ class IrradiationFile:
         self.irr_schedules = new_irradiations
         return ans
 
+    def add_irradiation_times(self, times_dict: dict[str, list[str]]) -> None:
+        """
+        Add irradiation times to all daughters in the irradiation schedules.
+
+        This method updates the time correction factors for each daughter in the
+        irradiation schedules by appending the new times provided in the `times_dict`.
+        It ensures that all daughters have the same number of time correction factors
+        after the update. If the lengths of the time correction factors are inconsistent,
+        an error is raised.
+
+        Parameters
+        ----------
+        times_dict : dict[str, list[str]]
+            A dictionary where keys are daughter ZAIDs (strings) and values are
+            lists of time correction factors to be added.
+
+        Raises
+        ------
+        ValueError
+            If the lengths of the times lists are not equal after adding.
+        """
+        # Ensure all input time correction factor lists in `times_dict` are of the same length
+        input_lengths = {len(times) for times in times_dict.values()}
+        if len(input_lengths) > 1:
+            raise ValueError(
+                "All input time correction factor lists in `times_dict` must have the same length."
+            )
+        # Ensure all daughters in `self.irr_schedules` have a corresponding entry in `times_dict`
+        daughters_in_schedules = {
+            irradiation.daughter for irradiation in self.irr_schedules
+        }
+        # Ensure there are no extra keys in `times_dict` that are not in the daughters
+        for key in times_dict:
+            if key not in daughters_in_schedules:
+                raise KeyError(
+                    f"Invalid key '{key}' provided. It does not match any daughter."
+                )
+
+        for daughter in daughters_in_schedules:
+            if daughter not in times_dict:
+                raise KeyError(
+                    f"No time correction factors provided for daughter {daughter}."
+                )
+
+        # Add the new times to each daughter
+        for irradiation in self.irr_schedules:
+            irradiation._times.extend(times_dict[irradiation.daughter])
+
+        # Ensure all times lists have the same length
+        max_length = max(len(irradiation.times) for irradiation in self.irr_schedules)
+
+        # Update the number of schedules (nsc)
+        self._nsc = max_length
+
+        # Update the irradiation format
+        self._update_irrformat()
+
+    def remove_irradiation_time(self, index: int) -> None:
+        """
+        Remove a time correction factor from all daughters by index.
+
+        Parameters
+        ----------
+        index : int
+            The index of the time correction factor to be removed.
+
+        Raises
+        ------
+        IndexError
+            If the provided index is out of range for any daughter's times list.
+        """
+        for irradiation in self.irr_schedules:
+            if index < 0 or index >= len(irradiation.times):
+                raise IndexError(
+                    f"Index {index} is out of range for daughter {irradiation.daughter}."
+                )
+            # Remove the time correction factor at the specified index
+            irradiation._times.pop(index)
+
+        # Update the number of schedules (nsc) to reflect the new maximum length
+        self._nsc = self._nsc - 1
+
+        # Update the irradiation format
+        self._update_irrformat()
+
 
 class Irradiation:
     def __init__(
@@ -308,9 +404,14 @@ class Irradiation:
         """
         self.daughter = daughter
         self.lambd = lambd
-        self.times = times
+        self._times = times
         self.comment = comment
 
+    @property
+    def times(self) -> tuple[str, ...]:
+        """Get the time correction factors as an immutable tuple."""
+        return tuple(self._times)
+
     def __eq__(self, other) -> bool:
         """
         Get a more appropriate equivalence function. Two irradiation are equal
@@ -334,6 +435,28 @@ class Irradiation:
         else:
             return False
 
+    def modify_time_val(self, index: int, new_value: float) -> None:
+        """
+        Modify a value in the times list at the specified index.
+
+        Parameters
+        ----------
+        index : int
+            The index of the value to be modified.
+        new_value : float
+            The new value to be assigned, which will be converted to a string.
+
+        Raises
+        ------
+        IndexError
+            If the provided index is out of range for the times list.
+        """
+        if index < 0 or index >= len(self._times):
+            raise IndexError(f"Index {index} is out of range for the times list.")
+
+        # Convert the new value to a string and assign it to the specified index
+        self._times[index] = f"{new_value:.3e}"  # Format as scientific notation
+
     @classmethod
     def from_text(cls, text: str, nsc: int) -> Irradiation:
         """
@@ -395,7 +518,9 @@ Daughter: {}
 lambda [1/s]: {}
 times: {}
 comment: {}
-""".format(self.daughter, self.lambd, self.times, self.comment)
+""".format(
+            self.daughter, self.lambd, self.times, self.comment
+        )
 
         return text
 
@@ -656,7 +781,9 @@ parent: {}
 MT channel: {}
 daughter: {}
 comment: {}
-""".format(self.parent, self.MT, self.daughter, self.comment)
+""".format(
+            self.parent, self.MT, self.daughter, self.comment
+        )
         return text
 
     @classmethod
diff --git a/src/f4enix/input/materials.py b/src/f4enix/input/materials.py
index b6d1be8..178ad3d 100644
--- a/src/f4enix/input/materials.py
+++ b/src/f4enix/input/materials.py
@@ -1719,9 +1719,7 @@ class MatCardsList(Sequence):
         for materialname, percentage in zip(materials, percentages):
             materialname = materialname.upper()
             percentage_str = str(round(float(percentage) * 100, 2)) + "%"
-            main_header = "{}C Material: {} Percentage: {} ({})\n".format(
-                main_header, materialname, percentage_str, fractiontype
-            )
+            main_header = f"{main_header}C Material: {materialname} Percentage: {percentage_str} ({fractiontype})\n"
             material = copy.deepcopy(self[materialname])
             # Ensure materials have the requested fraction type
             material.switch_fraction(fractiontype, libmanager)
@@ -1736,17 +1734,19 @@ class MatCardsList(Sequence):
                     norm_factor = -norm_factor
                 submat.scale_fractions(norm_factor)
                 # Add info to the header in order to back-trace the generation
-                submat.header = "C {}, submaterial {}\n{}".format(
-                    materialname, j + 1, submat.header
-                )
+                if submat.header is None:
+                    comment = "C no submat header"
+                else:
+                    comment = submat.header
+                submat.header = f"C {materialname}, submaterial {j + 1}\n{comment}"
                 # Drop additional keys if present
                 submat.additional_keys = []
                 current_submaterials.append(submat)
 
             # Change the header of the first submaterial to include the mat. 1
-            new_sub_header = (material.header + current_submaterials[0].header).strip(
-                "\n"
-            )
+            new_sub_header = (
+                str(material.header).strip("\n") + "\n" + current_submaterials[0].header
+            ).strip("\n")
             current_submaterials[0].header = new_sub_header
             submaterials.extend(current_submaterials)
 
diff --git a/src/f4enix/output/MCNPoutput.py b/src/f4enix/output/MCNPoutput.py
index fcf71f5..dc3095d 100644
--- a/src/f4enix/output/MCNPoutput.py
+++ b/src/f4enix/output/MCNPoutput.py
@@ -39,6 +39,7 @@ TOTAL_LP = "particles got lost"
 # -- Patterns --
 PAT_NPS_LINE = re.compile(r" source")
 PAT_WARNING = re.compile(r"warning\.")
+PAT_FATAL = re.compile(r"[\s\t]+fatal error")
 
 STAT_CHECKS_COLUMNS = [
     "TFC bin behaviour",
@@ -712,3 +713,19 @@ class Output:
 
         df = pd.DataFrame(warnings, columns=["Warning"])
         return df.groupby("Warning").size()
+
+    def get_fatal_errors(self) -> list[str]:
+        """Get the fatal errors from the output file.
+
+        Returns
+        -------
+        list[str]
+            list of fatal errors
+        """
+        fatal_errors = []
+        for line in self.lines:
+            if PAT_FATAL.match(line):
+                error = line.split("fatal error.")[-1].strip()
+                fatal_errors.append(error)
+
+        return fatal_errors


Test patch:
diff --git a/tests/MCNPoutput_test.py b/tests/MCNPoutput_test.py
index a637db3..03ec6b7 100644
--- a/tests/MCNPoutput_test.py
+++ b/tests/MCNPoutput_test.py
@@ -1,12 +1,13 @@
-from importlib.resources import files, as_file
-import pandas as pd
 import os
+from importlib.resources import as_file, files
 
-from f4enix.output.MCNPoutput import Output
+import pandas as pd
+import pytest
+
+import tests.resources.output as resources
 from f4enix.input.MCNPinput import Input
+from f4enix.output.MCNPoutput import Output
 from f4enix.output.mctal import Mctal
-import tests.resources.output as resources
-import pytest
 
 RESOURCES = files(resources)
 
@@ -139,3 +140,10 @@ class TestOutput:
         df_2 = outp.assign_tally_description(df, mctal.tallies)
         assert len(df_2) == 11
         assert df_2["Neutron heating F6 [6]"] == "Passed"
+
+    def test_get_fatal_errors(self):
+        with as_file(RESOURCES.joinpath("outp_fatal")) as file:
+            outp = Output(file)
+        errors = outp.get_fatal_errors()
+        assert len(errors) == 5
+        assert errors[-1] == "1 tally volumes or areas were not input nor calculated."
diff --git a/tests/d1suned_test.py b/tests/d1suned_test.py
index 3f63cf4..41b42da 100644
--- a/tests/d1suned_test.py
+++ b/tests/d1suned_test.py
@@ -94,6 +94,72 @@ class TestIrradiationFile:
         assert irrfile.irr_schedules[0].daughter == "24051"
         assert irrfile.irr_schedules[1].daughter == "26055"
 
+    def test_multiple_irradiations(self, tmpdir):
+        """
+        Test multiple irradiation lines
+        """
+        with as_file(RESOURCES.joinpath("irr_test")) as inp:
+            irrfile = IrradiationFile.from_text(inp)
+
+        # Test for KeyError when a daughter is missing in times_dict
+        missing_key_times = {
+            "24051": ["5.982e+00", "5.697e+00"],
+            "26055": ["4.487e+00", "6.364e-01"],
+            # Missing "25054" and other daughters
+        }
+        with pytest.raises(KeyError, match="No time correction factors provided"):
+            irrfile.add_irradiation_times(missing_key_times)
+
+        # Test for KeyError when an invalid key is provided in times_dict
+        invalid_key_times = {
+            "24051": ["5.982e+00", "5.697e+00"],
+            "25054": ["5.881e+00", "1.829e+00"],
+            "99999": ["4.487e+00", "6.364e-01"],  # Invalid key
+        }
+        with pytest.raises(
+            KeyError,
+            match="Invalid key '99999' provided. It does not match any daughter.",
+        ):
+            irrfile.add_irradiation_times(invalid_key_times)
+
+        # Test for ValueError when lists of different lengths are provided
+        extra_times = {
+            "24051": ["5.982e+00", "5.697e+00"],
+            "25054": ["5.881e+00", "1.829e+00"],
+            "26055": ["4.487e+00", "6.364e-01"],
+            "26059": ["6.645e+00", "5.651e+00"],
+            "27062": ["1.336e+00", "4.151e-01"],
+            "27062900": ["4.151e-01", "4.151e-01", "1.0e+00"],  # Extra value
+        }
+        with pytest.raises(
+            ValueError,
+            match="All input time correction factor lists in `times_dict` must have the same length.",
+        ):
+            irrfile.add_irradiation_times(extra_times)
+
+        new_times = {
+            "24051": ["5.982e+00", "5.697e+00"],
+            "25054": ["5.881e+00", "1.829e+00"],
+            "26055": ["4.487e+00", "6.364e-01"],
+            "26059": ["6.645e+00", "5.651e+00"],
+            "27062": ["1.336e+00", "4.151e-01"],
+            "27062900": ["4.151e-01", "4.151e-01"],
+        }
+        irrfile.add_irradiation_times(new_times)
+
+        assert irrfile.nsc == 4
+        irrfile.write(tmpdir)
+
+        new_irrfile_path = os.path.join(tmpdir, "irrad")
+        new_irrfile = IrradiationFile.from_text(new_irrfile_path)
+        assert new_irrfile.nsc == 4
+        assert new_irrfile.irr_schedules[0].times[-1] == "5.697e+00"
+        new_irrfile.remove_irradiation_time(3)
+        assert new_irrfile.nsc == 3
+        assert new_irrfile.irr_schedules[0].times[-1] == "5.982e+00"
+        irrfile.irr_schedules[0].modify_time_val(3, 4.56)
+        assert float(irrfile.irr_schedules[0].times[3]) == 4.56
+
 
 class TestIrradiation:
 
diff --git a/tests/materials_test.py b/tests/materials_test.py
index 4e294ae..20c88c9 100644
--- a/tests/materials_test.py
+++ b/tests/materials_test.py
@@ -540,6 +540,43 @@ class TestMatCardList:
         )
         assert matcard["m1"].submaterials[0].zaidList[1].fraction > 0
 
+    def test_generate_material_from_created_materials(self):
+        materials = MatCardsList([])
+        zaids = [("1001", -100), ("B-0", -200), ("C-12", -50)]
+        newmat = Material.from_zaids(zaids, LIBMAN, "31c", "B4CH2", 302)
+        materials.append(newmat)
+        zaids = [("1001", 2), ("O-0", 1)]
+        newmat = Material.from_zaids(zaids, LIBMAN, "31c", "Water", 400)
+        materials.append(newmat)
+        newmat = materials.generate_material(
+            ["M302", "M400"],
+            [0.2, 0.8],
+            "31c",
+            LIBMAN,
+            fractiontype="atom",
+            mat_name="M500",
+        )
+        assert (
+            newmat.to_text()
+            == """C Material: M302 Percentage: 20.0% (atom)
+C Material: M400 Percentage: 80.0% (atom)
+M500
+C B4CH2
+C M302, submaterial 1
+C no submat header
+       1001.31c        1.628143E-1     $ H-1    WEIGHT(%) 28.571 AB(%) 100.0
+       5010.31c        5.963525E-3     $ B-10   WEIGHT(%) 57.143 AB(%) 19.65
+       5011.31c        2.438520E-2     $ B-11   WEIGHT(%) 57.143 AB(%) 80.35
+       6012.31c        6.837012E-3     $ C-12   WEIGHT(%) 14.286 AB(%) 100.0
+C Water
+C M400, submaterial 1
+C no submat header
+       1001.31c        5.333336E-1     $ H-1    WEIGHT(%) 11.189 AB(%) 100.0
+       8016.31c        2.660188E-1     $ O-16   WEIGHT(%) 88.811 AB(%) 99.757
+       8017.31c        1.022667E-4     $ O-17   WEIGHT(%) 88.811 AB(%) 0.03835
+       8018.31c        5.453336E-4     $ O-18   WEIGHT(%) 88.811 AB(%) 0.2045"""
+        )
+
 
 def compare_without_dollar_comments(text_A: str, text_B: str):
     # strip all dollars