frag_pele/Analysis/analyser.py
def pele_report2pandas(path, export=True):
    """
        This function merge the content of different report for PELE simulations in a single file pandas Data Frame.
    """
    data = []
    report_list = glob.glob('{}*'.format(path))
    for report in report_list:
        tmp_data = pd.read_csv(report, sep='    ', engine='python')
        tmp_data = tmp_data.iloc[1:]  # We must discard the first row
        processor = re.findall('\d+$'.format(path), report)
        tmp_data['Processor'] = processor[0]
        data.append(tmp_data)
    result = pd.concat(data)
    if export:
        path_to_folder = "/".join(path.split("/")[0:-1])
        new_dir = path_to_folder + "/summary"
        if not os.path.exists(new_dir):
            os.mkdir(new_dir)
        while True:
            counter = 1
            try:
                result.to_csv("{}/summary_report_{}.csv".format(new_dir, counter))
                print("Data saved in {}/summary_report_{}.csv".format(new_dir, counter))
                break
            except FileExistsError:
                counter =+ 1
                result.to_csv("{}/summary_report_{}.csv".format(new_dir, counter))

    return result

        This function merge the content of different report for PELE simulations in a single file pandas Data Frame.
    
This function merge the content of different report for PELE simulations in a single file pandas Data Frame.
This function merge the content of different report for PELE simulations in a single file pandas Data Frame .
def pele_report2pandas(path, export=True):
    data = []
    report_list = glob.glob('{}*'.format(path))
    for report in report_list:
        tmp_data = pd.read_csv(report, sep='    ', engine='python')
        tmp_data = tmp_data.iloc[1:]  
        processor = re.findall('\d+$'.format(path), report)
        tmp_data['Processor'] = processor[0]
        data.append(tmp_data)
    result = pd.concat(data)
    if export:
        path_to_folder = "/".join(path.split("/")[0:-1])
        new_dir = path_to_folder + "/summary"
        if not os.path.exists(new_dir):
            os.mkdir(new_dir)
        while True:
            counter = 1
            try:
                result.to_csv("{}/summary_report_{}.csv".format(new_dir, counter))
                print("Data saved in {}/summary_report_{}.csv".format(new_dir, counter))
                break
            except FileExistsError:
                counter =+ 1
                result.to_csv("{}/summary_report_{}.csv".format(new_dir, counter))
    return result
def pele_report2pandas ( path , export = True ) : data = [ ] report_list = glob . glob ( '{}*' . format ( path ) ) for report in report_list : tmp_data = pd . read_csv ( report , sep = '    ' , engine = 'python' ) tmp_data = tmp_data . iloc [ 1 : ] processor = re . findall ( '\d+$' . format ( path ) , report ) tmp_data [ 'Processor' ] = processor [ 0 ] data . append ( tmp_data ) result = pd . concat ( data ) if export : path_to_folder = "/" . join ( path . split ( "/" ) [ 0 : - 1 ] ) new_dir = path_to_folder + "/summary" if not os . path . exists ( new_dir ) : os . mkdir ( new_dir ) while True : counter = 1 try : result . to_csv ( "{}/summary_report_{}.csv" . format ( new_dir , counter ) ) print ( "Data saved in {}/summary_report_{}.csv" . format ( new_dir , counter ) ) break except FileExistsError : counter = + 1 result . to_csv ( "{}/summary_report_{}.csv" . format ( new_dir , counter ) ) return result
This function merge the content of different report for PELE simulations in a single file pandas Data Frame.
This function merge the content of different report for PELE simulations in a single file pandas Data Frame .
"""
        This function merge the content of different report for PELE simulations in a single file pandas Data Frame.
    """ # We must discard the first row
path
export