<commit_before>import ogusa
import os
import sys
from multiprocessing import Process
import time
import numpy as np

#OGUSA_PATH = os.environ.get("OGUSA_PATH", "../../ospc-dynamic/dynamic")

#sys.path.append(OGUSA_PATH)

from ogusa.scripts import postprocess
from ogusa.scripts.execute import runner
from ogusa.utils import REFORM_DIR, BASELINE_DIR

def run_micro_macro(user_params):

    # reform = {
    # 2015: {
    #     '_II_rt1': [.09],
    #     '_II_rt2': [.135],
    #     '_II_rt3': [.225],
    #     '_II_rt4': [.252],
    #     '_II_rt5': [.297],
    #     '_II_rt6': [.315],
    #     '_II_rt7': [0.3564],
    # }, }

    # reform = {
    # 2015: {
    #     '_II_rt1': [0.045]
    # }, }

    reform = {
    2017: {
       '_II_rt5': [.3],
       '_II_rt6': [.3],
       '_II_rt7': [0.3]
    } }


    start_time = time.time()

    T_shifts = np.zeros(50)
    T_shifts[2:10] = 0.01
    T_shifts[10:40]= -0.01
    G_shifts = np.zeros(6)
    G_shifts[0:3]  = -0.01
    G_shifts[3:6]  = -0.005
    user_params = {'frisch':0.41, 'start_year':2017, 'debt_ratio_ss':1.0, 'T_shifts':T_shifts, 'G_shifts':G_shifts}

    '''
    ------------------------------------------------------------------------
        Run SS for Baseline first - so can run baseline and reform in parallel if want
    ------------------------------------------------------------------------
    '''
    # output_base = BASELINE_DIR
    # input_dir = BASELINE_DIR
    # kwargs={'output_base':output_base, 'baseline_dir':BASELINE_DIR,
    #        'test':False, 'time_path':False, 'baseline':True, 'analytical_mtrs':False, 'age_specific':True,
    #        'user_params':user_params,'guid':'',
    #        'run_micro':False, 'small_open':False, 'budget_balance':False, 'baseline_spending':False}
    # #p1 = Process(target=runner, kwargs=kwargs)
    # #p1.start()
    # runner(**kwargs)
    # # quit()


    '''
    ------------------------------------------------------------------------
        Run baseline
    ------------------------------------------------------------------------
    '''


    output_base = BASELINE_DIR
    input_dir = BASELINE_DIR
    kwargs={'output_base':output_base, 'baseline_dir':BASELINE_DIR,
            'test':False, 'time_path':True, 'baseline':True,
            'analytical_mtrs':False, 'age_specific':True,
            'user_params':user_params,'guid':'',
            'run_micro':False, 'small_open': False, 'budget_balance':False, 'baseline_spending':False}
    #p1 = Process(target=runner, kwargs=kwargs)
    #p1.start()
    runner(**kwargs)


    '''
    ------------------------------------------------------------------------
        Run reform
    ------------------------------------------------------------------------
    '''
    output_base = REFORM_DIR<commit_msg>update runner script for testing<commit_after>import ogusa
import os
import sys
from multiprocessing import Process
import time
import numpy as np

#OGUSA_PATH = os.environ.get("OGUSA_PATH", "../../ospc-dynamic/dynamic")

#sys.path.append(OGUSA_PATH)

from ogusa.scripts import postprocess
from ogusa.scripts.execute import runner
from ogusa.utils import REFORM_DIR, BASELINE_DIR

def run_micro_macro(user_params):

    # reform = {
    # 2015: {
    #     '_II_rt1': [.09],
    #     '_II_rt2': [.135],
    #     '_II_rt3': [.225],
    #     '_II_rt4': [.252],
    #     '_II_rt5': [.297],
    #     '_II_rt6': [.315],
    #     '_II_rt7': [0.3564],
    # }, }

    # reform = {
    # 2015: {
    #     '_II_rt1': [0.045]
    # }, }

    reform = {
    2017: {
       '_II_rt5': [.3],
       '_II_rt6': [.3],
       '_II_rt7': [0.3]
    } }


    start_time = time.time()

    T_shifts = np.zeros(50)
    T_shifts[2:10] = 0.01
    T_shifts[10:40]= -0.01
    G_shifts = np.zeros(6)
    G_shifts[0:3]  = -0.01
    G_shifts[3:6]  = -0.005
    user_params = {'frisch':0.41, 'start_year':2017, 'debt_ratio_ss':1.0, 'T_shifts':T_shifts, 'G_shifts':G_shifts}

    '''
    ------------------------------------------------------------------------
        Run SS for Baseline first - so can run baseline and reform in parallel if want
    ------------------------------------------------------------------------
    '''
    output_base = BASELINE_DIR
    input_dir = BASELINE_DIR
    kwargs={'output_base':output_base, 'baseline_dir':BASELINE_DIR,
           'test':False, 'time_path':False, 'baseline':True, 'analytical_mtrs':False, 'age_specific':True,
           'user_params':user_params,'guid':'',
           'run_micro':False, 'small_open':True, 'budget_balance':False, 'baseline_spending':False}
    #p1 = Process(target=runner, kwargs=kwargs)
    #p1.start()
    runner(**kwargs)
    quit()


    '''
    ------------------------------------------------------------------------
        Run baseline
    ------------------------------------------------------------------------
    '''


    output_base = BASELINE_DIR
    input_dir = BASELINE_DIR
    kwargs={'output_base':output_base, 'baseline_dir':BASELINE_DIR,
            'test':False, 'time_path':True, 'baseline':True,
            'analytical_mtrs':False, 'age_specific':True,
            'user_params':user_params,'guid':'',
            'run_micro':True, 'small_open': False, 'budget_balance':False, 'baseline_spending':False}
    #p1 = Process(target=runner, kwargs=kwargs)
    #p1.start()
    runner(**kwargs)


    '''
    ------------------------------------------------------------------------
        Run reform
    ------------------------------------------------------------------------
    '''
    output_base = REFORM_DIR
{'fraction_non_alphanumeric': 0.28983688833124216, 'fraction_numerical': 0.03333930811973472, 'mean_word_length': 1.6148078725398314, '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': '500421', 'n_tokens_mistral': 1901, 'n_tokens_neox': 1757, 'n_words': 299}