policyengine-us 1.370.1__py3-none-any.whl → 1.370.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of policyengine-us might be problematic. Click here for more details.

@@ -0,0 +1 @@
1
+ from .zip_code_dataset import ZIP_CODE_DATASET
@@ -0,0 +1,11 @@
1
+ from pathlib import Path
2
+ import pandas as pd
3
+ import os
4
+
5
+ ZIP_CODE_DATASET_PATH = Path(__file__).parent / "zip_codes.csv.gz"
6
+
7
+ # Avoid circular import error when -us-data is initialized
8
+ if os.path.exists(ZIP_CODE_DATASET_PATH):
9
+ ZIP_CODE_DATASET = pd.read_csv(ZIP_CODE_DATASET_PATH, compression="gzip")
10
+ else:
11
+ ZIP_CODE_DATASET = None
policyengine_us/system.py CHANGED
@@ -27,7 +27,6 @@ from policyengine_core.parameters.operations.uprate_parameters import (
27
27
  uprate_parameters,
28
28
  )
29
29
  from .tools.default_uprating import add_default_uprating
30
- from policyengine_us_data import DATASETS, CPS_2024
31
30
 
32
31
  from typing import Annotated
33
32
 
@@ -37,6 +36,8 @@ COUNTRY_DIR = Path(__file__).parent
37
36
  CURRENT_YEAR = 2024
38
37
  DEFAULT_START_DATE = str(CURRENT_YEAR) + "-01-01"
39
38
 
39
+ DEFAULT_DATASET = "hf://policyengine/policyengine-us-data/enhanced_cps_2024.h5"
40
+
40
41
 
41
42
  class CountryTaxBenefitSystem(TaxBenefitSystem):
42
43
  """
@@ -131,7 +132,6 @@ class Simulation(CoreSimulation):
131
132
  default_role = "member"
132
133
  default_calculation_period = CURRENT_YEAR
133
134
  default_input_period = CURRENT_YEAR
134
- datasets = DATASETS
135
135
 
136
136
  def __init__(self, *args, **kwargs):
137
137
  start_instant: Annotated[str, "ISO date format YYYY-MM-DD"] = (
@@ -198,12 +198,11 @@ class Microsimulation(CoreMicrosimulation):
198
198
 
199
199
  default_tax_benefit_system = CountryTaxBenefitSystem
200
200
  default_tax_benefit_system_instance = system
201
- default_dataset = CPS_2024
201
+ default_dataset = DEFAULT_DATASET
202
202
  default_dataset_year = CURRENT_YEAR
203
203
  default_role = "member"
204
204
  default_calculation_period = CURRENT_YEAR
205
205
  default_input_period = CURRENT_YEAR
206
- datasets = DATASETS
207
206
 
208
207
  def __init__(self, *args, **kwargs):
209
208
  start_instant: Annotated[str, "ISO date format YYYY-MM-DD"] = (
@@ -281,7 +280,7 @@ class Microsimulation(CoreMicrosimulation):
281
280
  class IndividualSim(CoreIndividualSim): # Deprecated
282
281
  tax_benefit_system = CountryTaxBenefitSystem
283
282
  entities = {entity.key: entity for entity in entities}
284
- default_dataset = CPS_2024
283
+ default_dataset = DEFAULT_DATASET
285
284
  default_roles = dict(
286
285
  tax_unit="member",
287
286
  spm_unit="member",
@@ -5,7 +5,6 @@ import pandas as pd
5
5
  import subprocess
6
6
  import stat
7
7
  from io import StringIO
8
- from policyengine_us_data import CPS_2024
9
8
  from policyengine_core.data import Dataset
10
9
  from policyengine_core.taxbenefitsystems import TaxBenefitSystem
11
10
  from policyengine_us import Microsimulation
@@ -284,6 +283,9 @@ class TaxSim35:
284
283
  return test_str
285
284
 
286
285
 
286
+ DEFAULT_DATASET = "hf://policyengine/policyengine-us-data/enhanced_cps_2024.h5"
287
+
288
+
287
289
  if __name__ == "__main__":
288
290
  parser = ArgumentParser(description="Generate tests from TAXSIM35")
289
291
  parser.add_argument(
@@ -299,6 +301,6 @@ if __name__ == "__main__":
299
301
  taxsim = TaxSim35()
300
302
  taxsim.OUTPUT_VARIABLES = args.outputs
301
303
  result = taxsim.generate_from_microsimulation(
302
- CPS_2024, args.year, number=args.num
304
+ DEFAULT_DATASET, args.year, number=args.num
303
305
  )
304
306
  print(result)
@@ -6,7 +6,7 @@ from policyengine_us.tools.geography.county_helpers import (
6
6
  from policyengine_us.variables.household.demographic.geographic.county.county_enum import (
7
7
  County,
8
8
  )
9
- from policyengine_us_data import ZIP_CODE_DATASET
9
+ from policyengine_us.data import ZIP_CODE_DATASET
10
10
  from policyengine_us.tools.geography.county_helpers import (
11
11
  load_county_fips_dataset,
12
12
  )
@@ -1,5 +1,5 @@
1
1
  from policyengine_us.model_api import *
2
- from policyengine_us_data import ZIP_CODE_DATASET
2
+ from policyengine_us.data import ZIP_CODE_DATASET
3
3
 
4
4
 
5
5
  class zip_code(Variable):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: policyengine-us
3
- Version: 1.370.1
3
+ Version: 1.370.2
4
4
  Summary: Add your description here.
5
5
  Author-email: PolicyEngine <hello@policyengine.org>
6
6
  License-File: LICENSE
@@ -16,7 +16,6 @@ Classifier: Topic :: Scientific/Engineering :: Information Analysis
16
16
  Requires-Python: <3.14,>=3.10
17
17
  Requires-Dist: microdf-python>=1.0.0
18
18
  Requires-Dist: policyengine-core>=3.19.0
19
- Requires-Dist: policyengine-us-data>=1.17.0
20
19
  Requires-Dist: tqdm>=4.67.1
21
20
  Provides-Extra: dev
22
21
  Requires-Dist: build>=1.2.2.post1; extra == 'dev'
@@ -3,8 +3,10 @@ policyengine_us/conftest.py,sha256=E-KY6D7beTAWH40keL5E3q6NzHfiNTCQnNh3YSH-LcE,8
3
3
  policyengine_us/entities.py,sha256=uRrrYvpoZhAV8y_Byb8itTAMDJhZ6JdmckIMtkr2dBI,2052
4
4
  policyengine_us/model_api.py,sha256=0NaBw2MTB32T3SrG6uMMeZwwL-wGasWu5U-igV4jq24,1261
5
5
  policyengine_us/modelled_policies.yaml,sha256=rbDP6Nzsu5ml2Vdwoo9oSum0msm11NMgK75E9d_FZGU,4773
6
- policyengine_us/system.py,sha256=dMF6QFl7xYW3zKOmakyTqS-ClA6CtnVPnDQwC0wkOCk,10771
6
+ policyengine_us/system.py,sha256=dzMk0_3YNcxX5e9DFVyNvXMujjZ3WGCcMTVrdfjO4Yc,10766
7
7
  policyengine_us/typing.py,sha256=ixLAOFjSnepNEAZ63DhhBZHRw0rBgjH81y_z4hTjhEE,298
8
+ policyengine_us/data/__init__.py,sha256=TuwzfG1RS1KzvMptMbpbEfiaRG5RPCXQK5gYBwzDkBc,47
9
+ policyengine_us/data/zip_code_dataset.py,sha256=PvA4Jldyu21XEuJMGRAcNLxjlJnDSJ7iVTBdy2c1Mp8,337
8
10
  policyengine_us/parameters/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
9
11
  policyengine_us/parameters/calibration/gov/aca/enrollment/state.yaml,sha256=NjN2M7pJxG6q78KR3-I3cIZCVjDayrswc65RISZmetY,1794
10
12
  policyengine_us/parameters/calibration/gov/aca/spending/state.yaml,sha256=1kvJIiu-cYEbXPAaBQcOqSE3ShXfALag-1Pdw3sdEes,2018
@@ -5167,7 +5169,7 @@ policyengine_us/tools/variables.py,sha256=AcJMnvPyfCK6to2BIRNODcVcPObCbxQ8UFc8Td
5167
5169
  policyengine_us/tools/geography/README.md,sha256=fxMEj9_GC9Evh1mkTTtf8WKNjZ51lbd1A2--pZKrCsY,155
5168
5170
  policyengine_us/tools/geography/county_helpers.py,sha256=z-WqWQ5CwlnZBA2w0_LuIuU9F0zsdoHykXoWZ50jhM8,2077
5169
5171
  policyengine_us/tools/geography/download_50_state_census_block_data.py,sha256=LFwAAufn6YpOiIMwGNbTslzh7ZjTrDT8l7FuaUqEn_c,2730
5170
- policyengine_us/tools/taxsim/generate_taxsim_tests.py,sha256=v8eaDVXZBKy69IMobu176o5jDVaiJmR-bXB9c-Mycqc,10692
5172
+ policyengine_us/tools/taxsim/generate_taxsim_tests.py,sha256=8XTQgP2rvdgR5utAjDrS0tPnZQQI0gPx9gZ082GG0KU,10739
5171
5173
  policyengine_us/variables/contrib/congress/wftca/bonus_guaranteed_deduction.py,sha256=5WWTeo4A8aSbw1vTg9jZofepvjn54LSjCnfTTVJXEWQ,896
5172
5174
  policyengine_us/variables/contrib/taxsim/taxsim_age1.py,sha256=nlbRCCARxV5aXe7trb3d88cDwE3pZ143RBwU6eOICgs,963
5173
5175
  policyengine_us/variables/contrib/taxsim/taxsim_age2.py,sha256=-O1GFMG7AS1L-SIlYHOzdHn9NHWp52AThv_Lf4rYa0s,552
@@ -7796,7 +7798,7 @@ policyengine_us/variables/household/demographic/geographic/state_group.py,sha256
7796
7798
  policyengine_us/variables/household/demographic/geographic/state_group_str.py,sha256=YVapmNgz-QhCZXVfVnU72_G_fijilHLJ1kBDThX9IUE,359
7797
7799
  policyengine_us/variables/household/demographic/geographic/state_name.py,sha256=tfpURwlCmHRJkk4m0_NVPInByKbWY0Upq7sbZUobZIs,1495
7798
7800
  policyengine_us/variables/household/demographic/geographic/tax_unit_state.py,sha256=yQCj1TgJplNL7EGOx59C9av7isbHsyThaWheZMCjSFg,282
7799
- policyengine_us/variables/household/demographic/geographic/county/county.py,sha256=MPPzpU7ZciOgm3paZRne4w5s7zAljGl2MkI3Xdyi5pw,2374
7801
+ policyengine_us/variables/household/demographic/geographic/county/county.py,sha256=F1gZbt5DEteQZQIe5xV-UPbWgfgCicO5BUrAZdY8HAE,2374
7800
7802
  policyengine_us/variables/household/demographic/geographic/county/county_enum.py,sha256=2-SIpjp72QWPhQQUs8hzxrLcE2baWSkLTdCVRwKOXXw,145769
7801
7803
  policyengine_us/variables/household/demographic/geographic/county/county_str.py,sha256=UDWJ8YqH4Ef_JTscy8LMwLAMQ_o-Zan13hziZBY3XPs,339
7802
7804
  policyengine_us/variables/household/demographic/geographic/county/first_county_in_state.py,sha256=yXCj-LVjxPeILIg42ijefTmi_j4NxJwX0kMtoE47xic,1578
@@ -7806,7 +7808,7 @@ policyengine_us/variables/household/demographic/geographic/ucgid/ucgid.py,sha256
7806
7808
  policyengine_us/variables/household/demographic/geographic/ucgid/ucgid_enum.py,sha256=dkeusTBI1j4xAGmRFkfSsyT3Hq5gHZwRUkSeISeNbx0,15636
7807
7809
  policyengine_us/variables/household/demographic/geographic/ucgid/ucgid_str.py,sha256=GnIRg2tc0376YazPX7wm7YQgMQaYPm2Au47vc1E5JcM,914
7808
7810
  policyengine_us/variables/household/demographic/geographic/zip_code/three_digit_zip_code.py,sha256=7q0FQRahTOINiK2vlAyHEa5xIKowM5Kgl60-kR3ZuWU,426
7809
- policyengine_us/variables/household/demographic/geographic/zip_code/zip_code.py,sha256=PZiLb84BgKQ_Suvd6iUiEnzySu3Vtiv8FOlfB4rnagQ,1691
7811
+ policyengine_us/variables/household/demographic/geographic/zip_code/zip_code.py,sha256=3J8RfnIIsmw4_5gF5yZHmATt2cNskyKQR0lncCvOQx0,1691
7810
7812
  policyengine_us/variables/household/demographic/household/bedrooms.py,sha256=4ltdIRLdmeuTKAskn4pdgxZuxEE-4rz0ffPnIKobc-o,164
7811
7813
  policyengine_us/variables/household/demographic/household/household_count.py,sha256=f6dIPWyCtWlZ-qTSCPDrzCfINSzoJOE5Tw1ynBKYfGA,211
7812
7814
  policyengine_us/variables/household/demographic/household/household_size.py,sha256=DR5PS9bylHlPphL3-Y0ySR4E0cavAf6qyMpNJG2N3ig,263
@@ -8253,8 +8255,8 @@ policyengine_us/variables/input/farm_income.py,sha256=BEKxYmHNNnWJAAvULl5qZJigy5
8253
8255
  policyengine_us/variables/input/geography.py,sha256=XmBlgXhzBoLRKk6R8taVZHqUw1eU8MbNeGS9iJ7_l44,4506
8254
8256
  policyengine_us/variables/input/self_employment_income.py,sha256=PwsGz8R4lRikKWUYOhsC0qosNNLXq4f5SQmfw4S3mk8,511
8255
8257
  policyengine_us/variables/input/self_employment_income_before_lsr.py,sha256=E8fcX9Nlyqz8dziHhQv_euutdmoIwFMMWePUwbbwv_w,379
8256
- policyengine_us-1.370.1.dist-info/METADATA,sha256=xxMUTLf1RLHtBProzP-yF1mCoreZgxmvAGT-GkpNIP4,1693
8257
- policyengine_us-1.370.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
8258
- policyengine_us-1.370.1.dist-info/entry_points.txt,sha256=MLaqNyNTbReALyKNkde85VkuFFpdPWAcy8VRG1mjczc,57
8259
- policyengine_us-1.370.1.dist-info/licenses/LICENSE,sha256=2N5ReRelkdqkR9a-KP-y-shmcD5P62XoYiG-miLTAzo,34519
8260
- policyengine_us-1.370.1.dist-info/RECORD,,
8258
+ policyengine_us-1.370.2.dist-info/METADATA,sha256=UN5NKnYjQDD3hl66gF272fF_53IvjcIE0C2QiSiSBVM,1649
8259
+ policyengine_us-1.370.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
8260
+ policyengine_us-1.370.2.dist-info/entry_points.txt,sha256=MLaqNyNTbReALyKNkde85VkuFFpdPWAcy8VRG1mjczc,57
8261
+ policyengine_us-1.370.2.dist-info/licenses/LICENSE,sha256=2N5ReRelkdqkR9a-KP-y-shmcD5P62XoYiG-miLTAzo,34519
8262
+ policyengine_us-1.370.2.dist-info/RECORD,,