The ``utilities.py`` module =========================== .. py:module:: ansys.chemkin.core.utilities Summary ------- .. py:currentmodule:: utilities .. tab-set:: .. tab-item:: Classes .. list-table:: :header-rows: 0 :widths: auto * - :py:obj:`~ansys.chemkin.core.utilities.WorkingFolders` - folder/file utilities for multiple runs. .. tab-item:: Functions .. list-table:: :header-rows: 0 :widths: auto * - :py:obj:`~where_element_in_array_1d` - Find number of occurrence and indices of the target value in an array. * - :py:obj:`~bisect` - Use bisectional method to find the largest index in the array. * - :py:obj:`~find_interpolate_parameters` - Find the indices branket the given value. * - :py:obj:`~interpolate_array` - Find the y-value corresponding to the x-value in data pairs. * - :py:obj:`~random` - Generate a (reproducible) random floating number. * - :py:obj:`~random_pick_integers` - Return a list of random integers from a given integer list. * - :py:obj:`~find_file` - Find the correct version of the given partial file name. * - :py:obj:`~copy_file` - Copy a file from the source folder to the target folder. * - :py:obj:`~delete_files_by_extension` - Delete files with specified extensions. * - :py:obj:`~check_jupyter_notebook` - Check if Pychemkin is running in any Jupyter environment. * - :py:obj:`~interpolate_point` - Interpolate value from a binary data array. .. tab-item:: Attributes .. list-table:: :header-rows: 0 :widths: auto * - :py:obj:`~ck_rng` - .. toctree:: :titlesonly: :maxdepth: 1 :hidden: WorkingFolders Description ----------- pychemkin utilities. Module detail ------------- .. py:function:: where_element_in_array_1d(arr: Union[numpy.typing.NDArray[numpy.double], numpy.typing.NDArray[numpy.int32]], target: float) -> tuple[int, numpy.typing.NDArray[numpy.int32]] Find number of occurrence and indices of the target value in an array. .. py:function:: bisect(ileft: int, iright: int, x: float, xarray) -> int Use bisectional method to find the largest index in the array. .. py:function:: find_interpolate_parameters(x: float, xarray: numpy.typing.NDArray[numpy.double]) -> tuple[int, float] Find the indices branket the given value. .. py:function:: interpolate_array(x: float, x_array: numpy.typing.NDArray[numpy.double], y_array: numpy.typing.NDArray[numpy.double]) -> float Find the y-value corresponding to the x-value in data pairs. .. py:function:: random(range: Union[None, tuple[float, float]] = None) -> float Generate a (reproducible) random floating number. .. py:function:: random_pick_integers(numb_picks: int, source_integers: list[int]) -> tuple[list[int], list[int]] Return a list of random integers from a given integer list. .. py:function:: find_file(filepath: str, partialfilename: str, fileext: str) -> str Find the correct version of the given partial file name. .. py:function:: copy_file(sourcepath: str, targetpath: str, filename: str, new_file_name: Union[str, None] = None) Copy a file from the source folder to the target folder. .. py:function:: delete_files_by_extension(targetpath: str, extensions: list[str]) Delete files with specified extensions. .. py:function:: check_jupyter_notebook() -> bool Check if Pychemkin is running in any Jupyter environment. .. py:function:: interpolate_point(x_value: float, x_array: Union[list[float], numpy.typing.NDArray[numpy.double]], y_array: Union[list[float], numpy.typing.NDArray[numpy.double]]) -> tuple[int, float] Interpolate value from a binary data array. .. py:data:: ck_rng :value: None