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

# file: regressionAnalysis.py
# author: <NAME> (<EMAIL>)
# description: Performs regression tests for PetIBM.


import os
import sys
import time
import shutil
import argparse

import numpy

sys.path.append('{}/scripts/python'.format(os.environ['PETIBM_DIR']))
import ioPetIBM


def read_inputs():
  """Parses the command-line."""
  # create parser
  parser = argparse.ArgumentParser(description='Executes a regression-test',
                        formatter_class= argparse.ArgumentDefaultsHelpFormatter)
  # fill parser with arguments
  parser.add_argument('--no-save', dest='save', action='store_false', 
                      help='saves the new numerical solutions')
  parser.add_argument('--no-compile', dest='compile', action='store_false',
                      help='skips PetIBM compilation')
  parser.add_argument('--no-run', dest='run', action='store_false',
                      help='does not run the test-cases')
  parser.set_defaults(save=True, compile=True, run=True)
  # parse command-line
  return parser.parse_args()


def define_test_cases():
  """Defines the test-cases to be run."""
  # dictionary that will contains test-cases info
  tests = {}

  # test-case: 2d lid-driven cavity flow (Re=100)
  case = '2d lid-driven cavity (Re=100)'
  tests[case] = TestCase('{}/cases/2d/lidDrivenCavity/Re100'.format(os.environ['PETIBM_DIR']))
  tests[case].petibmexec = os.environ['PETIBM2D']
  tests[case].mpiexec = os.environ['MPIEXEC']
  tests[case].n = 1
  tests[case].arguments = ('-sys2_pc_type gamg -sys2_pc_gamg_type agg '
                           '-sys2_pc_gamg_agg_nsmooths 1')
  # test-case: 2d cylinder (Re=40)
  case = '2d cylinder (Re=40)'<commit_msg>Change default command-line parameter to save results<commit_after>#!/usr/bin/env/ python

# file: regressionAnalysis.py
# author: <NAME> (<EMAIL>)
# description: Performs regression tests for PetIBM.


import os
import sys
import time
import shutil
import argparse

import numpy

sys.path.append('{}/scripts/python'.format(os.environ['PETIBM_DIR']))
import ioPetIBM


def read_inputs():
  """Parses the command-line."""
  # create parser
  parser = argparse.ArgumentParser(description='Executes a regression-test',
                        formatter_class= argparse.ArgumentDefaultsHelpFormatter)
  # fill parser with arguments
  parser.add_argument('--save', dest='save', action='store_true', 
                      help='saves the new numerical solutions')
  parser.add_argument('--no-compile', dest='compile', action='store_false',
                      help='skips PetIBM compilation')
  parser.add_argument('--no-run', dest='run', action='store_false',
                      help='does not run the test-cases')
  parser.set_defaults(compile=True, run=True)
  # parse command-line
  return parser.parse_args()


def define_test_cases():
  """Defines the test-cases to be run."""
  # dictionary that will contains test-cases info
  tests = {}

  # test-case: 2d lid-driven cavity flow (Re=100)
  case = '2d lid-driven cavity (Re=100)'
  tests[case] = TestCase('{}/cases/2d/lidDrivenCavity/Re100'.format(os.environ['PETIBM_DIR']))
  tests[case].petibmexec = os.environ['PETIBM2D']
  tests[case].mpiexec = os.environ['MPIEXEC']
  tests[case].n = 1
  tests[case].arguments = ('-sys2_pc_type gamg -sys2_pc_gamg_type agg '
                           '-sys2_pc_gamg_agg_nsmooths 1')
  # test-case: 2d cylinder (Re=40)
  case = '2d cylinder (Re=40)'
{'fraction_non_alphanumeric': 0.1362193362193362, 'fraction_numerical': 0.013852813852813853, 'mean_word_length': 3.6586021505376345, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '4806635', 'n_tokens_mistral': 1161, 'n_tokens_neox': 1094, 'n_words': 250}