<commit_before>#! /usr/bin/env python3

import glob
import subprocess
import os
import sys
import math

from math import log
from subprocess import Popen, PIPE


def extract_errors(filename):

	file = open(filename, "r")
	output=file.read()
	match_list = [
		'DIAGNOSTICS BENCHMARK DIFF H:',
		'DIAGNOSTICS BENCHMARK DIFF U:',
		'DIAGNOSTICS BENCHMARK DIFF V:'
	]

	vals = ["x" for i in range(3)]

	ol = output.splitlines(True)
	for o in ol:
		o = o.replace('\n', '')
		o = o.replace('\r', '')
		for i in range(0, len(match_list)):
			m = match_list[i]
			if o[0:len(m)] == m:
				vals[i] = o[len(m)+1:]

	return vals


datafile="output_prog_h_pert_t00000000000.10000000.csv"


groups = [
	#['l1', 1],	# Group name / convergence order
	#['l2', 2],

	#['ln1', 1],
	#['ln2', 2],

	#['ln1test', 1],
	#['ln2test', 2],

        ['ln2space',2]
]

for group_info in groups:
	group = group_info[0]
	conv_order = group_info[1]
	print("")
	print("Group to be tested: "+str(group)+" "+str(conv_order))
	print("")
	#List of output files (all methods in group)
	outputs = glob.glob("script_"+group+"_bench*.out")
	outputs.sort()
			
	#
	# Determine test groups, each group has the same TS method
	#
	test_group_methods = []
	prev_test_name = ""
	for output in outputs:
		# Reset convergence test?
		pos = output.find("_phys")
		test_name = output[0:pos]
		if test_name != prev_test_name:
			test_group_methods.append(test_name)
                        
		prev_test_name = test_name

		#test_group_methods[-1].append(test_name)

	print("")
	print("Methods to be analysed:"+str(test_group_methods))
	print("")

	for method in test_group_methods:
		# List of outputs for this method
		outputs = glob.glob(method+"*.out")
		outputs.sort()

		conv_test = []
		prev_conv_value = 0.0
		prev_h_error = 0.0
		pos = outputs[1].find("_phys")
		test_name = outputs[1][0:pos]
		print("----------------------")
		print("Method: "+test_name)
		print("Resolution    MaxErrorH               MaxErrorU             MaxErrorV         RatioH")

		i = -1
		n = len(outputs)
		ratios = [0 for j in range(n)]
<commit_msg>fix script names in postprocessing_analytical.py<commit_after>#! /usr/bin/env python3

import glob
import subprocess
import os
import sys
import math

from math import log
from subprocess import Popen, PIPE


def extract_errors(filename):

	file = open(filename, "r")
	output=file.read()
	match_list = [
		'DIAGNOSTICS BENCHMARK DIFF H:',
		'DIAGNOSTICS BENCHMARK DIFF U:',
		'DIAGNOSTICS BENCHMARK DIFF V:'
	]

	vals = ["x" for i in range(3)]

	ol = output.splitlines(True)
	for o in ol:
		o = o.replace('\n', '')
		o = o.replace('\r', '')
		for i in range(0, len(match_list)):
			m = match_list[i]
			if o[0:len(m)] == m:
				vals[i] = o[len(m)+1:]

	return vals


datafile="output_prog_h_pert_t00000000000.10000000.csv"


groups = [
	#['l1', 1],	# Group name / convergence order
	#['l2', 2],

	#['ln1', 1],
	#['ln2', 2],

	#['ln1test', 1],
	#['ln2test', 2],

        ['ln2space',2]
]

for group_info in groups:
	group = group_info[0]
	conv_order = group_info[1]
	print("")
	print("Group to be tested: "+str(group)+" "+str(conv_order))
	print("")
	#List of output files (all methods in group)
	outputs = glob.glob("script_"+group+"_b*.out")
	outputs.sort()
			
	#
	# Determine test groups, each group has the same TS method
	#
	test_group_methods = []
	prev_test_name = ""
	for output in outputs:
		# Reset convergence test?
		pos = output.find("_N")
		test_name = output[0:pos]
		if test_name != prev_test_name:
			test_group_methods.append(test_name)
                        
		prev_test_name = test_name

		#test_group_methods[-1].append(test_name)

	print("")
	print("Methods to be analysed:"+str(test_group_methods))
	print("")

	for method in test_group_methods:
		# List of outputs for this method
		outputs = glob.glob(method+"*.out")
		outputs.sort()

		conv_test = []
		prev_conv_value = 0.0
		prev_h_error = 0.0
		pos = outputs[1].find("_phys")
		test_name = outputs[1][0:pos]
		print("----------------------")
		print("Method: "+test_name)
		print("Resolution    MaxErrorH               MaxErrorU             MaxErrorV         RatioH")

		i = -1
		n = len(outputs)
		ratios = [0 for j in range(n)]

{'fraction_non_alphanumeric': 0.1584842707340324, 'fraction_numerical': 0.02430886558627264, 'mean_word_length': 3.371875, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 4, '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': '2567674', 'n_tokens_mistral': 1730, 'n_tokens_neox': 1568, 'n_words': 390}