data/feature_extraction.py
def main(arguments):
    """
    This main function reads the file level signals from the csv, computes the
    time range, and for the aggregated file level signals on each date, extract
    the features and save to csv.
    """
    file_level_data = pd.read_csv(
        './%s_file_level_signals.csv' % arguments.repo)
    file_level_data = file_level_data[file_level_data['file name'].notna()]
    min_date = file_level_data['pull request closed time'].min()
    max_date = file_level_data['pull request closed time'].max()
    start_date = datetime.fromisoformat(min_date[:-1]) \
        + timedelta(days=1)
    end_date = datetime.fromisoformat(max_date[:-1])
    dates = pd.date_range(start=start_date.strftime("%Y-%m-%d"),
                          end=end_date.strftime("%Y-%m-%d"))\
        .to_pydatetime().tolist()
    for date in dates:
        date_str = date.strftime(format="%Y_%m_%d")
        file_name = './%s_%s.csv' % (arguments.repo, date_str)
        if not os.path.exists(file_name):
            continue
        print("Extracting features on %s" % date_str)
        file_level_data = pd.read_csv(file_name)
        feature_extractor = FeatureExtractor(file_level_data, date_str)
        feature_extractor.extract_features()
        feature_extractor.save_to_csv('./%s_%s_features.csv' %
                                      (arguments.repo, date_str))

    This main function reads the file level signals from the csv, computes the
    time range, and for the aggregated file level signals on each date, extract
    the features and save to csv.
    
This main function reads the file level signals from the csv, computes the
time range, and for the aggregated file level signals on each date, extract
the features and save to csv.
This main function reads the file level signals from the csv computes the time range and for the aggregated file level signals on each date extract the features and save to csv .
def main(arguments):
    file_level_data = pd.read_csv(
        './%s_file_level_signals.csv' % arguments.repo)
    file_level_data = file_level_data[file_level_data['file name'].notna()]
    min_date = file_level_data['pull request closed time'].min()
    max_date = file_level_data['pull request closed time'].max()
    start_date = datetime.fromisoformat(min_date[:-1]) \
        + timedelta(days=1)
    end_date = datetime.fromisoformat(max_date[:-1])
    dates = pd.date_range(start=start_date.strftime("%Y-%m-%d"),
                          end=end_date.strftime("%Y-%m-%d"))\
        .to_pydatetime().tolist()
    for date in dates:
        date_str = date.strftime(format="%Y_%m_%d")
        file_name = './%s_%s.csv' % (arguments.repo, date_str)
        if not os.path.exists(file_name):
            continue
        print("Extracting features on %s" % date_str)
        file_level_data = pd.read_csv(file_name)
        feature_extractor = FeatureExtractor(file_level_data, date_str)
        feature_extractor.extract_features()
        feature_extractor.save_to_csv('./%s_%s_features.csv' %
                                      (arguments.repo, date_str))
def main ( arguments ) : file_level_data = pd . read_csv ( './%s_file_level_signals.csv' % arguments . repo ) file_level_data = file_level_data [ file_level_data [ 'file name' ] . notna ( ) ] min_date = file_level_data [ 'pull request closed time' ] . min ( ) max_date = file_level_data [ 'pull request closed time' ] . max ( ) start_date = datetime . fromisoformat ( min_date [ : - 1 ] ) + timedelta ( days = 1 ) end_date = datetime . fromisoformat ( max_date [ : - 1 ] ) dates = pd . date_range ( start = start_date . strftime ( "%Y-%m-%d" ) , end = end_date . strftime ( "%Y-%m-%d" ) ) . to_pydatetime ( ) . tolist ( ) for date in dates : date_str = date . strftime ( format = "%Y_%m_%d" ) file_name = './%s_%s.csv' % ( arguments . repo , date_str ) if not os . path . exists ( file_name ) : continue print ( "Extracting features on %s" % date_str ) file_level_data = pd . read_csv ( file_name ) feature_extractor = FeatureExtractor ( file_level_data , date_str ) feature_extractor . extract_features ( ) feature_extractor . save_to_csv ( './%s_%s_features.csv' % ( arguments . repo , date_str ) )
This main function reads the file level signals from the csv, computes the
time range, and for the aggregated file level signals on each date, extract
the features and save to csv.
This main function reads the file level signals from the csv computes the time range and for the aggregated file level signals on each date extract the features and save to csv .
"""
    This main function reads the file level signals from the csv, computes the
    time range, and for the aggregated file level signals on each date, extract
    the features and save to csv.
    """
arguments