|
6 | 6 | import time |
7 | 7 | from logging_logic import log_execution_time |
8 | 8 |
|
| 9 | +STEP_NAME = "income_adjustment" |
9 | 10 |
|
10 | | -@orca.step("update_income") |
11 | | -def update_income(persons, households, income_rates, year): |
| 11 | +@orca.step(STEP_NAME) |
| 12 | +def income_adjustment(persons, households, income_rates, year): |
12 | 13 | """ |
13 | | - Updating income for persons and households |
| 14 | + Update person-level earnings based on county-specific income growth rates. |
14 | 15 |
|
15 | | - Args: |
16 | | - persons (DataFrameWrapper): DataFrameWrapper of persons table |
17 | | - households (DataFrameWrapper): DataFrameWrapper of households table |
18 | | - year (int): simulation year |
| 16 | + This step applies multiplicative adjustments to person earnings using annual |
| 17 | + growth rates that vary by county. It maintains geographic variation in income |
| 18 | + trajectories while updating the entire population simultaneously. |
| 19 | +
|
| 20 | + Parameters |
| 21 | + ---------- |
| 22 | + persons : orca.Table |
| 23 | + The persons table containing individual-level attributes including earnings. |
| 24 | + households : orca.Table |
| 25 | + The households table containing household-level attributes including county ID. |
| 26 | + income_rates : orca.Table |
| 27 | + Table with annual income growth rates by county. |
| 28 | + year : int |
| 29 | + The current simulation year. |
| 30 | +
|
| 31 | + Returns |
| 32 | + ------- |
| 33 | + None |
| 34 | +
|
| 35 | + Notes |
| 36 | + ----- |
| 37 | + - Modifies `persons.earning` in place using multiplicative adjustment. |
| 38 | + - Requires `income_rates` table with columns: year, lcm_county_id, rate. |
| 39 | + - All persons in the same county receive the same proportional adjustment. |
| 40 | + - Rate of 0.05 means 5% growth (earnings multiplied by 1.05). |
19 | 41 | """ |
20 | 42 | start_time = time.time() |
21 | 43 | # TODO: CountyID is not being updated by default |
|
0 commit comments