Skip to content

Commit

Permalink
change from ogusa to ogcore
Browse files Browse the repository at this point in the history
  • Loading branch information
jdebacker committed Jul 14, 2021
1 parent 998ff41 commit 341ec52
Show file tree
Hide file tree
Showing 209 changed files with 523 additions and 523 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ogusa/_version.py export-subst
ogcore/_version.py export-subst
2 changes: 1 addition & 1 deletion .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Setup Miniconda using Python ${{ matrix.python-version }}
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: ogusa-dev
activate-environment: ogcore-dev
environment-file: environment.yml
python-version: ${{ matrix.python-version }}
auto-activate-base: false
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
- master
jobs:
build-and-deploy:
if: github.repository == 'PSLmodels/OG-USA'
if: github.repository == 'PSLmodels/OG-Core'
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -16,7 +16,7 @@ jobs:
- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: ogusa-dev
activate-environment: ogcore-dev
environment-file: environment.yml
python-version: 3.7
auto-activate-base: false
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: ogusa-dev
activate-environment: ogcore-dev
environment-file: environment.yml
python-version: 3.7
auto-activate-base: false
Expand Down
14 changes: 7 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ docs/build/*
run_examples/run_example_plots/*
run_examples/OUTPUT_BASELINE/*
run_examples/OUTPUT_REFORM/*
run_examples/ogusa_example_output.csv
ogusa/tests/test_io_data/tax_func_loop_inputs_large.pkl
ogusa/tests/baseline/*
ogusa/tests/reform/*
ogusa/tests/OUTPUT/*
ogusa/tests/OUTPUT_BASELINE/*
ogusa/tests/OUTPUT_REFORM/*
run_examples/ogcore_example_output.csv
ogcore/tests/test_io_data/tax_func_loop_inputs_large.pkl
ogcore/tests/baseline/*
ogcore/tests/reform/*
ogcore/tests/OUTPUT/*
ogcore/tests/OUTPUT_BASELINE/*
ogcore/tests/OUTPUT_REFORM/*
regression/OUTPUT_BASELINE/*
regression/OUTPUT_REFORM*
*default.profraw
16 changes: 8 additions & 8 deletions .jenkins_wrapper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ from_config(){
}
from_config numpy_version
from_config install_taxcalc_version
from_config compare_ogusa_version
from_config compare_ogcore_version
from_config compare_taxcalc_version


Expand All @@ -14,18 +14,18 @@ bash miniconda.sh -b -p $WORKSPACE/miniconda
export PATH="$WORKSPACE/miniconda/bin:$PATH"
conda config --set always_yes yes --set changeps1 no
conda update conda -n root
conda env list | grep ogusa_env && conda env remove -n ogusa_env || echo Didnt have to remove env
conda env list | grep ogcore_env && conda env remove -n ogcore_env || echo Didnt have to remove env
conda install nomkl
conda create --force -n ogusa_env python=2.7 nomkl
conda create --force -n ogcore_env python=2.7 nomkl

source activate ogusa_env
source activate ogcore_env
conda install --force yaml llvmlite enum34 funcsigs singledispatch libgfortran libpng openblas numba pytz pytest six toolz dateutil cycler scipy numpy=$numpy_version pyparsing pandas=0.18.1 matplotlib nomkl
conda remove mkl mkl-service || echo didnt have to remove mkl mkl-service
conda install --no-deps -c ospc taxcalc=$install_taxcalc_version --force
if [ "$ogusainstallmethod" = "conda" ];then
conda install -c ospc ogusa=$ogusaversion
if [ "$ogcoreinstallmethod" = "conda" ];then
conda install -c ospc ogcore=$ogcoreversion
fi
if [ "$ogusainstallmethod" = "git" ];then
if [ "$ogcoreinstallmethod" = "git" ];then
python setup.py install
fi

Expand All @@ -40,4 +40,4 @@ stat puf.csv
head -n 1 puf.csv
md5sum puf.csv

python run_reforms.py $reform $ogusabranch
python run_reforms.py $reform $ogcorebranch
2 changes: 1 addition & 1 deletion .regression.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# (It is not a yaml because it is grepped by bash and used by Python)

install_taxcalc_version 0.6.8
compare_ogusa_version 0.5.5
compare_ogcore_version 0.5.5
compare_taxcalc_version 0.6.6
diff True
numpy_version 1.10
Expand Down
12 changes: 6 additions & 6 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include ogusa/data/ability/*
include ogusa/data/demographic/*
include ogusa/data/labor/*
include ogusa/data/tax_functions/*
include ogusa/default_parameters.json
include ogusa/OGUSAplots.mplstyle
include ogcore/data/ability/*
include ogcore/data/demographic/*
include ogcore/data/labor/*
include ogcore/data/tax_functions/*
include ogcore/default_parameters.json
include ogcore/ogcoreplots.mplstyle
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Development is typically conducted on Linux or Max OS X (with the Xcode
# command-line tools installed), so this Makefile is designed
# to work in that environment (and not on Windows).
# USAGE: OG-USA$ make [TARGET]
# USAGE: OG-Core$ make [TARGET]

.PHONY=help
help:
Expand All @@ -28,18 +28,18 @@ clean:

.PHONY=package
package:
@pbrelease OG-USA ogusa 0.0.0 --local
@pbrelease OG-Core ogcore 0.0.0 --local

.PHONY=pytest
pytest:
@cd ogusa ; pytest -W ignore
@cd ogcore ; pytest -W ignore

OGUSA_JSON_FILES := $(shell ls -l ./ogusa/*json | awk '{print $$9}')
ogcore_JSON_FILES := $(shell ls -l ./ogcore/*json | awk '{print $$9}')

.PHONY=cstest
cstest:
-pycodestyle ogusa
-pycodestyle --ignore=E501,E121 $(OGUSA_JSON_FILES)
-pycodestyle ogcore
-pycodestyle --ignore=E501,E121 $(ogcore_JSON_FILES)

define coverage-cleanup
rm -f .coverage htmlcov/*
Expand Down
6 changes: 3 additions & 3 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ comment:

ignore:
- "setup.py"
- "./ogusa/_version.py"
- "./ogcore/_version.py"
- "./cs-config/**/*" # ignore folders and all its contents
- "./ogusa/tests/" # ignore folders and all its contents
- "./ogcore/tests/" # ignore folders and all its contents
- "./regression/**/*" # ignore folders and all its contents

48 changes: 24 additions & 24 deletions conda.recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package:
name: ogusa
name: ogcore
version: 0.5.13

source:
Expand Down Expand Up @@ -29,29 +29,29 @@ requirements:
-requests

about:
home: https://github.com/PSLmodels/OG-USA/
home: https://github.com/PSLmodels/OG-Core/

test:
imports:
- ogusa
- ogusa.SS
- ogusa.TPI
- ogusa.aggregates
- ogusa.constants
- ogusa.demographics
- ogusa.elliptical_u_est
- ogusa.execute
- ogusa.firm
- ogusa.fiscal
- ogusa.get_micro_data
- ogusa.household
- ogusa.income
- ogusa.output_plots
- ogusa.output_tables
- ogusa.parameter_plots
- ogusa.parameter_tables
- ogusa.parameters
- ogusa.tax
- ogusa.txfunc
- ogusa.utils
- ogusa.wealth
- ogcore
- ogcore.SS
- ogcore.TPI
- ogcore.aggregates
- ogcore.constants
- ogcore.demographics
- ogcore.elliptical_u_est
- ogcore.execute
- ogcore.firm
- ogcore.fiscal
- ogcore.get_micro_data
- ogcore.household
- ogcore.income
- ogcore.output_plots
- ogcore.output_tables
- ogcore.parameter_plots
- ogcore.parameter_tables
- ogcore.parameters
- ogcore.tax
- ogcore.txfunc
- ogcore.utils
- ogcore.wealth
50 changes: 25 additions & 25 deletions cs-config/cs_config/functions.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import ogusa
from ogusa.parameters import Specifications
from ogusa.constants import REFORM_DIR, BASELINE_DIR, DEFAULT_START_YEAR
from ogusa import output_plots as op
from ogusa import output_tables as ot
from ogusa import SS, TPI, utils
import ogcore
from ogcore.parameters import Specifications
from ogcore.constants import REFORM_DIR, BASELINE_DIR, DEFAULT_START_YEAR
from ogcore import output_plots as op
from ogcore import output_tables as ot
from ogcore import SS, TPI, utils
import os
import io
import pickle
Expand Down Expand Up @@ -72,21 +72,21 @@ def get_version():
def get_inputs(meta_param_dict):
meta_params = MetaParams()
meta_params.adjust(meta_param_dict)
# Set default OG-USA parameters
ogusa_params = Specifications()
ogusa_params.start_year = meta_params.year
filtered_ogusa_params = OrderedDict()
# Set default OG-Core parameters
ogcore_params = Specifications()
ogcore_params.start_year = meta_params.year
filtered_ogcore_params = OrderedDict()
filter_list = [
'chi_n_80', 'chi_b', 'eta', 'zeta', 'constant_demographics',
'ltilde', 'use_zeta', 'constant_rates', 'zero_taxes',
'analytical_mtrs', 'age_specific', 'gamma', 'epsilon',
'start_year']
for k, v in ogusa_params.dump().items():
for k, v in ogcore_params.dump().items():
if ((k not in filter_list) and
(v.get("section_1", False) != "Model Solution Parameters")
and (v.get("section_2", False) != "Model Dimensions")):
filtered_ogusa_params[k] = v
print('filtered ogusa = ', k)
filtered_ogcore_params[k] = v
print('filtered ogcore = ', k)
# Set default TC params
iit_params = TCParams()
iit_params.set_state(year=meta_params.year.tolist())
Expand All @@ -96,7 +96,7 @@ def get_inputs(meta_param_dict):
filtered_iit_params[k] = v

default_params = {
"OG-USA Parameters": filtered_ogusa_params,
"OG-Core Parameters": filtered_ogcore_params,
"Tax-Calculator Parameters": filtered_iit_params
}

Expand All @@ -107,10 +107,10 @@ def get_inputs(meta_param_dict):


def validate_inputs(meta_param_dict, adjustment, errors_warnings):
# ogusa doesn't look at meta_param_dict for validating inputs.
# ogcore doesn't look at meta_param_dict for validating inputs.
params = Specifications()
params.adjust(adjustment["OG-USA Parameters"], raise_errors=False)
errors_warnings["OG-USA Parameters"]["errors"].update(
params.adjust(adjustment["OG-Core Parameters"], raise_errors=False)
errors_warnings["OG-Core Parameters"]["errors"].update(
params.errors)
# Validate TC parameter inputs
pol_params = {}
Expand All @@ -129,7 +129,7 @@ def validate_inputs(meta_param_dict, adjustment, errors_warnings):

def run_model(meta_param_dict, adjustment):
'''
Initializes classes from OG-USA that compute the model under
Initializes classes from OG-Core that compute the model under
different policies. Then calls function get output objects.
'''
print('Meta_param_dict = ', meta_param_dict)
Expand Down Expand Up @@ -167,19 +167,19 @@ def run_model(meta_param_dict, adjustment):
run_micro = True
time_path = meta_param_dict['time_path'][0]['value']

# filter out OG-USA params that will not change between baseline and
# filter out OG-Core params that will not change between baseline and
# reform runs (these are the non-policy parameters)
filtered_ogusa_params = {}
filtered_ogcore_params = {}
constant_param_set = {
'frisch', 'beta_annual', 'sigma', 'g_y_annual', 'gamma',
'epsilon', 'Z', 'delta_annual', 'small_open', 'world_int_rate',
'initial_debt_ratio', 'initial_foreign_debt_ratio', 'zeta_D',
'zeta_K', 'tG1', 'tG2', 'rho_G', 'debt_ratio_ss',
'budget_balance'}
filtered_ogusa_params = OrderedDict()
for k, v in adjustment['OG-USA Parameters'].items():
filtered_ogcore_params = OrderedDict()
for k, v in adjustment['OG-Core Parameters'].items():
if k in constant_param_set:
filtered_ogusa_params[k] = v
filtered_ogcore_params[k] = v

# Solve baseline model
start_year = meta_param_dict['year'][0]['value']
Expand All @@ -195,7 +195,7 @@ def run_model(meta_param_dict, adjustment):
base_spec = {
**{'start_year': start_year,
'tax_func_type': 'DEP',
'age_specific': False}, **filtered_ogusa_params}
'age_specific': False}, **filtered_ogcore_params}
base_params = Specifications(
run_micro=False, output_base=base_dir, baseline_dir=base_dir,
test=False, time_path=False, baseline=True, iit_reform={},
Expand All @@ -218,7 +218,7 @@ def run_model(meta_param_dict, adjustment):

# Solve reform model
reform_spec = base_spec
reform_spec.update(adjustment["OG-USA Parameters"])
reform_spec.update(adjustment["OG-Core Parameters"])
reform_params = Specifications(
run_micro=False, output_base=reform_dir,
baseline_dir=base_dir, test=False, time_path=time_path,
Expand Down
2 changes: 1 addition & 1 deletion cs-config/cs_config/helpers.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Functions used to help OG-USA configure to COMP
Functions used to help OG-Core configure to COMP
"""
try:
import boto3
Expand Down
6 changes: 3 additions & 3 deletions cs-config/cs_config/tests/test_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ class TestFunctions1(CoreTestFunctions):
get_inputs = functions.get_inputs
validate_inputs = functions.validate_inputs
run_model = functions.run_model
ok_adjustment = {"OG-USA Parameters": {"frisch": 0.41},
ok_adjustment = {"OG-Core Parameters": {"frisch": 0.41},
"Tax-Calculator Parameters": {}}
bad_adjustment = {"OG-USA Parameters": {"frisch": 1.5},
bad_adjustment = {"OG-Core Parameters": {"frisch": 1.5},
"Tax-Calculator Parameters": {"STD": -1}}


# Comment out until do tabular output
# def test_param_effect():
# adjustment = {"ogusa": {"frisch": 0.35}}
# adjustment = {"ogcore": {"frisch": 0.35}}
# comp_dict = functions.run_model({}, adjustment)
# df = pd.read_csv(io.StringIO(comp_dict['downloadable'][0]['data']))
# assert df.loc[0, 'Change from Baseline (pp)'] != 0
Expand Down
4 changes: 2 additions & 2 deletions cs-config/install.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# bash commands for installing your package

git clone -b master --depth 1 https://github.com/PSLmodels/OG-USA
cd OG-USA
git clone -b master --depth 1 https://github.com/PSLmodels/OG-Core
cd OG-Core

# Explicitly add channels for looking up dependencies outside of
# taxcalc and paramtools. If the channels are not specified like this,
Expand Down
Loading

0 comments on commit 341ec52

Please sign in to comment.