From 6b09185458f75b20e783113344d302586611706b Mon Sep 17 00:00:00 2001 From: Richard Evans Date: Thu, 31 Mar 2022 02:29:20 -0600 Subject: [PATCH 01/16] Removed erroneous refs to ogusa from PSL_catalog.json --- PSL_catalog.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/PSL_catalog.json b/PSL_catalog.json index d81db79b7..8e4207b0c 100644 --- a/PSL_catalog.json +++ b/PSL_catalog.json @@ -135,22 +135,22 @@ "core_maintainers": { "start_header": null, "end_header": null, - "data": "", + "data": "", "source": null, "type": "html" }, "unit_test": { "start_header": null, "end_header": null, - "data": "https://github.com/PSLmodels/OG-Core/tree/master/ogusa/tests", - "source": "https://github.com/PSLmodels/OG-Core/tree/master/ogusa/tests", + "data": "https://github.com/PSLmodels/OG-Core/tree/master/tests", + "source": "https://github.com/PSLmodels/OG-Core/tree/master/tests", "type": "html" }, "integration_test": { "start_header": null, "end_header": null, - "data": "https://github.com/PSLmodels/OG-Core/tree/master/ogusa/tests", - "source": "https://github.com/PSLmodels/OG-Core/tree/master/ogusa/tests", + "data": "https://github.com/PSLmodels/OG-Core/tree/master/tests", + "source": "https://github.com/PSLmodels/OG-Core/tree/master/tests", "type": "html" } } From 2eae0a1d700278bd09081e4541a0317e27a9d37b Mon Sep 17 00:00:00 2001 From: Richard Evans Date: Thu, 31 Mar 2022 02:32:06 -0600 Subject: [PATCH 02/16] Removed erroneous ref to OGUSA from intro.md --- docs/book/content/intro/intro.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/book/content/intro/intro.md b/docs/book/content/intro/intro.md index 798fa5e59..71cbdc902 100644 --- a/docs/book/content/intro/intro.md +++ b/docs/book/content/intro/intro.md @@ -23,7 +23,7 @@ The model is continuously under development. Users will be notified through [closed PR threads](https://github.com/PSLmodels/OG-Core/pulls?q=is%3Apr+is%3Aclosed) and through the [release notes](https://github.com/PSLmodels/OG-Core/releases) what changes have been implemented. The package will have released versions, which will be checked against existing code prior to release. Stay tuned for an upcoming release! -(Sec_CitingOGUSA)= +(Sec_CitingOGCore)= ## Citing OG-Core `OG-Core` (Version #.#.#)[Source code], https://github.com/PSLmodels/OG-Core From 414dda0526cad43269e68c6452a49b5927405b31 Mon Sep 17 00:00:00 2001 From: Richard Evans Date: Thu, 31 Mar 2022 02:35:42 -0600 Subject: [PATCH 03/16] Removed erroneous reference to OG-USA from government.md --- docs/book/content/theory/government.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/book/content/theory/government.md b/docs/book/content/theory/government.md index 247ac0de7..cd72f5187 100644 --- a/docs/book/content/theory/government.md +++ b/docs/book/content/theory/government.md @@ -296,5 +296,4 @@ And finally, in closure rules {eq}`EqUnbalGBCclosure_Gt` and {eq}`EqUnbalGBCclos (SecUBIfootnotes)= ## Footnotes - -[^GrowthAdj_note]: We impose this requirement of `ubi_growthadj = False` when `g_y_annual < 0` in the [`ogusa_default_parameters.json`](https://github.com/PSLmodels/OG-USA/blob/master/ogusa/ogusa_default_parameters.json) "validators" specification of the parameter. +[^GrowthAdj_note]: We impose this requirement of `ubi_growthadj = False` when `g_y_annual < 0` in the [`default_parameters.json`](https://github.com/PSLmodels/OG-Core/blob/master/ogcore/default_parameters.json) "validators" specification of the parameter. From 9e4b93ca0ccba4f2b848aac9596d0f5ae80158bb Mon Sep 17 00:00:00 2001 From: Richard Evans Date: Thu, 31 Mar 2022 02:40:14 -0600 Subject: [PATCH 04/16] Update ogcore package version in Makefile --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 8d1608e5d..fbf7f3111 100644 --- a/Makefile +++ b/Makefile @@ -28,7 +28,7 @@ clean: .PHONY=package package: - @pbrelease OG-Core ogcore 0.0.0 --local + @pbrelease OG-Core ogcore 0.8.0 --local .PHONY=pytest pytest: From 9942d2cee2651da9472e2c0ba9474135ebe5a340 Mon Sep 17 00:00:00 2001 From: Richard Evans Date: Thu, 31 Mar 2022 02:43:17 -0600 Subject: [PATCH 05/16] Update version number in __init__.py --- ogcore/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ogcore/__init__.py b/ogcore/__init__.py index b017efa1a..7b894d6ac 100644 --- a/ogcore/__init__.py +++ b/ogcore/__init__.py @@ -19,4 +19,4 @@ from ogcore.txfunc import * from ogcore.utils import * -__version__ = '0.0.0' +__version__ = '0.8.0' From b3ae87aaae5f57b266a70214628fc806b02057bd Mon Sep 17 00:00:00 2001 From: Richard Evans Date: Thu, 31 Mar 2022 02:47:35 -0600 Subject: [PATCH 06/16] Add new tests folder to codecov.yml ignore --- codecov.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codecov.yml b/codecov.yml index 3d35e1838..f72701275 100644 --- a/codecov.yml +++ b/codecov.yml @@ -23,6 +23,6 @@ ignore: - "setup.py" - "./ogcore/_version.py" - "./cs-config/**/*" # ignore folders and all its contents + - "./tests/" # ignore folders and all its contents - "./ogcore/tests/" # ignore folders and all its contents - "./regression/**/*" # ignore folders and all its contents - From 45b0c72e0280931da87e8d0e71d6385a1b075ab7 Mon Sep 17 00:00:00 2001 From: Richard Evans Date: Thu, 31 Mar 2022 03:23:17 -0600 Subject: [PATCH 07/16] Updated README.md --- README.md | 42 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 91a5a7c1e..d67243f9e 100644 --- a/README.md +++ b/README.md @@ -9,11 +9,47 @@ OG-Core is an overlapping-generations (OG) model core theory, logic, and solutio ## Disclaimer -The model is currently under development. Users should be forewarned that the model components could change significantly. Therefore, there is NO GUARANTEE OF ACCURACY. THE CODE SHOULD NOT CURRENTLY BE USED FOR PUBLICATIONS, JOURNAL ARTICLES, OR RESEARCH PURPOSES. Essentially, you should assume the calculations are unreliable until we finish the code re-architecture and have checked the results against other existing implementations of the tax code. The package will have released versions, which will be checked against existing code prior to release. Stay tuned for an upcoming release! +The model is constantly under development, and model components could change significantly. The package will have released versions, which will be checked against existing code prior to release. Stay tuned for an upcoming release! ## Using/contributing to OG-Core +There are two primary methods for installing and running OG-Core on your computer locally. The first and simplest method is to download the most recent `ogcore` Python package from the Python Package Index ([PyPI.org]()). A second option is to fork and clone the most recent version of OG-Core from its GitHub repository and create the conda environment for the `ogcore` package. We detail both of these methods below. + + +### Installing and Running OG-Core from Python Package Index (PyPI.org) + +* Open your terminal (or Conda command prompt), and make sure you have the most recent version of `pip` (the Python Index Package manager) by typing on a Unix/macOS machine `python3 -m pip install --upgrade pip` or on a Windows machine `py -m pip install --upgrade pip`. +* Install the [`ogcore`](https://pypi.org/project/ogcore/) package from the Python Package Index by typing `pip install ogcore`. +* Navigate to a folder `./YourFolderName/` where you want to save scripts to run OG-Core and output from the simulations in those scripts. +* Save the python script [`run_ogcore_example.py`](https://github.com/PSLmodels/OG-Core/blob/master/run_examples/run_ogcore_example.py) from the OG-Core GitHub repository in the folder where you are working on your local machine `./YourFolderName/run_ogcore_example.py`. +* Run the model with an example reform from terminal/command prompt by typing `python run_ogcore_example.py` +* You can adjust the `run_ogcore_example.py` script by modifying model parameters specified in the `og_spec` dictionary. +* Model outputs will be saved in the following files: + * `./run_example_plots` + * This folder will contain a number of plots generated from OG-Core to help you visualize the output from your run + * `./ogcore_example_output.csv` + * This is a summary of the percentage changes in macro variables over the first ten years and in the steady-state. + * `./OUTPUT_BASELINE/model_params.pkl` + * Model parameters used in the baseline run + * See [`execute.py`](https://github.com/PSLmodels/OG-Core/blob/master/ogcore/execute.py) in the OG-Core repository for items in the dictionary object in this pickle file + * `./OUTPUT_BASELINE/SS/SS_vars.pkl` + * Outputs from the model steady state solution under the baseline policy + * See [`SS.py`](https://github.com/PSLmodels/OG-Core/blob/master/ogcore/SS.py) in the OG-Core repository for what is in the dictionary object in this pickle file + * `./OUTPUT_BASELINE/TPI/TPI_vars.pkl` + * Outputs from the model timepath solution under the baseline policy + * See [`TPI.py`](https://github.com/PSLmodels/OG-Core/blob/master/ogcore/TPI.py) in the OG-Core repository for what is in the dictionary object in this pickle file + * An analogous set of files in the `./OUTPUT_REFORM` directory, which represent objects from the simulation of the reform policy + +Note that, depending on your machine, a full model run (solving for the full time path equilibrium for the baseline and reform policies) can take more than two hours of compute time. + +If you run into errors running the example script, please open a new issue in the OG-Core repo with a description of the issue and any relevant tracebacks you receive. + +The CSV output file `./ogcore_example_output.csv` can be compared to the [`./run_examples/expected_ogcore_example_output.csv`](https://github.com/PSLmodels/OG-Core/blob/master/run_examples/expected_ogcore_example_output.csv) file in the OG-Core repository to confirm that you are generating the expected output. The easiest way to do this is to copy the [`example-diffs`](https://github.com/PSLmodels/OG-Core/blob/master/run_examples/example-diffs) and [`example-diffs.bat`](https://github.com/PSLmodels/OG-Core/blob/master/run_examples/example-diffs.bat) files from the OG-Core repository and use the `sh example-diffs` command (or `example-diffs` on Windows) from the `run_examples` directory. If you run into errors running the example script, please open a new issue in the OG-Core repo with a description of the issue and any relevant tracebacks you receive. + + +### Installing and Running OG-Core from GitHub repository + * Install the [Anaconda distribution](https://www.anaconda.com/distribution/) of Python * Clone this repository to a directory on your computer * From the terminal (or Conda command prompt), navigate to the directory to which you cloned this repository and run `conda env create -f environment.yml` @@ -21,7 +57,7 @@ The model is currently under development. Users should be forewarned that the mo * Then install by `pip install -e .` * Navigate to `./run_examples` * Run the model with an example reform from terminal/command prompt by typing `python run_ogcore_example.py` -* You can adjust the `./run_examples/run_ogcore_example.py` by modifying model parameters specified in the `og_spec` dictionary. +* You can adjust the `./run_examples/run_ogcore_example.py` script by modifying model parameters specified in the `og_spec` dictionary. * Model outputs will be saved in the following files: * `./run_examples/run_example_plots` * This folder will contain a number of plots generated from OG-Core to help you visualize the output from your run @@ -55,4 +91,4 @@ The core maintainers of the OG-Core repository are: ## Citing OG-Core -OG-Core (Version 0.0.0)[Source code], https://github.com/PSLmodels/OG-Core +OG-Core (Version #.#.#)[Source code], https://github.com/PSLmodels/OG-Core From 13a470e0ef70973d799bd16f3fb1be8f59a2cfa5 Mon Sep 17 00:00:00 2001 From: Richard Evans Date: Thu, 31 Mar 2022 03:49:25 -0600 Subject: [PATCH 08/16] Updated setup.py --- setup.py | 91 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 45 insertions(+), 46 deletions(-) diff --git a/setup.py b/setup.py index 6d56828e2..032de4877 100755 --- a/setup.py +++ b/setup.py @@ -1,48 +1,47 @@ -try: - from setuptools import setup -except ImportError: - from distutils.core import setup +import setuptools -with open('README.md') as f: - longdesc = f.read() +with open("README.md", "r", encoding="utf-8") as fh: + longdesc = fh.read() -version = '0.8.0' - -config = { - 'description': 'A general equilibribum overlapping generations model for fiscal policy analysis', - 'long_description_content_type': 'text/markdown', - 'long_description': longdesc, - 'url': 'https://github.com/PSLmodels/OG-Core/', - 'download_url': 'https://github.com/PLSmodels/OG-Core/', - 'version': version, - 'license': 'CC0 1.0 Universal (CC0 1.0) Public Domain Dedication', - 'packages': ['ogcore'], - 'include_package_data': True, - 'name': 'ogcore', - 'install_requires': [ - 'mkl', 'psutil', 'scipy', 'pandas', 'matplotlib', 'dask', - 'distributed', 'paramtools'], - 'package_data': { - 'ogcore': [ - 'default_parameters.json', - 'data/ability/*', - 'data/demographic/*', - 'data/labor/*', - 'data/wealth/*'] - }, - 'classifiers': [ - 'Development Status :: 2 - Pre-Alpha', - 'Intended Audience :: Developers', - 'Natural Language :: English', - 'License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication', - 'Operating System :: OS Independent', - 'Programming Language :: Python', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.7', - 'Programming Language :: Python :: 3.8', - 'Programming Language :: Python :: 3.9', - 'Topic :: Software Development :: Libraries :: Python Modules'], - 'tests_require': ['pytest'] -} - -setup(**config) +setuptools.setup( + name="ogcore", + version="0.8.0", + license="CC0 1.0 Universal (CC0 1.0) Public Domain Dedication", + description="A general equilibribum overlapping generations model for fiscal policy analysis", + long_description_content_type="text/markdown", + long_description=longdesc, + url="https://github.com/PSLmodels/OG-Core/", + download_url="https://github.com/PLSmodels/OG-Core/", + project_urls={ + "Issue Tracker": "https://github.com/PSLmodels/OG-Core/issues", + }, + packages=["ogcore"], + package_data={ + "ogcore": [ + "default_parameters.json", + "data/ability/*", + "data/demographic/*", + "data/labor/*", + "data/wealth/*" + ] + }, + include_packages=True, + install_requires=[ + "mkl", "psutil", "scipy", "pandas", "matplotlib", "dask", + "distributed", "paramtools" + ], + classifiers=[ + "Development Status :: 2 - Pre-Alpha", + "Intended Audience :: Developers", + "Natural Language :: English", + "License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication", + "Operating System :: OS Independent", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Topic :: Software Development :: Libraries :: Python Modules" + ], + tests_require=["pytest"] +) From 1bfd44e09795a241697023491e15bf290f2b9e77 Mon Sep 17 00:00:00 2001 From: Richard Evans Date: Thu, 31 Mar 2022 03:55:04 -0600 Subject: [PATCH 09/16] Added author field to setup.py --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 032de4877..65670e13f 100755 --- a/setup.py +++ b/setup.py @@ -6,6 +6,7 @@ setuptools.setup( name="ogcore", version="0.8.0", + author="Jason DeBacker, Richard W. Evans " license="CC0 1.0 Universal (CC0 1.0) Public Domain Dedication", description="A general equilibribum overlapping generations model for fiscal policy analysis", long_description_content_type="text/markdown", From 926de8984604f5cf34a063adef1234188af135ba Mon Sep 17 00:00:00 2001 From: Richard Evans Date: Thu, 31 Mar 2022 03:59:59 -0600 Subject: [PATCH 10/16] Added email to setup.py --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 65670e13f..6b8a1bed9 100755 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ setuptools.setup( name="ogcore", version="0.8.0", - author="Jason DeBacker, Richard W. Evans " + author="Jason DeBacker and Richard W. Evans " license="CC0 1.0 Universal (CC0 1.0) Public Domain Dedication", description="A general equilibribum overlapping generations model for fiscal policy analysis", long_description_content_type="text/markdown", From 1666344703f744bd5f68ecf2d56c820e58e9ae41 Mon Sep 17 00:00:00 2001 From: Richard Evans Date: Thu, 31 Mar 2022 04:02:09 -0600 Subject: [PATCH 11/16] Removed email from setup.py --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 6b8a1bed9..b26efe54e 100755 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ setuptools.setup( name="ogcore", version="0.8.0", - author="Jason DeBacker and Richard W. Evans " + author="Jason DeBacker and Richard W. Evans" license="CC0 1.0 Universal (CC0 1.0) Public Domain Dedication", description="A general equilibribum overlapping generations model for fiscal policy analysis", long_description_content_type="text/markdown", From c803e90728a4478a3e906d0bc22708ab518edd8d Mon Sep 17 00:00:00 2001 From: Richard Evans Date: Thu, 31 Mar 2022 09:38:01 -0600 Subject: [PATCH 12/16] Added install_requires params to setup.py --- setup.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index b26efe54e..ad820ffbd 100755 --- a/setup.py +++ b/setup.py @@ -28,8 +28,16 @@ }, include_packages=True, install_requires=[ - "mkl", "psutil", "scipy", "pandas", "matplotlib", "dask", - "distributed", "paramtools" + "python>=3.7.7", + "mkl>=2021.4.0", + "psutil", + "scipy>=1.7.1", + "pandas>=1.2.5", + "matplotlib", + "dask>=2.30.0", + "distributed>=2.30.1", + "paramtools>=0.15.0", + "requests" ], classifiers=[ "Development Status :: 2 - Pre-Alpha", From 34b8c03fcc2f77aba5f3c9e27f07ab40b93e1d5c Mon Sep 17 00:00:00 2001 From: Richard Evans Date: Thu, 31 Mar 2022 09:50:48 -0600 Subject: [PATCH 13/16] Fixed typo in setup.py --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index ad820ffbd..607467295 100755 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ setuptools.setup( name="ogcore", version="0.8.0", - author="Jason DeBacker and Richard W. Evans" + author="Jason DeBacker and Richard W. Evans", license="CC0 1.0 Universal (CC0 1.0) Public Domain Dedication", description="A general equilibribum overlapping generations model for fiscal policy analysis", long_description_content_type="text/markdown", @@ -27,8 +27,8 @@ ] }, include_packages=True, + python_requires=">=3.7.7", install_requires=[ - "python>=3.7.7", "mkl>=2021.4.0", "psutil", "scipy>=1.7.1", From 74f5b248115458122782896edfc167ca2937cedf Mon Sep 17 00:00:00 2001 From: Richard Evans Date: Thu, 31 Mar 2022 09:51:14 -0600 Subject: [PATCH 14/16] Added pyproject.toml --- pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 pyproject.toml diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 000000000..b0f076532 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["setuptools>=42"] +build-backend = "setuptools.build_meta" From db49dd9db49147b2722fb5a5fae3214b4b2772fb Mon Sep 17 00:00:00 2001 From: Richard Evans Date: Thu, 31 Mar 2022 09:54:40 -0600 Subject: [PATCH 15/16] Updated version to 0.8.1 in three files --- Makefile | 2 +- ogcore/__init__.py | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index fbf7f3111..20025bd6b 100644 --- a/Makefile +++ b/Makefile @@ -28,7 +28,7 @@ clean: .PHONY=package package: - @pbrelease OG-Core ogcore 0.8.0 --local + @pbrelease OG-Core ogcore 0.8.1 --local .PHONY=pytest pytest: diff --git a/ogcore/__init__.py b/ogcore/__init__.py index 7b894d6ac..31aaf681e 100644 --- a/ogcore/__init__.py +++ b/ogcore/__init__.py @@ -19,4 +19,4 @@ from ogcore.txfunc import * from ogcore.utils import * -__version__ = '0.8.0' +__version__ = '0.8.1' diff --git a/setup.py b/setup.py index 607467295..995d43d25 100755 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setuptools.setup( name="ogcore", - version="0.8.0", + version="0.8.1", author="Jason DeBacker and Richard W. Evans", license="CC0 1.0 Universal (CC0 1.0) Public Domain Dedication", description="A general equilibribum overlapping generations model for fiscal policy analysis", From a45debba5708f3ba9ae10f7781c93bfc6db757de Mon Sep 17 00:00:00 2001 From: Richard Evans Date: Thu, 31 Mar 2022 11:57:50 -0600 Subject: [PATCH 16/16] Deleted lines 29-31 from old package builder --- Makefile | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Makefile b/Makefile index db127d402..303a3a0d6 100644 --- a/Makefile +++ b/Makefile @@ -26,10 +26,6 @@ clean: @find . -name *cache -maxdepth 1 -exec rm -r {} \; @conda uninstall ccc --yes --quiet 2>&1 > /dev/null -.PHONY=package -package: - @pbrelease OG-Core ogcore 0.8.1 --local - .PHONY=pytest pytest: @cd ogcore ; pytest -W ignore