.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/caching_cross_sections.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_caching_cross_sections.py: Cache Base and Perturbed Cross Section Libraries ================================================ This demonstrates how to cache the base and perturbed cross section libraries for a given SCALE multigroup library. This is useful for preventing the need to regenerate the perturbed cross section libraries each time a perturbation correlation plot is created. .. GENERATED FROM PYTHON SOURCE LINES 9-11 This module uses clarolplus along with the paths to the base cross section library and the perturbation factors to create the perturbed cross section libraries, then cache them as ``.pkl`` files which can be readily loaded into python for future use. .. GENERATED FROM PYTHON SOURCE LINES 11-20 .. code-block:: Python from tsunami_ip_utils.perturbations import cache_all_libraries from paths import EXAMPLES from pathlib import Path multigroup_library = EXAMPLES / 'data' / 'dummy_56_v7.1' perturbation_factors = Path("~/codes/SCALE-6.3.1/data/perturb/56n.v7.1") cache_all_libraries(multigroup_library, perturbation_factors) .. rst-class:: sphx-glr-script-out .. code-block:: none Reading base library... Caching perturbed libraries: 0%| | 0/1000 [00:00` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: caching_cross_sections.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: caching_cross_sections.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_