@@ -1534,8 +1534,6 @@ def select_random_subset_to_target(
15341534 }
15351535 )
15361536
1537- final_counts = pd .Series (ssn_card_type ).value_counts ().sort_index ()
1538-
15391537 # ============================================================================
15401538 # PROBABILISTIC FAMILY CORRELATION ADJUSTMENT
15411539 # ============================================================================
@@ -1559,8 +1557,6 @@ def select_random_subset_to_target(
15591557 )
15601558 print (f"Additional undocumented needed: { undocumented_needed :,.0f} " )
15611559
1562- families_adjusted = 0
1563-
15641560 if undocumented_needed > 0 :
15651561 # Identify households with mixed status (code 0 + code 3 members)
15661562 mixed_household_candidates = []
@@ -1584,7 +1580,6 @@ def select_random_subset_to_target(
15841580 # Randomly select from eligible code 3 members in mixed households to hit target
15851581 if len (mixed_household_candidates ) > 0 :
15861582 mixed_household_candidates = np .array (mixed_household_candidates )
1587- candidate_weights = person_weights [mixed_household_candidates ]
15881583
15891584 # Use probabilistic selection to hit target
15901585 selected_indices = select_random_subset_to_target (
@@ -1596,7 +1591,6 @@ def select_random_subset_to_target(
15961591
15971592 if len (selected_indices ) > 0 :
15981593 ssn_card_type [selected_indices ] = 0
1599- families_adjusted = len (selected_indices )
16001594 print (
16011595 f"Selected { len (selected_indices )} people from { len (mixed_household_candidates )} candidates in mixed households"
16021596 )
@@ -1735,7 +1729,7 @@ def get_arrival_year_midpoint(peinusyr):
17351729 # Save as immigration_status_str since that's what PolicyEngine expects
17361730 cps ["immigration_status_str" ] = immigration_status .astype ("S" )
17371731 # Final population summary
1738- print (f "\n Final populations:" )
1732+ print ("\n Final populations:" )
17391733 code_to_str = {
17401734 0 : "NONE" , # Likely undocumented immigrants
17411735 1 : "CITIZEN" , # US citizens
@@ -1952,7 +1946,6 @@ def add_tips(self, cps: h5py.File):
19521946 # is_married is person-level here but policyengine-us defines it at Family
19531947 # level, so we must not save it
19541948 cps = cps .drop (columns = ["is_married" , "is_under_18" , "is_under_6" ], errors = "ignore" )
1955-
19561949 self .save_dataset (cps )
19571950
19581951
0 commit comments