Skip to content

Commit d0da378

Browse files
committed
Updated previous PR merged files
2 parents 5cb0913 + f76173d commit d0da378

File tree

937 files changed

+16226
-4406
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

937 files changed

+16226
-4406
lines changed

.github/workflows/build_and_test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
with:
1515
persist-credentials: false
1616
- name: Set up Python
17-
uses: actions/setup-python@v4
17+
uses: actions/setup-python@v5
1818
with:
1919
python-version: ${{ matrix.python-version }}
2020
- name: Install package

.github/workflows/check_format.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
runs-on: ubuntu-latest
88
steps:
99
- uses: actions/checkout@v4
10-
- uses: actions/setup-python@v4
10+
- uses: actions/setup-python@v5
1111
- uses: psf/black@stable
1212
with:
1313
options: "-l 79 --check"

.github/workflows/deploy_docs.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ jobs:
1515
- name: Setup Miniconda
1616
uses: conda-incubator/setup-miniconda@v2
1717
with:
18-
miniforge-variant: Mambaforge
18+
miniconda-version: "latest"
1919
activate-environment: fiscalsim-us-dev
2020
environment-file: environment.yml
21-
python-version: "3.10"
21+
python-version: "3.11"
2222
auto-activate-base: false
2323
- name: Install package and build documentation
2424
shell: bash -l {0}

.github/workflows/docs_check.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- name: Setup Miniconda
1313
uses: conda-incubator/setup-miniconda@v2
1414
with:
15-
miniforge-variant: Mambaforge
15+
miniconda-version: "latest"
1616
activate-environment: fiscalsim-us-dev
1717
environment-file: environment.yml
1818
python-version: "3.11"

.github/workflows/publish_to_pypi.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ jobs:
1414
- name: Checkout repo
1515
uses: actions/checkout@v4
1616
- name: Setup Python
17-
uses: actions/setup-python@v4
17+
uses: actions/setup-python@v5
1818
with:
19-
python-version: "3.10"
19+
python-version: "3.11"
2020
- name: Build package
2121
run: make pip-package
2222
- name: Publish a Python distribution to PyPI

CHANGELOG.md

+48-2
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,52 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [0.2.10] - 2024-05-10 04:30:00
8+
9+
## [0.3.6] - 2024-11-21 18:30:00
910

1011
### Added
1112

1213
- Updates Minnesota tax logic to 2023 law
1314

15+
## [0.3.5] - 2024-11-21 00:30:00
16+
17+
### Added
18+
19+
- Updated and fixed Arkansas parameters, variables and tests.
20+
21+
## [0.3.4] - 2024-11-14 00:30:00
22+
23+
### Added
24+
25+
- Updated and fixed Louisiana parameters, variables and tests.
26+
27+
## [0.3.3] - 2024-11-07 23:30:00
28+
29+
### Added
30+
31+
- Updated and fixed Kentucky, Maryland, and Vermont parameters, variables and tests.
32+
- Removed `tools/taxcalc/` directory
33+
34+
## [0.3.2] - 2024-10-10 3:00:00
35+
36+
### Added
37+
38+
- Updated 4 files to remove type errors.
39+
40+
## [0.3.1] - 2024-10-04 12:00:00
41+
42+
### Added
43+
44+
- Updates IRS rate threshholds and standard deduction amounts in `parameters.gov.irs.income.bracket.yaml` and in `parameters.gov.irs.deductions.standard.amount.yaml`
45+
- Renames `WIDOW` filer type to `SURVIVING_SPOUSE`
46+
47+
## [0.3.0] - 2024-10-03 02:00:00
48+
49+
### Added
50+
51+
- Updates South Carolina tax logic and tests
52+
- Replaces Mambaforge Python installer with Miniforge in GH Actions
53+
1454
## [0.2.9] - 2024-04-11 00:30:00
1555

1656
### Added
@@ -217,7 +257,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
217257
- First prototype version based off of openfisca-us and tax-calculator.
218258

219259

220-
[0.2.10]: https://github.com/TheCGO/fiscalsim-us/compare/v0.2.9...v0.2.10
260+
[0.3.6]: https://github.com/TheCGO/fiscalsim-us/compare/v0.3.5...v0.3.6
261+
[0.3.5]: https://github.com/TheCGO/fiscalsim-us/compare/v0.3.4...v0.3.5
262+
[0.3.4]: https://github.com/TheCGO/fiscalsim-us/compare/v0.3.3...v0.3.4
263+
[0.3.3]: https://github.com/TheCGO/fiscalsim-us/compare/v0.3.2...v0.3.3
264+
[0.3.2]: https://github.com/TheCGO/fiscalsim-us/compare/v0.3.1...v0.3.2
265+
[0.3.1]: https://github.com/TheCGO/fiscalsim-us/compare/v0.3.0...v0.3.1
266+
[0.3.0]: https://github.com/TheCGO/fiscalsim-us/compare/v0.2.9...v0.3.0
221267
[0.2.9]: https://github.com/TheCGO/fiscalsim-us/compare/v0.2.8...v0.2.9
222268
[0.2.8]: https://github.com/TheCGO/fiscalsim-us/compare/v0.2.7...v0.2.8
223269
[0.2.7]: https://github.com/TheCGO/fiscalsim-us/compare/v0.2.6...v0.2.7

changelog.yaml

+34-1
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,41 @@
191191
- Limits `docs_check.yml` to only run on pull request commits.
192192
- Updates some tags in `README.md.`
193193
date: 2024-04-11 00:30:00
194+
- bump: minor
195+
changes:
196+
added:
197+
- Updates South Carolina tax logic and tests.
198+
- Replaces Mambaforge Python installer with Miniforge in GH Actions
199+
date: 2024-10-03 02:00:00
200+
- bump: patch
201+
changes:
202+
added:
203+
- Updates IRS rate threshholds and standard deduction amounts in `parameters.gov.irs.income.bracket.yaml` and in `parameters.gov.irs.deductions.standard.amount.yaml`
204+
- Renames `WIDOW` filer type to `SURVIVING_SPOUSE`
205+
date: 2024-10-04 12:00:00
206+
- bump: patch
207+
changes:
208+
added:
209+
- Updated 4 files to remove type errors.
210+
date: 2024-10-10 3:00:00
211+
- bump: patch
212+
changes:
213+
added:
214+
- Updated and fixed Kentucky, Maryland, and Vermont parameters, variables and tests.
215+
- Removed `tools/taxcalc/` directory
216+
date: 2024-11-07 23:30:00
217+
- bump: patch
218+
changes:
219+
added:
220+
- Updated and fixed Louisiana parameters, variables and tests.
221+
date: 2024-11-14 00:30:00
222+
- bump: patch
223+
changes:
224+
added:
225+
- Updated and fixed Arkansas parameters, variables and tests.
226+
date: 2024-11-21 00:30:00
194227
- bump: patch
195228
changes:
196229
added:
197230
- Updates Minnesota tax logic to 2023 law
198-
date: 2024-05-10 04:30:00
231+
date: 2024-11-21 18:30:00

environment.yml

+9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
name: fiscalsim-us-dev
2+
channels:
3+
- conda-forge
24
dependencies:
35
- python>=3.10,<3.12
6+
- sphinx>=3.5.4
7+
- sphinx-argparse
8+
- sphinxcontrib-bibtex>=2.0.0
9+
- sphinx-math-dollar
10+
- pydata-sphinx-theme
11+
- jupyter-book>=0.11.3
12+
- jupyter
413
- pip

fiscalsim_us/data/datasets/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ If you are updating the microdata (e.g., modifying code in `cps.py`), you will n
55
Steps:
66
1. Clear old microdata with `rm fiscalsim_us/data/storage/*.h5`
77
2. Generate new microdata in Python with a command like this: `python -c "from fiscalsim_us.data import CPS_2023; CPS_2023().generate()"`
8-
3. Make a copy of the new microdata file with a name that includes the _bumped_ version number. For example, if FiscalSim US is currently version 0.1.0 and you are updating the 2023 CPS in a minor-bump PR, run `cp fiscalsim_us/data/storage/cps_2023.h5 fiscalsim_us/data/storage/cps_2023_v0_263_5.h5`.
8+
3. Make a copy of the new microdata file with a name that includes the _bumped_ version number. For example, if FiscalSim-US is currently version 0.2.9 and you are updating the 2023 CPS in a minor-bump PR, run `cp fiscalsim_us/data/storage/cps_2023.h5 fiscalsim_us/data/storage/cps_2023_v0_263_5.h5`.
99
4. Upload this new file to [github.com/TheCGO/fiscalsim-us/releases](https://github.com/TheCGO/fiscalsim-us/releases), both overwriting the existing unversioned file (delete the old one) and adding the versioned file as a new release.
10-
5. Update the `CPS_2023` class in `fiscalsim_us/data/cps.py` to point to the new versioned file, e.g. `new_url="release://TheCGO/fiscalsim-us/cps-2023/cps_2023_v0_263_5.h5",`.
10+
5. Update the `CPS_2023` class in `fiscalsim_us/data/cps.py` to point to the new versioned file, e.g. `new_url="release://TheCGO/fiscalsim-us/v0.2.9/cps_2023_v0_2_9.h5",`.
1111
6. Verify that this works by downloading it, e.g. `python -c "from fiscalsim_us.data import CPS_2023; CPS_2023().download()"`.

fiscalsim_us/data/datasets/cps/cps.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def add_silver_plan_cost(self, cps: h5py.File, year: int):
5757
cps (h5py.File): The CPS dataset file.
5858
year (int): The year of the data.
5959
"""
60-
from policyengine_us import Microsimulation
60+
from fiscalsim_us import Microsimulation
6161

6262
sim = Microsimulation(dataset=self)
6363
slspc = sim.calc("second_lowest_silver_plan_cost", year).values
@@ -374,5 +374,5 @@ class CPS_2022(CPS):
374374
"cps_2023",
375375
"CPS 2023",
376376
STORAGE_FOLDER / "cps_2023.h5",
377-
new_url="release://policyengine/policyengine-us/cps-2023/cps_2023.h5",
377+
new_url="release://TheCGO/fiscalsim-us/v0.2.9/cps_2023.h5",
378378
)

fiscalsim_us/data/datasets/cps/enhanced_cps/enhanced_cps.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ class EnhancedCPS_2023(Dataset):
88
file_path = STORAGE_FOLDER / "enhanced_cps.h5"
99
data_format = Dataset.ARRAYS
1010
time_period = "2023"
11-
url = (
12-
"release://policyengine/fiscalsim-us/enhanced-cps-2023/enhanced_cps.h5"
13-
)
11+
url = "release://policyengine/policyengine-us/enhanced-cps-2023/enhanced_cps.h5"
1412

1513
def generate(self):
1614
from .puf_extended_cps import PUFExtendedCPS_2023

fiscalsim_us/data/datasets/cps/enhanced_cps/tmp/puf_imputation.py

+9-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
filing_status={
4545
"SINGLE": 1,
4646
"JOINT": 2,
47-
"WIDOW": 2,
47+
"SURVIVING_SPOUSE": 2,
4848
"SEPARATE": 3,
4949
"HEAD_OF_HOUSEHOLD": 4,
5050
}
@@ -125,7 +125,14 @@ def load_model():
125125

126126
with col1:
127127
mars = st.selectbox(
128-
"MARS", ["SINGLE", "JOINT", "WIDOW", "SEPARATE", "HEAD_OF_HOUSEHOLD"]
128+
"MARS",
129+
[
130+
"SINGLE",
131+
"JOINT",
132+
"SURVIVING_SPOUSE",
133+
"SEPARATE",
134+
"HEAD_OF_HOUSEHOLD",
135+
],
129136
)
130137
child_dependents = st.number_input(
131138
"Child dependents", min_value=0, max_value=10, value=0

fiscalsim_us/data/datasets/cps/raw_cps.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,10 @@ def generate(self) -> pd.DataFrame:
155155
"Received a 404 response when fetching the data."
156156
)
157157
try:
158-
with BytesIO() as file, pd.HDFStore(
159-
self.file_path, mode="w"
160-
) as storage:
158+
with (
159+
BytesIO() as file,
160+
pd.HDFStore(self.file_path, mode="w") as storage,
161+
):
161162
content_length_actual = 0
162163
for data in response.iter_content(int(1e6)):
163164
progress_bar.update(len(data))

0 commit comments

Comments
 (0)