coerce_outpath_extension ====================================================== .. py:function:: petpal.utils.useful_functions.coerce_outpath_extension(path: str, ext: str) -> str Coerce a path to the same absolute path with a provided filetype extension. :param path: Path to a file. :type path: str :param ext: Desired output extension. :type ext: str :returns: *abs_path_with_extension (str)* -- Absolute path of the input file with the modified extension. .. rubric:: Example .. code-block:: python from petpal.utils.useful_functions import coerce_outpath_extension my_path = 'my_file.nii.gz' my_csv_file = coerce_outpath_extension(my_path, '.csv') print(my_csv_file) # prints '/current/working/directory/my_file.csv'