libs/io_lib.py
def archive_object(object_to_save,filename:str, ext:str=None,log=None) -> None:
    """Archive a Python object as a dump file

    Args:
        object_to_save ([type]): [Python object to save]
        filename (str): [output filename]
        ext (str, optional): [file extension]. Defaults to 'dmp'.
    """
    ensure_dir(filename)
    if '.' in filename:
        ext = filename.split('.')[-1]
        filename = filename.replace("."+ext,'')
    if ext is None:
        ext = 'dmp'
    if ext is not None and pathlib.Path(filename).suffix == '':
        filename = filename + '.' + ext
    with open(filename, 'wb') as f:
        pickle.dump(object_to_save, f,protocol=pickle.HIGHEST_PROTOCOL)
    if log:
        log.info('Saved file %s'%filename)
Archive a Python object as a dump file

    Args:
        object_to_save ([type]): [Python object to save]
        filename (str): [output filename]
        ext (str, optional): [file extension]. Defaults to 'dmp'.
    
Archive a Python object as a dump file
Archive a Python object as a dump file
def archive_object(object_to_save,filename:str, ext:str=None,log=None) -> None:
    ensure_dir(filename)
    if '.' in filename:
        ext = filename.split('.')[-1]
        filename = filename.replace("."+ext,'')
    if ext is None:
        ext = 'dmp'
    if ext is not None and pathlib.Path(filename).suffix == '':
        filename = filename + '.' + ext
    with open(filename, 'wb') as f:
        pickle.dump(object_to_save, f,protocol=pickle.HIGHEST_PROTOCOL)
    if log:
        log.info('Saved file %s'%filename)
def archive_object ( object_to_save , filename : str , ext : str = None , log = None ) -> None : ensure_dir ( filename ) if '.' in filename : ext = filename . split ( '.' ) [ - 1 ] filename = filename . replace ( "." + ext , '' ) if ext is None : ext = 'dmp' if ext is not None and pathlib . Path ( filename ) . suffix == '' : filename = filename + '.' + ext with open ( filename , 'wb' ) as f : pickle . dump ( object_to_save , f , protocol = pickle . HIGHEST_PROTOCOL ) if log : log . info ( 'Saved file %s' % filename )
Archive a Python object as a dump file
Archive a Python object as a dump file
"""Archive a Python object as a dump file

    Args:
        object_to_save ([type]): [Python object to save]
        filename (str): [output filename]
        ext (str, optional): [file extension]. Defaults to 'dmp'.
    """
object_to_save
[Python object to save]
[ Python object to save ]
filename
str
None
ext
str
[file extension]. Defaults to 'dmp'.
[ file extension ] . Defaults to ' dmp ' .
'dmp'
log