<commit_before>#!/bin/env python

import os
import shutil
import string
import subprocess
import sys

from os.path import sep

outBase = '..' + sep '..' + sep + 'output' + sep + 'calcPhifBenchmark'

def findAveragePotentTime(dataPath):
   avgTime = 0
   f = open(dataPath + sep + 'performance.csv', 'r')
   
   potentTimeSum = 0
   numValues = 0
   for line in f:
      fields = string.split(line, sep=',')
      potentTimeSum = potentTimeSum + float(fields[-3])
      numValues = numValues + 1

   avgTime = potentTimeSum / numValues

   return avgTime

def runPic(width, height):
   exeName = '../bin/pic'
   width = str(width)
   height = str(height)
   maxTime =  str(10)
   logInterval =  str(maxTime)
   b0 =  str(3)
   sigmaHe =  str(1) 
   sigmaHi =  str(0.5) 
   sigmaCe =  str(100) 
   sigmaCi =  str(100) 
   sigmaHePerp =  str(0.25) 
   sigmaHiPerp =  str(0.125) 
   sigmaCeSecondary =  str(2) 
   percentageSecondary =  str(0.05) 
   outputDir = outBase + sep + 'width_' + str(width) + '_height_' + str(height)

   argList = [ exeName \
      , '-x', width \
      , '-y', height \
      , '-t', maxTime \
      , '-l', logInterval \
      , '--inject-width', width \
      , '--b0', b0 \
      , 'sigma-he', sigmaHe \
      , 'sigma-hi', sigmaHi \
      , 'sigma-ce', sigmaCe \
      , 'sigma-ci', sigmaCi \
      , 'sigma-he-perp', sigmaHePerp \
      , 'sigma-hi-perp', sigmaHiPerp \
      , 'sigma-ce-secondary', sigmaCeSecondary \
      , 'percentage-secondary', percentageSecondary \
      , '-o', outputDir \
      ]
   if sys.platform == 'linux2':
      f = open('/dev/null', 'r')
      subprocess.call(argList, stdout=f)
   else:
      subprocess.call(argList)

   return findAveragePotentTime(outputDir)

def main():
   startWidthPower = 5 # 32
   endWidthPower = 9 # 512
   heightIncrement = 2500<commit_msg>Increased the number of widths I benchmark<commit_after>#!/bin/env python

import os
import shutil
import string
import subprocess
import sys

from os.path import sep

outBase = '..' + sep '..' + sep + 'output' + sep + 'calcPhifBenchmark'

def findAveragePotentTime(dataPath):
   avgTime = 0
   f = open(dataPath + sep + 'performance.csv', 'r')
   
   potentTimeSum = 0
   numValues = 0
   for line in f:
      fields = string.split(line, sep=',')
      potentTimeSum = potentTimeSum + float(fields[-3])
      numValues = numValues + 1

   avgTime = potentTimeSum / numValues

   return avgTime

def runPic(width, height):
   exeName = '../bin/pic'
   width = str(width)
   height = str(height)
   maxTime =  str(10)
   logInterval =  str(maxTime)
   b0 =  str(3)
   sigmaHe =  str(1) 
   sigmaHi =  str(0.5) 
   sigmaCe =  str(100) 
   sigmaCi =  str(100) 
   sigmaHePerp =  str(0.25) 
   sigmaHiPerp =  str(0.125) 
   sigmaCeSecondary =  str(2) 
   percentageSecondary =  str(0.05) 
   outputDir = outBase + sep + 'width_' + str(width) + '_height_' + str(height)

   argList = [ exeName \
      , '-x', width \
      , '-y', height \
      , '-t', maxTime \
      , '-l', logInterval \
      , '--inject-width', width \
      , '--b0', b0 \
      , 'sigma-he', sigmaHe \
      , 'sigma-hi', sigmaHi \
      , 'sigma-ce', sigmaCe \
      , 'sigma-ci', sigmaCi \
      , 'sigma-he-perp', sigmaHePerp \
      , 'sigma-hi-perp', sigmaHiPerp \
      , 'sigma-ce-secondary', sigmaCeSecondary \
      , 'percentage-secondary', percentageSecondary \
      , '-o', outputDir \
      ]
   if sys.platform == 'linux2':
      f = open('/dev/null', 'r')
      subprocess.call(argList, stdout=f)
   else:
      subprocess.call(argList)

   return findAveragePotentTime(outputDir)

def main():
   startWidthPower = 5 # 32
   endWidthPower = 10 # 1024
   heightIncrement = 2500
{'fraction_non_alphanumeric': 0.1445196211096076, 'fraction_numerical': 0.023815967523680648, 'mean_word_length': 2.4064516129032256, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6607914', 'n_tokens_mistral': 1455, 'n_tokens_neox': 1303, 'n_words': 295}