:py:mod:`ethos_penalps.utilities.general_functions`
===================================================

.. py:module:: ethos_penalps.utilities.general_functions


Module Contents
---------------

Classes
~~~~~~~

.. autoapisummary::

   ethos_penalps.utilities.general_functions.ResultPathGenerator
   ethos_penalps.utilities.general_functions.DeltaTemplate
   ethos_penalps.utilities.general_functions.ExtendedEncoder



Functions
~~~~~~~~~

.. autoapisummary::

   ethos_penalps.utilities.general_functions.get_all_rows_with_minimum_index_from_array
   ethos_penalps.utilities.general_functions.get_all_rows_with_maximum_index_from_array
   ethos_penalps.utilities.general_functions.format_timedelta
   ethos_penalps.utilities.general_functions.denormalize
   ethos_penalps.utilities.general_functions.check_if_date_1_is_before_date_2
   ethos_penalps.utilities.general_functions.check_if_date_1_is_before_or_at_date_2
   ethos_penalps.utilities.general_functions.convert_date_time_to_string
   ethos_penalps.utilities.general_functions.get_super
   ethos_penalps.utilities.general_functions.get_sub
   ethos_penalps.utilities.general_functions.create_subscript_string_matplotlib
   ethos_penalps.utilities.general_functions.get_new_uuid
   ethos_penalps.utilities.general_functions.create_dataclass_from_pandas_series



Attributes
~~~~~~~~~~

.. autoapisummary::

   ethos_penalps.utilities.general_functions.a


.. py:function:: get_all_rows_with_minimum_index_from_array(input_array: list[list]) -> numpy.ndarray


.. py:function:: get_all_rows_with_maximum_index_from_array(input_array: list[list]) -> numpy.ndarray


.. py:function:: format_timedelta(td: datetime.timedelta) -> str


.. py:class:: ResultPathGenerator


   .. py:attribute:: result_time_stamp
      :type: str

      

   .. py:attribute:: time_stamp_format
      :type: str
      :value: '%Y_%m_%d__%H_%M_%S'

      

   .. py:method:: create_path_to_file_relative_to_main_file(file_name: str, subdirectory_name: str, file_extension: str, add_time_stamp_to_filename: bool = True) -> str

      Creates a path to subdirectory which is located at the level of the __main__ file. Subdirectory is created if it does not exists prior to call.

      :param file_name: name of the file to be created. Is prepending the full file name with optional timestamp
      :type file_name: str
      :param subdirectory_name: Name of the subdirectory which is created
      :type subdirectory_name: str
      :param file_extension: The file extension which is appended to the file name
      :type file_extension: str
      :param add_time_stamp_to_filename: Adds a current timestamp the file name between name and file extension, defaults to True
      :type add_time_stamp_to_filename: bool, optional
      :param time_stamp_format: describes the format of the timestamp which is added if add_time_stamp_to_filename is set to True, defaults to "%Y_%m_%d__%H_%M_%S"
      :type time_stamp_format: str, optional
      :return: returns the path to a file in a subdirectory
      :rtype: str


   .. py:method:: create_result_folder_relative_to_main_file(subdirectory_name: str, add_time_stamp_to_filename: bool = True) -> str


   .. py:method:: create_subdirectory_relative_to_parent(parent_directory_path: str, new_directory_name: str) -> str



.. py:function:: denormalize(value: numbers.Number, minimum_value: numbers.Number, maximum_value: numbers.Number)


.. py:function:: check_if_date_1_is_before_date_2(date_1: datetime.datetime, date_2: datetime.datetime) -> bool


.. py:function:: check_if_date_1_is_before_or_at_date_2(date_1: datetime.datetime, date_2: datetime.datetime) -> bool


.. py:class:: DeltaTemplate(template)


   Bases: :py:obj:`string.Template`

   A string class for supporting $-substitutions.

   .. py:attribute:: delimiter
      :value: '%'

      


.. py:function:: convert_date_time_to_string(td: datetime.timedelta, fmt)


.. py:function:: get_super(x)


.. py:function:: get_sub(x)


.. py:function:: create_subscript_string_matplotlib(base: str, subscripted_text: str)


.. py:function:: get_new_uuid() -> str


.. py:function:: create_dataclass_from_pandas_series(data: pandas.Series, factory: Any) -> Any


.. py:class:: ExtendedEncoder(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)


   Bases: :py:obj:`json.JSONEncoder`

   Extensible JSON <https://json.org> encoder for Python data structures.

   Supports the following objects and types by default:

   +-------------------+---------------+
   | Python            | JSON          |
   +===================+===============+
   | dict              | object        |
   +-------------------+---------------+
   | list, tuple       | array         |
   +-------------------+---------------+
   | str               | string        |
   +-------------------+---------------+
   | int, float        | number        |
   +-------------------+---------------+
   | True              | true          |
   +-------------------+---------------+
   | False             | false         |
   +-------------------+---------------+
   | None              | null          |
   +-------------------+---------------+

   To extend this to recognize other objects, subclass and implement a
   ``.default()`` method with another method that returns a serializable
   object for ``o`` if possible, otherwise it should call the superclass
   implementation (to raise ``TypeError``).


   .. py:method:: default(obj)

      Selects an encoder for custom objects

      :param obj: _description_
      :type obj: _type_
      :return: _description_
      :rtype: _type_



.. py:data:: a

   

