policyengine-us 1.449.0__py3-none-any.whl → 1.449.1__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.
@@ -11,3 +11,24 @@
11
11
  state_code: AK
12
12
  output:
13
13
  state_group: AK
14
+
15
+ - name: Contiguous state does not cause empty array indexing error
16
+ period: 2024
17
+ input:
18
+ state_code: TX
19
+ output:
20
+ state_group: CONTIGUOUS_US
21
+
22
+ - name: Hawaii
23
+ period: 2024
24
+ input:
25
+ state_code: HI
26
+ output:
27
+ state_group: HI
28
+
29
+ - name: Puerto Rico
30
+ period: 2024
31
+ input:
32
+ state_code: PR
33
+ output:
34
+ state_group: PR
@@ -22,8 +22,11 @@ class state_group(Variable):
22
22
  def formula(household, period, parameters):
23
23
  NON_CONTIGUOUS_STATES = ("AK", "HI", "GU", "PR", "VI")
24
24
  state_code = household("state_code", period).decode_to_str()
25
- return where(
26
- np.isin(state_code, NON_CONTIGUOUS_STATES),
27
- StateGroup.encode(state_code).decode(),
28
- StateGroup.CONTIGUOUS_US,
29
- )
25
+ is_non_contiguous = np.isin(state_code, NON_CONTIGUOUS_STATES)
26
+ encoded = np.empty(state_code.shape, dtype=object)
27
+ encoded[:] = StateGroup.CONTIGUOUS_US
28
+ if is_non_contiguous.any():
29
+ encoded[is_non_contiguous] = StateGroup.encode(
30
+ state_code[is_non_contiguous]
31
+ ).decode()
32
+ return encoded
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: policyengine-us
3
- Version: 1.449.0
3
+ Version: 1.449.1
4
4
  Summary: Add your description here.
5
5
  Author-email: PolicyEngine <hello@policyengine.org>
6
6
  License-File: LICENSE
@@ -5527,7 +5527,7 @@ policyengine_us/tests/policy/baseline/household/demographic/age/is_wa_adult.yaml
5527
5527
  policyengine_us/tests/policy/baseline/household/demographic/age/monthly_age.yaml,sha256=P6X40TifnTdtuG4kAkWhxN53nrh672A12sbsa54hkh4,100
5528
5528
  policyengine_us/tests/policy/baseline/household/demographic/geographic/in_nyc.yaml,sha256=5YCwV7xV3ltHomN3-feZLcIrkMomX1oWvlz0-NAqh9U,320
5529
5529
  policyengine_us/tests/policy/baseline/household/demographic/geographic/lives_in_vehicle.yaml,sha256=TaFZl3mSZl7wcuQvfCy-mmhBCzAfNZ2EXnMAPs0ZErw,585
5530
- policyengine_us/tests/policy/baseline/household/demographic/geographic/state_group.yaml,sha256=Is1iFAICyaT7gTxOFth7iFHoAM8uaGWM-Sg-OrpMG3A,192
5530
+ policyengine_us/tests/policy/baseline/household/demographic/geographic/state_group.yaml,sha256=8MwFGdWOBNt3tdM3jgDJW3AmEolO1jN-3600ZOjatMQ,527
5531
5531
  policyengine_us/tests/policy/baseline/household/demographic/geographic/state_name.yaml,sha256=wv0gP9Cp0tOAWapOYFCZL2nLPRgs2BmTp9xnelFPFGo,154
5532
5532
  policyengine_us/tests/policy/baseline/household/demographic/geographic/county/county.yaml,sha256=hMg6qJf_W6WkIXPJXPS0orEhIMIfLhcEnsrMJkPUCPk,1344
5533
5533
  policyengine_us/tests/policy/baseline/household/demographic/geographic/county/first_county_in_state.yaml,sha256=cLAyzsr2ztmvZwwPjtR06dc-IK1ZN3krMtKTFe5Wkek,446
@@ -8521,7 +8521,7 @@ policyengine_us/variables/household/demographic/geographic/lives_in_vehicle.py,s
8521
8521
  policyengine_us/variables/household/demographic/geographic/safmr_used_for_hcv.py,sha256=13bT4Px5P1eZwg4G3PPAtfno6Mw9O7wamHe_dtV5Cn8,250
8522
8522
  policyengine_us/variables/household/demographic/geographic/state_code.py,sha256=y0AR7Lk0PnCulq-v40uQAYgGrX82Y7FF5MEGk27Ani4,1322
8523
8523
  policyengine_us/variables/household/demographic/geographic/state_code_str.py,sha256=xTXajj8A7c-316HJUpChvnpjoRvpRmwqQ0-xF7vaH9s,355
8524
- policyengine_us/variables/household/demographic/geographic/state_group.py,sha256=Xxydn99zsB2VTqyCUMB2S0_NrBLgKJU-oKUB67f0Uyo,809
8524
+ policyengine_us/variables/household/demographic/geographic/state_group.py,sha256=qQRPxnIOdtZOBQbjW0ZAo1M-mDyCGysUxTxbm4vNi-0,995
8525
8525
  policyengine_us/variables/household/demographic/geographic/state_group_str.py,sha256=YVapmNgz-QhCZXVfVnU72_G_fijilHLJ1kBDThX9IUE,359
8526
8526
  policyengine_us/variables/household/demographic/geographic/state_name.py,sha256=tfpURwlCmHRJkk4m0_NVPInByKbWY0Upq7sbZUobZIs,1495
8527
8527
  policyengine_us/variables/household/demographic/geographic/tax_unit_state.py,sha256=yQCj1TgJplNL7EGOx59C9av7isbHsyThaWheZMCjSFg,282
@@ -8985,8 +8985,8 @@ policyengine_us/variables/input/farm_income.py,sha256=BEKxYmHNNnWJAAvULl5qZJigy5
8985
8985
  policyengine_us/variables/input/geography.py,sha256=Ux0ueAf0rhZaflyEqz81UuXP3xKCKBDvoO3CrKhiQEc,5421
8986
8986
  policyengine_us/variables/input/self_employment_income.py,sha256=PwsGz8R4lRikKWUYOhsC0qosNNLXq4f5SQmfw4S3mk8,511
8987
8987
  policyengine_us/variables/input/self_employment_income_before_lsr.py,sha256=E8fcX9Nlyqz8dziHhQv_euutdmoIwFMMWePUwbbwv_w,379
8988
- policyengine_us-1.449.0.dist-info/METADATA,sha256=FDOQkmhvvkf_j6f3ede_kxD_0OWYCUo_NIUh3YP3HrM,1649
8989
- policyengine_us-1.449.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
8990
- policyengine_us-1.449.0.dist-info/entry_points.txt,sha256=MLaqNyNTbReALyKNkde85VkuFFpdPWAcy8VRG1mjczc,57
8991
- policyengine_us-1.449.0.dist-info/licenses/LICENSE,sha256=2N5ReRelkdqkR9a-KP-y-shmcD5P62XoYiG-miLTAzo,34519
8992
- policyengine_us-1.449.0.dist-info/RECORD,,
8988
+ policyengine_us-1.449.1.dist-info/METADATA,sha256=FuzWLlDDXUWpvffyWJgKt2cjdSQp8PE68PfmrnGSg1U,1649
8989
+ policyengine_us-1.449.1.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
8990
+ policyengine_us-1.449.1.dist-info/entry_points.txt,sha256=MLaqNyNTbReALyKNkde85VkuFFpdPWAcy8VRG1mjczc,57
8991
+ policyengine_us-1.449.1.dist-info/licenses/LICENSE,sha256=2N5ReRelkdqkR9a-KP-y-shmcD5P62XoYiG-miLTAzo,34519
8992
+ policyengine_us-1.449.1.dist-info/RECORD,,