cgeniepy.utils ============== .. py:module:: cgeniepy.utils Functions --------- .. autoapisummary:: cgeniepy.utils.check_rm cgeniepy.utils.file_exists cgeniepy.utils.is_empty cgeniepy.utils.efficient_log cgeniepy.utils.download_zenodo_file Module Contents --------------- .. py:function:: check_rm(path) Check and delete file :param path: path string of target file .. py:function:: file_exists(path) Check if file exists. If not, raise FileNotFoundError. :param path: path string of target file :returns: True if file exists .. py:function:: is_empty(path) Check if file is empty. If the file does not exist, then create one. :param path: path string of target file :returns: boolean operator .. py:function:: efficient_log(data, replace_zero=10) A shortcut to efficiently calculate log10 of data. :param data: data to calculate log10 :param replace_zero: value to replace zero in data :returns: log10 of data .. py:function:: download_zenodo_file(record_id, filename, download_path='~/.cgeniepy/') Downloads a specific file from a Zenodo record. Skips download if file already exists. Args: record_id (str): The Zenodo record ID (the numeric part of the DOI). filename (str): The name of the file to download. download_path (str): The directory to save the file in.