Skip to content

Commit 7128d05

Browse files
committed
Revert: Accidental direct pushes to main
1 parent 5a619b5 commit 7128d05

File tree

4 files changed

+17
-19
lines changed

4 files changed

+17
-19
lines changed

CHANGELOG.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,6 @@ 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-
## [1.40.1] - 2025-07-24 14:16:14
9-
10-
### Fixed
11-
12-
- Clean up immigration status PR.
13-
148
## [1.40.0] - 2025-07-24 13:44:42
159

1610
### Added
@@ -574,7 +568,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
574568

575569

576570

577-
[1.40.1]: https://github.com/PolicyEngine/policyengine-us-data/compare/1.40.0...1.40.1
578571
[1.40.0]: https://github.com/PolicyEngine/policyengine-us-data/compare/1.39.2...1.40.0
579572
[1.39.2]: https://github.com/PolicyEngine/policyengine-us-data/compare/1.39.1...1.39.2
580573
[1.39.1]: https://github.com/PolicyEngine/policyengine-us-data/compare/1.39.0...1.39.1

changelog.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -475,8 +475,3 @@
475475
added:
476476
- Added Immigration status from SSN algorithm.
477477
date: 2025-07-24 13:44:42
478-
- bump: patch
479-
changes:
480-
fixed:
481-
- Clean up immigration status PR.
482-
date: 2025-07-24 14:16:14

policyengine_us_data/datasets/cps/cps.py

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818

1919
test_lite = os.environ.get("TEST_LITE")
20-
print(3 + 3)
20+
2121

2222
class CPS(Dataset):
2323
name = "cps"
@@ -66,7 +66,6 @@ def generate(self):
6666
cps,
6767
person,
6868
spm_unit,
69-
self.time_period,
7069
undocumented_target=13e6,
7170
undocumented_workers_target=8.3e6,
7271
undocumented_students_target=0.21 * 1.9e6,
@@ -707,7 +706,6 @@ def add_ssn_card_type(
707706
cps: h5py.File,
708707
person: pd.DataFrame,
709708
spm_unit: pd.DataFrame,
710-
time_period: int,
711709
undocumented_target: float = 13e6,
712710
undocumented_workers_target: float = 8.3e6,
713711
undocumented_students_target: float = 0.21 * 1.9e6,
@@ -1392,7 +1390,7 @@ def get_arrival_year_midpoint(peinusyr):
13921390

13931391
# Calculate arrival years once for all logic
13941392
arrival_years = get_arrival_year_midpoint(person.PEINUSYR)
1395-
CURRENT_YEAR = time_period
1393+
CURRENT_YEAR = 2024
13961394
years_in_us = CURRENT_YEAR - arrival_years
13971395
age_at_entry = np.maximum(0, person.A_AGE - years_in_us)
13981396

@@ -1416,11 +1414,10 @@ def get_arrival_year_midpoint(peinusyr):
14161414

14171415
# 3. Cuban / Haitian entrants (created by Congress in 1980)
14181416
# Only those who arrived after 1980
1419-
CUBAN_HAITIAN_ARRIVAL_CUTOFF = 1980
14201417
cuban_haitian_mask = (
14211418
(ssn_card_type != 0)
14221419
& np.isin(birth, list(COUNTRY_CODES["CUBAN_HAITIAN"]))
1423-
& (arrival_years >= CUBAN_HAITIAN_ARRIVAL_CUTOFF)
1420+
& (arrival_years >= 1980)
14241421
)
14251422
immigration_status[cuban_haitian_mask] = "CUBAN_HAITIAN_ENTRANT"
14261423

@@ -1449,6 +1446,19 @@ def get_arrival_year_midpoint(peinusyr):
14491446
)
14501447
immigration_status[mask] = "TPS"
14511448

1449+
# ---------------------------------------------------------------
1450+
# Map custom labels into Enum-approved buckets
1451+
placeholder_to_specific_status = {
1452+
"TEMP_NONQUALIFIED": "TPS",
1453+
}
1454+
needs_translation = np.isin(
1455+
immigration_status, list(placeholder_to_specific_status.keys())
1456+
)
1457+
immigration_status[needs_translation] = (
1458+
pd.Series(immigration_status[needs_translation])
1459+
.replace(placeholder_to_specific_status)
1460+
.values
1461+
)
14521462
# Final write (all values now in ImmigrationStatus Enum)
14531463
cps["immigration_status"] = immigration_status.astype("S")
14541464
# ============================================================================

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ build-backend = "setuptools.build_meta"
88

99
[project]
1010
name = "policyengine_us_data"
11-
version = "1.40.1"
11+
version = "1.40.0"
1212
description = "A package to create representative microdata for the US."
1313
readme = "README.md"
1414
authors = [

0 commit comments

Comments
 (0)