.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/Changing_numba_options.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_Changing_numba_options.py: Example of changing numba configuration for RDST ================================================ This example shows how to modify the numba options to change the behaviour of numba functions .. GENERATED FROM PYTHON SOURCE LINES 11-20 Load the module and change the numba options -------------------------------------------- The __init__.py file of convst contains four variable that will change how numba functions are compiled, please refer to the numba documentation for the effect of each option. In a classic desktop use of convst, you should not need to change any option. Issue have been known to occur on some HPC cluster. By default, the variables are all defined as True, here we change the value of __USE_NUMBA_CACHE__ and __USE_NUMBA_PARALLEL__ to False. .. GENERATED FROM PYTHON SOURCE LINES 20-28 .. code-block:: default import convst convst.__USE_NUMBA_CACHE__= False convst.__USE_NUMBA_FASTMATH__ = True convst.__USE_NUMBA_NOGIL__ = True convst.__USE_NUMBA_PARALLEL__ = False .. GENERATED FROM PYTHON SOURCE LINES 29-38 Run convst with the modified numba options ------------------------------------------ We can now use convst with these options, to check if the changes have been taken into account, we can inspect a numba function argument. !! THE MODIFICATION OF THE NUMBA CONFIGURATION MUST BE MADE BEFORE CALLING ANY NUMBA FUNCTION, NUMBA TREAT GLOBAL VARIABLE AT CONSTANT AT COMPILE TIME CHANGING THE VALUE OF THESE PARAMETER AFTER A FUNCTION IS COMPILED WILL NOT CHANGE ITS BEHAVIOR. .. GENERATED FROM PYTHON SOURCE LINES 38-41 .. code-block:: default from convst.transformers._univariate_same_length import U_SL_apply_all_shapelets print(U_SL_apply_all_shapelets.targetoptions) .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 0.000 seconds) .. _sphx_glr_download_auto_examples_Changing_numba_options.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: Changing_numba_options.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: Changing_numba_options.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_