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

オープン
#447 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
python

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.
主要言語
Python
スター
1
フォーク
3
平均マージ
20時間 4分
マージ済み PR(30日)
39

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

PolicyEngine/chronicle のほかの issue

PolicyEngine/chronicle の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。