Skip to content

Commit

Permalink
Merge pull request #110 from rickecon/rpy2
Browse files Browse the repository at this point in the history
Updated ryp2 dependency
  • Loading branch information
jdebacker authored May 17, 2024
2 parents 252161e + 63e927b commit 60f204f
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 4 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ jobs:
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Set up R ${{ matrix.r-version }}
uses: r-lib/actions/setup-r@v2
with:
r-version: release
- name: Setup Miniconda using Python ${{ matrix.python-version }}
uses: conda-incubator/setup-miniconda@v3
with:
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.1.7] - 2024-05-14 16:30:00

### Added

- Updates the dependency `rpy2>=3.5.12` in `environment.yml` and `setup.py`.


## [0.1.6] - 2024-05-08 10:30:00

### Added
Expand Down Expand Up @@ -90,6 +97,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0



[0.1.7]: https://github.com/PSLmodels/OG-USA/compare/v0.1.6...v0.1.7
[0.1.6]: https://github.com/PSLmodels/OG-USA/compare/v0.1.5...v0.1.6
[0.1.5]: https://github.com/PSLmodels/OG-USA/compare/v0.1.4...v0.1.5
[0.1.4]: https://github.com/PSLmodels/OG-USA/compare/v0.1.3...v0.1.4
Expand Down
3 changes: 2 additions & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ dependencies:
- python>=3.7.7,<3.12
- numpy
- setuptools
- wheel
- numba>=0.54
- scipy>=1.7.1
- pandas>=1.2.5
Expand All @@ -26,10 +27,10 @@ dependencies:
- xlwt
- statsmodels
- linearmodels
- rpy2<=3.5.11
- black>=24.1.1
- pip
- pip:
- rpy2>=3.5.12
- openpyxl>=3.1.2
- cs-kit
- cs2tc
Expand Down
8 changes: 7 additions & 1 deletion ogusa/psid_data_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@
import datetime
from linearmodels import PanelOLS
from rpy2.robjects import r
from rpy2.robjects import conversion
from rpy2.robjects import default_converter
from rpy2.robjects import pandas2ri
from rpy2.robjects.packages import importr
from ogusa.constants import PSID_NOMINAL_VARS, PSID_CONSTANT_VARS


pandas2ri.activate()
pd.options.mode.chained_assignment = "raise"

Expand All @@ -34,7 +38,9 @@ def prep_data(data="psid1968to2015.RData"):
"""
# Read data from R into pandas dataframe
r["load"](os.path.join(CURDIR, "..", "data", "PSID", data))
raw_df = r("psid_df")
raw_r_df = r("psid_df")
with (default_converter + pandas2ri.converter).context():
raw_df = conversion.get_conversion().rpy2py(raw_r_df)

# Create unique identifier for each household
# note that will define a new household if head or spouse changes
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="ogusa",
version="0.1.6",
version="0.1.7",
author="Jason DeBacker and Richard W. Evans",
license="CC0 1.0 Universal (CC0 1.0) Public Domain Dedication",
description="USA calibration for OG-Core",
Expand All @@ -32,7 +32,7 @@
"paramtools>=0.15.0",
"taxcalc>=3.0.0",
"requests",
"rpy2<=3.5.11",
"rpy2>=3.5.12",
"pandas-datareader",
"xlwt",
"openpyxl>=3.1.2",
Expand Down

0 comments on commit 60f204f

Please sign in to comment.