US district facts for Microcosm's local-area fit: SOI district AGI classes and more columns, ACS district tables, county SNAP

Đang mở
#447 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
25/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python

Hướng nghiên cứu

Start with the existing irs_soi/congressional_district_2022 and ACS district packages, then compare the IRS column guide at tests/data/irs_soi_doc_guides/22incddocguide.tsv with the cited state AGI packages. The issue lays out the requested feed correction, district data extensions, ACS tables, and USDA SNAP package in priority order; begin with item 1.1 and verify the district rows returned for SALT and the premium tax credit. Done means the requested packages and measures are available in Chronicle and the relevant feed records reflect them.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Why

Microcosm's US local-area build fits few district targets. The epic is PolicyEngine/microcosm#1730, and PolicyEngine/microcosm#1728 holds the target work.

This issue lists everything that work needs from Chronicle: one feed change, the extensions of one package, and the new packages. I checked Chronicle main at 86d72fd3 (24 November) and the US feed pin 41b2fb2b.

What Chronicle already has

These need no work. They are listed so that nobody builds them again.

Package Content
census/acs_s0101_district_2024 ACS 2024 1-year population in 18 age bands, 436 districts, 119th plan
census/acs_s2201_district_2024 ACS 2024 1-year households, in total and by SNAP receipt, 436 districts, 119th plan
irs_soi/congressional_district_2022 62 measures for all returns, 117th plan. Since #345 it reads limited SALT from N18460/A18460 and the premium tax credit from N85770/A85770
census/acs1_b11001_state_2024, census/acs_s0101_state_2024, census/pep_2025_state_age_bands State parents for households and age
census/acs5_*_county_2024, census/pep_county_2024, irs_soi/county_2022 County tables

The two ACS district packages are in the tree at the US feed pin too. Microcosm's feed scope does not read them yet. That is a Microcosm change.

1. Corrections

1.1 The US feed branch does not have the column correction.

  • Microcosm's US feed pin is 41b2fb2b. It is on a feed/us-* branch that leaves main at c5e5bf8 (16 September).
  • #345 (commit a90ad379, 12 October) is on main only.
  • So at the pin, the district package still reads N18425/A18425 for limited SALT and N85530/A85530 for the premium tax credit. Microcosm keeps those rows off its district surface (PolicyEngine/microcosm#1038).
  • Needed: a feed commit that carries a90ad379, or a US re-pin to main.
  • a90ad379 also changes the QBI columns of two Historic Table 2 packages and renames the interest-paid measures. So Microcosm must review the national and state rows that move with it.

1.2 net_capital_gains_* names two measures. #307 is open. The district file's N01000/A01000 is Form 1040 line 7. Table 1.4 columns 37 and 38 are the Schedule D gain. Microcosm corrects for it in its compiler (PolicyEngine/microcosm#1035, PolicyEngine/microcosm#1038). No new request here.

1.3 The tax-year stamp of the district record set. On main the record set is irs_soi.ty2022.congressional_district_2022.all_returns with period 2022, so item 1 of #117 looks done. #117 is still open. PolicyEngine/microcosm#1030 prepares Microcosm to read the corrected stamp.

2. Extensions of irs_soi/congressional_district_2022

The IRS file 22incd.csv has 161 data columns. Each district has 10 income classes (agi_stub 0 to 9). The package reads 62 columns, and only at agi_stub: 0.

2.1 AGI classes.

  • Add the rows for agi_stub 1 to 9.
  • First measures: the return count (N1) and AGI (A00100) of each class.
  • They can nest under the state AGI packages (historic_table_2_state_agi_2022, historic_table_2_state_agi_2023). Confirm the class edges against the IRS guide and against those packages.

2.2 Columns that have a state twin in Historic Table 2. The state parent exists, so these district rows are usable at once.

Columns Guide text Twin measure id
N00200 / A00200 Salaries and wages wages_salaries_*
N02650 / A02650 Total income total_income_*
N04800 / A04800 Taxable income taxable_income_*
N07225 / A07225 Nonrefundable child and other dependent tax credit ctc_*
N18500 / A18500 Real estate taxes real_estate_taxes_*
N18300 / A18300 Taxes paid taxes_paid_deduction_*
N00700 / A00700 State and local income tax refunds taxable_state_local_income_tax_refunds_*
N04470 Returns with itemized deductions itemized_deductions_returns

2.3 Columns that have no state twin (84 columns). The district file has its own state rows, so a district row can nest in a state row of the same file. First candidates, with the guide text from tests/data/irs_soi_doc_guides/22incddocguide.tsv:

Columns Guide text
N04450 / A04450 Total standard deduction
N09400 / A09400 Self-employment tax
N85300 / A85300 Net investment income tax
N09600 / A09600 Alternative minimum tax
N85775 / A85775 Advance premium tax credit
N11560 / A11560 Net premium tax credit
N07180 / A07180 Child and dependent care credit
N07230 / A07230, N10960 / A10960 Nonrefundable and refundable education credits
N07240 / A07240 Retirement savings contribution credit
N03270 / A03270 Self-employment health insurance deduction
N03300 / A03300 Self-employment retirement plans
N03150 / A03150 IRA payments
N03210 / A03210 Student loan interest deduction
N10300 / A10300 Tax liability
MARS1, MARS2, MARS4, ELDERLY Return counts by filing status, and elderly returns. These are not in the guide extract, so confirm them in the guide

3. New ACS district packages

ACS 2024 1-year tables on the 119th plan, in the shape of the S0101 district package.

Table Content Use in Microcosm State parent
B19001 Household income brackets Fit None today. Add state and national B19001 (1-year) with it
B11001 Households by type Fit acs1_b11001_state_2024 exists
B19013 Median household income Check only (PolicyEngine/microcosm#1673) Add the state table with it
S1701 Poverty status Check only (PolicyEngine/microcosm#1673) Add the state table with it

Optional: district versions of the other county tables (B19025, B19051, B19061).

4. New SNAP package

USDA FNS county SNAP participation and issuance (PolicyEngine/microcosm#292). usda_snap has the state caseloads and the national history only. A county file gives an administrative county benchmark. By crosswalk it also gives a district benchmark that does not depend on a survey.

5. Later vintages

  • The 120th Congress plan (PolicyEngine/microcosm#1526): the ACS district packages on the new plan, when Census publishes them.
  • The IRS district file for a later tax year, when the IRS publishes it.

Order

  1. Item 1.1. It returns the SALT and premium tax credit district rows.
  2. Item 3: B19001 for districts and states, then B11001 for districts. ACS records can meet these targets directly.
  3. Item 2.2, then item 2.1.
  4. Item 4, then item 2.3.

Not requested here

  • State legislative districts: #138.
Ngôn ngữ chính
Python
Star
1
Fork
3
Merge trung bình
20 giờ 4 phút
Pull request đã merge (30 ngày)
39

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của PolicyEngine/chronicle

Tất cả issue của PolicyEngine/chronicle

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.