We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
MicroXS reactions arg in docsstring not available to users
While reading through the MicroXS class I noted we have an argument in the doc string called ```reactions``` but no option for the user to set it as it is not an accepted arg keyword.

https://github.com/openmc-dev/openmc/blob/6c7f857e1e98ce4fd5b39d8be034308596628d7e/openmc/deplete/microxs.py#L58

```reactions``` is however defined few lines later by this function call ```reactions, diluted_materials = cls._add_dilute_nuclides(chain_file,```

perhaps we are missing some logic checks to see if the user sets reactions and if not then if finds them?

If so I think I can make a PR with some if statement to fix that



--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `openmc/deplete/microxs.py`
Content:
```
1 """MicroXS module
2 
3 A pandas.DataFrame storing microscopic cross section data with
4 nuclide names as row indices and reaction names as column indices.
5 """
6 
7 import tempfile
8 from copy import deepcopy
9 
10 from pandas import DataFrame, read_csv
11 import numpy as np
12 
13 from openmc.checkvalue import check_type, check_value, check_iterable_type
14 from openmc.exceptions import DataError
15 from openmc.mgxs import EnergyGroups, ArbitraryXS, FissionXS
16 from openmc import Tallies, StatePoint, Materials
17 import openmc
18 from .chain import Chain, REACTIONS
19 from .coupled_operator import _find_cross_sections, _get_nuclides_with_data
20 
21 _valid_rxns = list(REACTIONS)
22 _valid_rxns.append('fission')
23 
24 
25 class MicroXS(DataFrame):
26     """Microscopic cross section data for use in transport-independent depletion.
27 
28     .. versionadded:: 0.13.1
29 
30     """
31 
32     @classmethod
33     def from_model(cls,
34                    model,
35                    reaction_domain,
36                    chain_file=None,
37                    dilute_initial=1.0e3,
38                    energy_bounds=(0, 20e6),
39                    run_kwargs=None):
40         """Generate a one-group cross-section dataframe using
41         OpenMC. Note that the ``openmc`` executable must be compiled.
42 
43         Parameters
44         ----------
45         model : openmc.Model
46             OpenMC model object. Must contain geometry, materials, and settings.
47         reaction_domain : openmc.Material or openmc.Cell or openmc.Universe or openmc.RegularMesh
48             Domain in which to tally reaction rates.
49         chain_file : str, optional
50             Path to the depletion chain XML file that will be used in depletion
51             simulation. Used to determine cross sections for materials not
52             present in the inital composition. Defaults to
53             ``openmc.config['chain_file']``.
54         dilute_initial : float, optional
55             Initial atom density [atoms/cm^3] to add for nuclides that
56             are zero in initial condition to ensure they exist in the cross
57             section data. Only done for nuclides with reaction rates.
58         reactions : list of str, optional
59             Reaction names to tally
60         energy_bound : 2-tuple of float, optional
61             Bounds for the energy group.
62         run_kwargs : dict, optional
63             Keyword arguments passed to :meth:`openmc.model.Model.run`
64 
65         Returns
66         -------
67         MicroXS
68             Cross section data in [b]
69 
70         """
71         groups = EnergyGroups(energy_bounds)
72 
73         # Set up the reaction tallies
74         original_tallies = model.tallies
75         original_materials = deepcopy(model.materials)
76         tallies = Tallies()
77         xs = {}
78         reactions, diluted_materials = cls._add_dilute_nuclides(chain_file,
79                                                                 model,
80                                                                 dilute_initial)
81         model.materials = diluted_materials
82 
83         for rx in reactions:
84             if rx == 'fission':
85                 xs[rx] = FissionXS(domain=reaction_domain,
86                                    energy_groups=groups, by_nuclide=True)
87             else:
88                 xs[rx] = ArbitraryXS(rx, domain=reaction_domain,
89                                      energy_groups=groups, by_nuclide=True)
90             tallies += xs[rx].tallies.values()
91 
92         model.tallies = tallies
93 
94         # create temporary run
95         with tempfile.TemporaryDirectory() as temp_dir:
96             if run_kwargs is None:
97                 run_kwargs = {}
98             run_kwargs.setdefault('cwd', temp_dir)
99             statepoint_path = model.run(**run_kwargs)
100 
101             with StatePoint(statepoint_path) as sp:
102                 for rx in xs:
103                     xs[rx].load_from_statepoint(sp)
104 
105         # Build the DataFrame
106         series = {}
107         for rx in xs:
108             df = xs[rx].get_pandas_dataframe(xs_type='micro')
109             series[rx] = df.set_index('nuclide')['mean']
110 
111         # Revert to the original tallies and materials
112         model.tallies = original_tallies
113         model.materials = original_materials
114 
115         return cls(series)
116 
117     @classmethod
118     def _add_dilute_nuclides(cls, chain_file, model, dilute_initial):
119         """
120         Add nuclides not present in burnable materials that have neutron data
121         and are present in the depletion chain to those materials. This allows
122         us to tally those specific nuclides for reactions to create one-group
123         cross sections.
124 
125         Parameters
126         ----------
127         chain_file : str
128             Path to the depletion chain XML file that will be used in depletion
129             simulation. Used to determine cross sections for materials not
130             present in the inital composition.
131         model : openmc.Model
132             Model object
133         dilute_initial : float
134             Initial atom density [atoms/cm^3] to add for nuclides that
135             are zero in initial condition to ensure they exist in the cross
136             section data. Only done for nuclides with reaction rates.
137 
138         Returns
139         -------
140         reactions : list of str
141             List of reaction names
142         diluted_materials : openmc.Materials
143             :class:`openmc.Materials` object with nuclides added to burnable
144             materials.
145         """
146         if chain_file is None:
147             chain_file = openmc.config.get('chain_file')
148             if chain_file is None:
149                 raise DataError(
150                     "No depletion chain specified and could not find depletion "
151                     "chain in openmc.config['chain_file']"
152                 )
153         chain = Chain.from_xml(chain_file)
154         reactions = chain.reactions
155         cross_sections = _find_cross_sections(model)
156         nuclides_with_data = _get_nuclides_with_data(cross_sections)
157         burnable_nucs = [nuc.name for nuc in chain.nuclides
158                          if nuc.name in nuclides_with_data]
159         diluted_materials = Materials()
160         for material in model.materials:
161             if material.depletable:
162                 nuc_densities = material.get_nuclide_atom_densities()
163                 dilute_density = 1.0e-24 * dilute_initial
164                 material.set_density('sum')
165                 for nuc, density in nuc_densities.items():
166                     material.remove_nuclide(nuc)
167                     material.add_nuclide(nuc, density)
168                 for burn_nuc in burnable_nucs:
169                     if burn_nuc not in nuc_densities:
170                         material.add_nuclide(burn_nuc,
171                                                      dilute_density)
172             diluted_materials.append(material)
173 
174         return reactions, diluted_materials
175 
176     @classmethod
177     def from_array(cls, nuclides, reactions, data):
178         """
179         Creates a ``MicroXS`` object from arrays.
180 
181         Parameters
182         ----------
183         nuclides : list of str
184             List of nuclide symbols for that have data for at least one
185             reaction.
186         reactions : list of str
187             List of reactions. All reactions must match those in
188             :data:`openmc.deplete.chain.REACTIONS`
189         data : ndarray of floats
190             Array containing one-group microscopic cross section values for
191             each nuclide and reaction. Cross section values are assumed to be
192             in [b].
193 
194         Returns
195         -------
196         MicroXS
197         """
198 
199         # Validate inputs
200         if data.shape != (len(nuclides), len(reactions)):
201             raise ValueError(
202                 f'Nuclides list of length {len(nuclides)} and '
203                 f'reactions array of length {len(reactions)} do not '
204                 f'match dimensions of data array of shape {data.shape}')
205 
206         cls._validate_micro_xs_inputs(
207             nuclides, reactions, data)
208         micro_xs = cls(index=nuclides, columns=reactions, data=data)
209 
210         return micro_xs
211 
212     @classmethod
213     def from_csv(cls, csv_file, **kwargs):
214         """
215         Load a ``MicroXS`` object from a ``.csv`` file.
216 
217         Parameters
218         ----------
219         csv_file : str
220             Relative path to csv-file containing microscopic cross section
221             data. Cross section values are assumed to be in [b]
222         **kwargs : dict
223             Keyword arguments to pass to :func:`pandas.read_csv()`.
224 
225         Returns
226         -------
227         MicroXS
228 
229         """
230         if 'float_precision' not in kwargs:
231             kwargs['float_precision'] = 'round_trip'
232 
233         micro_xs = cls(read_csv(csv_file, index_col=0, **kwargs))
234 
235         cls._validate_micro_xs_inputs(list(micro_xs.index),
236                                       list(micro_xs.columns),
237                                       micro_xs.to_numpy())
238         return micro_xs
239 
240     @staticmethod
241     def _validate_micro_xs_inputs(nuclides, reactions, data):
242         check_iterable_type('nuclides', nuclides, str)
243         check_iterable_type('reactions', reactions, str)
244         check_type('data', data, np.ndarray, expected_iter_type=float)
245         for reaction in reactions:
246             check_value('reactions', reaction, _valid_rxns)
247
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/openmc/deplete/microxs.py b/openmc/deplete/microxs.py
--- a/openmc/deplete/microxs.py
+++ b/openmc/deplete/microxs.py
@@ -37,8 +37,9 @@
                    dilute_initial=1.0e3,
                    energy_bounds=(0, 20e6),
                    run_kwargs=None):
-        """Generate a one-group cross-section dataframe using
-        OpenMC. Note that the ``openmc`` executable must be compiled.
+        """Generate a one-group cross-section dataframe using OpenMC.
+
+        Note that the ``openmc`` executable must be compiled.
 
         Parameters
         ----------
@@ -55,8 +56,6 @@
             Initial atom density [atoms/cm^3] to add for nuclides that
             are zero in initial condition to ensure they exist in the cross
             section data. Only done for nuclides with reaction rates.
-        reactions : list of str, optional
-            Reaction names to tally
         energy_bound : 2-tuple of float, optional
             Bounds for the energy group.
         run_kwargs : dict, optional

{"golden_diff": "diff --git a/openmc/deplete/microxs.py b/openmc/deplete/microxs.py\n--- a/openmc/deplete/microxs.py\n+++ b/openmc/deplete/microxs.py\n@@ -37,8 +37,9 @@\n                    dilute_initial=1.0e3,\n                    energy_bounds=(0, 20e6),\n                    run_kwargs=None):\n-        \"\"\"Generate a one-group cross-section dataframe using\n-        OpenMC. Note that the ``openmc`` executable must be compiled.\n+        \"\"\"Generate a one-group cross-section dataframe using OpenMC.\n+\n+        Note that the ``openmc`` executable must be compiled.\n \n         Parameters\n         ----------\n@@ -55,8 +56,6 @@\n             Initial atom density [atoms/cm^3] to add for nuclides that\n             are zero in initial condition to ensure they exist in the cross\n             section data. Only done for nuclides with reaction rates.\n-        reactions : list of str, optional\n-            Reaction names to tally\n         energy_bound : 2-tuple of float, optional\n             Bounds for the energy group.\n         run_kwargs : dict, optional\n", "issue": "MicroXS reactions arg in docsstring not available to users\nWhile reading through the MicroXS class I noted we have an argument in the doc string called ```reactions``` but no option for the user to set it as it is not an accepted arg keyword.\r\n\r\nhttps://github.com/openmc-dev/openmc/blob/6c7f857e1e98ce4fd5b39d8be034308596628d7e/openmc/deplete/microxs.py#L58\r\n\r\n```reactions``` is however defined few lines later by this function call ```reactions, diluted_materials = cls._add_dilute_nuclides(chain_file,```\r\n\r\nperhaps we are missing some logic checks to see if the user sets reactions and if not then if finds them?\r\n\r\nIf so I think I can make a PR with some if statement to fix that\r\n\r\n\n", "before_files": [{"content": "\"\"\"MicroXS module\n\nA pandas.DataFrame storing microscopic cross section data with\nnuclide names as row indices and reaction names as column indices.\n\"\"\"\n\nimport tempfile\nfrom copy import deepcopy\n\nfrom pandas import DataFrame, read_csv\nimport numpy as np\n\nfrom openmc.checkvalue import check_type, check_value, check_iterable_type\nfrom openmc.exceptions import DataError\nfrom openmc.mgxs import EnergyGroups, ArbitraryXS, FissionXS\nfrom openmc import Tallies, StatePoint, Materials\nimport openmc\nfrom .chain import Chain, REACTIONS\nfrom .coupled_operator import _find_cross_sections, _get_nuclides_with_data\n\n_valid_rxns = list(REACTIONS)\n_valid_rxns.append('fission')\n\n\nclass MicroXS(DataFrame):\n    \"\"\"Microscopic cross section data for use in transport-independent depletion.\n\n    .. versionadded:: 0.13.1\n\n    \"\"\"\n\n    @classmethod\n    def from_model(cls,\n                   model,\n                   reaction_domain,\n                   chain_file=None,\n                   dilute_initial=1.0e3,\n                   energy_bounds=(0, 20e6),\n                   run_kwargs=None):\n        \"\"\"Generate a one-group cross-section dataframe using\n        OpenMC. Note that the ``openmc`` executable must be compiled.\n\n        Parameters\n        ----------\n        model : openmc.Model\n            OpenMC model object. Must contain geometry, materials, and settings.\n        reaction_domain : openmc.Material or openmc.Cell or openmc.Universe or openmc.RegularMesh\n            Domain in which to tally reaction rates.\n        chain_file : str, optional\n            Path to the depletion chain XML file that will be used in depletion\n            simulation. Used to determine cross sections for materials not\n            present in the inital composition. Defaults to\n            ``openmc.config['chain_file']``.\n        dilute_initial : float, optional\n            Initial atom density [atoms/cm^3] to add for nuclides that\n            are zero in initial condition to ensure they exist in the cross\n            section data. Only done for nuclides with reaction rates.\n        reactions : list of str, optional\n            Reaction names to tally\n        energy_bound : 2-tuple of float, optional\n            Bounds for the energy group.\n        run_kwargs : dict, optional\n            Keyword arguments passed to :meth:`openmc.model.Model.run`\n\n        Returns\n        -------\n        MicroXS\n            Cross section data in [b]\n\n        \"\"\"\n        groups = EnergyGroups(energy_bounds)\n\n        # Set up the reaction tallies\n        original_tallies = model.tallies\n        original_materials = deepcopy(model.materials)\n        tallies = Tallies()\n        xs = {}\n        reactions, diluted_materials = cls._add_dilute_nuclides(chain_file,\n                                                                model,\n                                                                dilute_initial)\n        model.materials = diluted_materials\n\n        for rx in reactions:\n            if rx == 'fission':\n                xs[rx] = FissionXS(domain=reaction_domain,\n                                   energy_groups=groups, by_nuclide=True)\n            else:\n                xs[rx] = ArbitraryXS(rx, domain=reaction_domain,\n                                     energy_groups=groups, by_nuclide=True)\n            tallies += xs[rx].tallies.values()\n\n        model.tallies = tallies\n\n        # create temporary run\n        with tempfile.TemporaryDirectory() as temp_dir:\n            if run_kwargs is None:\n                run_kwargs = {}\n            run_kwargs.setdefault('cwd', temp_dir)\n            statepoint_path = model.run(**run_kwargs)\n\n            with StatePoint(statepoint_path) as sp:\n                for rx in xs:\n                    xs[rx].load_from_statepoint(sp)\n\n        # Build the DataFrame\n        series = {}\n        for rx in xs:\n            df = xs[rx].get_pandas_dataframe(xs_type='micro')\n            series[rx] = df.set_index('nuclide')['mean']\n\n        # Revert to the original tallies and materials\n        model.tallies = original_tallies\n        model.materials = original_materials\n\n        return cls(series)\n\n    @classmethod\n    def _add_dilute_nuclides(cls, chain_file, model, dilute_initial):\n        \"\"\"\n        Add nuclides not present in burnable materials that have neutron data\n        and are present in the depletion chain to those materials. This allows\n        us to tally those specific nuclides for reactions to create one-group\n        cross sections.\n\n        Parameters\n        ----------\n        chain_file : str\n            Path to the depletion chain XML file that will be used in depletion\n            simulation. Used to determine cross sections for materials not\n            present in the inital composition.\n        model : openmc.Model\n            Model object\n        dilute_initial : float\n            Initial atom density [atoms/cm^3] to add for nuclides that\n            are zero in initial condition to ensure they exist in the cross\n            section data. Only done for nuclides with reaction rates.\n\n        Returns\n        -------\n        reactions : list of str\n            List of reaction names\n        diluted_materials : openmc.Materials\n            :class:`openmc.Materials` object with nuclides added to burnable\n            materials.\n        \"\"\"\n        if chain_file is None:\n            chain_file = openmc.config.get('chain_file')\n            if chain_file is None:\n                raise DataError(\n                    \"No depletion chain specified and could not find depletion \"\n                    \"chain in openmc.config['chain_file']\"\n                )\n        chain = Chain.from_xml(chain_file)\n        reactions = chain.reactions\n        cross_sections = _find_cross_sections(model)\n        nuclides_with_data = _get_nuclides_with_data(cross_sections)\n        burnable_nucs = [nuc.name for nuc in chain.nuclides\n                         if nuc.name in nuclides_with_data]\n        diluted_materials = Materials()\n        for material in model.materials:\n            if material.depletable:\n                nuc_densities = material.get_nuclide_atom_densities()\n                dilute_density = 1.0e-24 * dilute_initial\n                material.set_density('sum')\n                for nuc, density in nuc_densities.items():\n                    material.remove_nuclide(nuc)\n                    material.add_nuclide(nuc, density)\n                for burn_nuc in burnable_nucs:\n                    if burn_nuc not in nuc_densities:\n                        material.add_nuclide(burn_nuc,\n                                                     dilute_density)\n            diluted_materials.append(material)\n\n        return reactions, diluted_materials\n\n    @classmethod\n    def from_array(cls, nuclides, reactions, data):\n        \"\"\"\n        Creates a ``MicroXS`` object from arrays.\n\n        Parameters\n        ----------\n        nuclides : list of str\n            List of nuclide symbols for that have data for at least one\n            reaction.\n        reactions : list of str\n            List of reactions. All reactions must match those in\n            :data:`openmc.deplete.chain.REACTIONS`\n        data : ndarray of floats\n            Array containing one-group microscopic cross section values for\n            each nuclide and reaction. Cross section values are assumed to be\n            in [b].\n\n        Returns\n        -------\n        MicroXS\n        \"\"\"\n\n        # Validate inputs\n        if data.shape != (len(nuclides), len(reactions)):\n            raise ValueError(\n                f'Nuclides list of length {len(nuclides)} and '\n                f'reactions array of length {len(reactions)} do not '\n                f'match dimensions of data array of shape {data.shape}')\n\n        cls._validate_micro_xs_inputs(\n            nuclides, reactions, data)\n        micro_xs = cls(index=nuclides, columns=reactions, data=data)\n\n        return micro_xs\n\n    @classmethod\n    def from_csv(cls, csv_file, **kwargs):\n        \"\"\"\n        Load a ``MicroXS`` object from a ``.csv`` file.\n\n        Parameters\n        ----------\n        csv_file : str\n            Relative path to csv-file containing microscopic cross section\n            data. Cross section values are assumed to be in [b]\n        **kwargs : dict\n            Keyword arguments to pass to :func:`pandas.read_csv()`.\n\n        Returns\n        -------\n        MicroXS\n\n        \"\"\"\n        if 'float_precision' not in kwargs:\n            kwargs['float_precision'] = 'round_trip'\n\n        micro_xs = cls(read_csv(csv_file, index_col=0, **kwargs))\n\n        cls._validate_micro_xs_inputs(list(micro_xs.index),\n                                      list(micro_xs.columns),\n                                      micro_xs.to_numpy())\n        return micro_xs\n\n    @staticmethod\n    def _validate_micro_xs_inputs(nuclides, reactions, data):\n        check_iterable_type('nuclides', nuclides, str)\n        check_iterable_type('reactions', reactions, str)\n        check_type('data', data, np.ndarray, expected_iter_type=float)\n        for reaction in reactions:\n            check_value('reactions', reaction, _valid_rxns)\n", "path": "openmc/deplete/microxs.py"}], "after_files": [{"content": "\"\"\"MicroXS module\n\nA pandas.DataFrame storing microscopic cross section data with\nnuclide names as row indices and reaction names as column indices.\n\"\"\"\n\nimport tempfile\nfrom copy import deepcopy\n\nfrom pandas import DataFrame, read_csv\nimport numpy as np\n\nfrom openmc.checkvalue import check_type, check_value, check_iterable_type\nfrom openmc.exceptions import DataError\nfrom openmc.mgxs import EnergyGroups, ArbitraryXS, FissionXS\nfrom openmc import Tallies, StatePoint, Materials\nimport openmc\nfrom .chain import Chain, REACTIONS\nfrom .coupled_operator import _find_cross_sections, _get_nuclides_with_data\n\n_valid_rxns = list(REACTIONS)\n_valid_rxns.append('fission')\n\n\nclass MicroXS(DataFrame):\n    \"\"\"Microscopic cross section data for use in transport-independent depletion.\n\n    .. versionadded:: 0.13.1\n\n    \"\"\"\n\n    @classmethod\n    def from_model(cls,\n                   model,\n                   reaction_domain,\n                   chain_file=None,\n                   dilute_initial=1.0e3,\n                   energy_bounds=(0, 20e6),\n                   run_kwargs=None):\n        \"\"\"Generate a one-group cross-section dataframe using OpenMC.\n\n        Note that the ``openmc`` executable must be compiled.\n\n        Parameters\n        ----------\n        model : openmc.Model\n            OpenMC model object. Must contain geometry, materials, and settings.\n        reaction_domain : openmc.Material or openmc.Cell or openmc.Universe or openmc.RegularMesh\n            Domain in which to tally reaction rates.\n        chain_file : str, optional\n            Path to the depletion chain XML file that will be used in depletion\n            simulation. Used to determine cross sections for materials not\n            present in the inital composition. Defaults to\n            ``openmc.config['chain_file']``.\n        dilute_initial : float, optional\n            Initial atom density [atoms/cm^3] to add for nuclides that\n            are zero in initial condition to ensure they exist in the cross\n            section data. Only done for nuclides with reaction rates.\n        energy_bound : 2-tuple of float, optional\n            Bounds for the energy group.\n        run_kwargs : dict, optional\n            Keyword arguments passed to :meth:`openmc.model.Model.run`\n\n        Returns\n        -------\n        MicroXS\n            Cross section data in [b]\n\n        \"\"\"\n        groups = EnergyGroups(energy_bounds)\n\n        # Set up the reaction tallies\n        original_tallies = model.tallies\n        original_materials = deepcopy(model.materials)\n        tallies = Tallies()\n        xs = {}\n        reactions, diluted_materials = cls._add_dilute_nuclides(chain_file,\n                                                                model,\n                                                                dilute_initial)\n        model.materials = diluted_materials\n\n        for rx in reactions:\n            if rx == 'fission':\n                xs[rx] = FissionXS(domain=reaction_domain,\n                                   energy_groups=groups, by_nuclide=True)\n            else:\n                xs[rx] = ArbitraryXS(rx, domain=reaction_domain,\n                                     energy_groups=groups, by_nuclide=True)\n            tallies += xs[rx].tallies.values()\n\n        model.tallies = tallies\n\n        # create temporary run\n        with tempfile.TemporaryDirectory() as temp_dir:\n            if run_kwargs is None:\n                run_kwargs = {}\n            run_kwargs.setdefault('cwd', temp_dir)\n            statepoint_path = model.run(**run_kwargs)\n\n            with StatePoint(statepoint_path) as sp:\n                for rx in xs:\n                    xs[rx].load_from_statepoint(sp)\n\n        # Build the DataFrame\n        series = {}\n        for rx in xs:\n            df = xs[rx].get_pandas_dataframe(xs_type='micro')\n            series[rx] = df.set_index('nuclide')['mean']\n\n        # Revert to the original tallies and materials\n        model.tallies = original_tallies\n        model.materials = original_materials\n\n        return cls(series)\n\n    @classmethod\n    def _add_dilute_nuclides(cls, chain_file, model, dilute_initial):\n        \"\"\"\n        Add nuclides not present in burnable materials that have neutron data\n        and are present in the depletion chain to those materials. This allows\n        us to tally those specific nuclides for reactions to create one-group\n        cross sections.\n\n        Parameters\n        ----------\n        chain_file : str\n            Path to the depletion chain XML file that will be used in depletion\n            simulation. Used to determine cross sections for materials not\n            present in the inital composition.\n        model : openmc.Model\n            Model object\n        dilute_initial : float\n            Initial atom density [atoms/cm^3] to add for nuclides that\n            are zero in initial condition to ensure they exist in the cross\n            section data. Only done for nuclides with reaction rates.\n\n        Returns\n        -------\n        reactions : list of str\n            List of reaction names\n        diluted_materials : openmc.Materials\n            :class:`openmc.Materials` object with nuclides added to burnable\n            materials.\n        \"\"\"\n        if chain_file is None:\n            chain_file = openmc.config.get('chain_file')\n            if chain_file is None:\n                raise DataError(\n                    \"No depletion chain specified and could not find depletion \"\n                    \"chain in openmc.config['chain_file']\"\n                )\n        chain = Chain.from_xml(chain_file)\n        reactions = chain.reactions\n        cross_sections = _find_cross_sections(model)\n        nuclides_with_data = _get_nuclides_with_data(cross_sections)\n        burnable_nucs = [nuc.name for nuc in chain.nuclides\n                         if nuc.name in nuclides_with_data]\n        diluted_materials = Materials()\n        for material in model.materials:\n            if material.depletable:\n                nuc_densities = material.get_nuclide_atom_densities()\n                dilute_density = 1.0e-24 * dilute_initial\n                material.set_density('sum')\n                for nuc, density in nuc_densities.items():\n                    material.remove_nuclide(nuc)\n                    material.add_nuclide(nuc, density)\n                for burn_nuc in burnable_nucs:\n                    if burn_nuc not in nuc_densities:\n                        material.add_nuclide(burn_nuc,\n                                                     dilute_density)\n            diluted_materials.append(material)\n\n        return reactions, diluted_materials\n\n    @classmethod\n    def from_array(cls, nuclides, reactions, data):\n        \"\"\"\n        Creates a ``MicroXS`` object from arrays.\n\n        Parameters\n        ----------\n        nuclides : list of str\n            List of nuclide symbols for that have data for at least one\n            reaction.\n        reactions : list of str\n            List of reactions. All reactions must match those in\n            :data:`openmc.deplete.chain.REACTIONS`\n        data : ndarray of floats\n            Array containing one-group microscopic cross section values for\n            each nuclide and reaction. Cross section values are assumed to be\n            in [b].\n\n        Returns\n        -------\n        MicroXS\n        \"\"\"\n\n        # Validate inputs\n        if data.shape != (len(nuclides), len(reactions)):\n            raise ValueError(\n                f'Nuclides list of length {len(nuclides)} and '\n                f'reactions array of length {len(reactions)} do not '\n                f'match dimensions of data array of shape {data.shape}')\n\n        cls._validate_micro_xs_inputs(\n            nuclides, reactions, data)\n        micro_xs = cls(index=nuclides, columns=reactions, data=data)\n\n        return micro_xs\n\n    @classmethod\n    def from_csv(cls, csv_file, **kwargs):\n        \"\"\"\n        Load a ``MicroXS`` object from a ``.csv`` file.\n\n        Parameters\n        ----------\n        csv_file : str\n            Relative path to csv-file containing microscopic cross section\n            data. Cross section values are assumed to be in [b]\n        **kwargs : dict\n            Keyword arguments to pass to :func:`pandas.read_csv()`.\n\n        Returns\n        -------\n        MicroXS\n\n        \"\"\"\n        if 'float_precision' not in kwargs:\n            kwargs['float_precision'] = 'round_trip'\n\n        micro_xs = cls(read_csv(csv_file, index_col=0, **kwargs))\n\n        cls._validate_micro_xs_inputs(list(micro_xs.index),\n                                      list(micro_xs.columns),\n                                      micro_xs.to_numpy())\n        return micro_xs\n\n    @staticmethod\n    def _validate_micro_xs_inputs(nuclides, reactions, data):\n        check_iterable_type('nuclides', nuclides, str)\n        check_iterable_type('reactions', reactions, str)\n        check_type('data', data, np.ndarray, expected_iter_type=float)\n        for reaction in reactions:\n            check_value('reactions', reaction, _valid_rxns)\n", "path": "openmc/deplete/microxs.py"}]}