PolicyEngine / policyengine-us

The PolicyEngine US Python package contains a rules engine of the US tax-benefit system, and microdata generation for microsimulation analysis.
https://policyengine.org/us
GNU Affero General Public License v3.0
95 stars 167 forks source link

NYSERDA Drive Clean program #4688

Open griffinsharps opened 1 week ago

griffinsharps commented 1 week ago

Fixes #4642

griffinsharps commented 6 days ago

Thank you!

Griffin Sharps (502)-472-5602

On Wed, Jun 26, 2024 at 7:42 AM Pavel Makarchuk @.***> wrote:

@.**** requested changes on this pull request.

In policyengine_us/parameters/gov/states/ny/nyserda/drive_clean/drive_clean_high_msrp.yaml https://github.com/PolicyEngine/policyengine-us/pull/4688#discussion_r1654695630 :

@@ -0,0 +1,12 @@ +description: New York minimizes the Drive Clean point-of-sale rebate for high-price vehicles. +metadata:

Could we link to the implementation manual https://www.nyserda.ny.gov/-/media/Project/Nyserda/Files/Programs/Drive-Clean-NY/implementation-manual.pdf and add the relevant page to the hyper link (page where we can find the value of the parameter file) e.g. ...manual.pdf#page=8 in this case

On policyengine_us/parameters/gov/states/ny/nyserda/drive_clean/drive_clean_range_rebate.yaml https://github.com/PolicyEngine/policyengine-us/pull/4688#discussion_r1654698580 :

lets rename this to amount.yaml

In changelog_entry.yaml https://github.com/PolicyEngine/policyengine-us/pull/4688#discussion_r1654702485 :

@@ -0,0 +1,4 @@ +- bump: minor

  • changes:
  • added:
    • NYSERDA Drive Clean Point of Sale Rebate

⬇️ Suggested change

    • NYSERDA Drive Clean Point of Sale Rebate
    • NYSERDA Drive Clean Point of Sale Rebate.

In policyengine_us/parameters/gov/states/ny/nyserda/drive_clean/drive_clean_high_msrp.yaml https://github.com/PolicyEngine/policyengine-us/pull/4688#discussion_r1654703889 :

@@ -0,0 +1,12 @@ +description: New York minimizes the Drive Clean point-of-sale rebate for high-price vehicles.

⬇️ Suggested change

-description: New York minimizes the Drive Clean point-of-sale rebate for high-price vehicles. +description: New York provides a flat Drive Clean point-of-sale rebate for vehicles with a base MSRP over this amount.


In policyengine_us/parameters/gov/states/ny/nyserda/drive_clean/drive_clean_high_msrp.yaml https://github.com/PolicyEngine/policyengine-us/pull/4688#discussion_r1654705117 :

@@ -0,0 +1,12 @@ +description: New York minimizes the Drive Clean point-of-sale rebate for high-price vehicles. +metadata:

  • unit: miles
  • period: year
  • label: High Manufacturer's Suggested Price

⬇️ Suggested change

  • label: High Manufacturer's Suggested Price
  • label: New York Drive Clean point-of-sale flat rebate MSRP threshold

On policyengine_us/parameters/gov/states/ny/nyserda/drive_clean/drive_clean_high_msrp.yaml https://github.com/PolicyEngine/policyengine-us/pull/4688#discussion_r1654707252 :

lets organize the MSRP related files as follows: drive_clean/flat_rebate/ - folder structure msrp_threshold.yaml - $42,000 amount.yaml - $500

In policyengine_us/parameters/gov/states/ny/nyserda/drive_clean/drive_clean_high_msrp_rebate.yaml https://github.com/PolicyEngine/policyengine-us/pull/4688#discussion_r1654737577 :

@@ -0,0 +1,11 @@ +description: New York minimizes the Drive Clean point-of-sale rebate for high-price vehicles. +metadata:

  • unit: currency-usd
  • period: year
  • label: High Manufacturer's Suggested Price

⬇️ Suggested change

  • label: High Manufacturer's Suggested Price
  • label: New York Drive Clean point-of-sale flat rebate amount

In policyengine_us/parameters/gov/states/ny/nyserda/drive_clean/drive_clean_high_msrp_rebate.yaml https://github.com/PolicyEngine/policyengine-us/pull/4688#discussion_r1654738851 :

@@ -0,0 +1,11 @@ +description: New York minimizes the Drive Clean point-of-sale rebate for high-price vehicles.

⬇️ Suggested change

-description: New York minimizes the Drive Clean point-of-sale rebate for high-price vehicles. +description: New York provides the following flat Drive Clean point-of-sale rebate vehicles with a base MSRP over a certain threshold.


In policyengine_us/parameters/gov/states/ny/nyserda/drive_clean/drive_clean_range_rebate.yaml https://github.com/PolicyEngine/policyengine-us/pull/4688#discussion_r1654740273 :

@@ -0,0 +1,34 @@ +description: The Drive Clean program offers a different rebate based on the all-electric range of the vehicle and the date of its purchase.

⬇️ Suggested change

-description: The Drive Clean program offers a different rebate based on the all-electric range of the vehicle and the date of its purchase. +description: New York provides the following Drive Clean point-of-sale rebate amount, based on the all-electric range of the vehicle.


In policyengine_us/variables/gov/states/ny/nyserda/drive_clean/drive_clean_rebate.py https://github.com/PolicyEngine/policyengine-us/pull/4688#discussion_r1654744783 :

  • if vehicle_cost >= p.drive_clean_high_msrp:
  • cost_rebate = p.drive_clean_high_msrp_rebate
  • return cost_rebate
  • else:
  • vehicle_all_electric_range = tax_unit("drive_clean_vehicle_electric_range", period)
  • range_rebate = p.rebate.calc(vehicle_all_electric_range)

⬇️ Suggested change

  • if vehicle_cost >= p.drive_clean_high_msrp:
  • cost_rebate = p.drive_clean_high_msrp_rebate
  • return cost_rebate
  • else:
  • vehicle_all_electric_range = tax_unit("drive_clean_vehicle_electric_range", period)
  • range_rebate = p.rebate.calc(vehicle_all_electric_range)
  • First compute the amount based on electric range

  • vehicle_range = tax_unit("drive_clean_vehicle_electric_range", period)
  • rebate_amount_based_on_range = p.rebate.calc(vehicle_all_electric_range)
  • If the vehicle cost exceeds a certain threshold, a flat amount is applied

  • vehicle_over_msrp_threshold = vehicle_cost >= p.drive_clean_high_msrp
  • flat_amount = p.drive_clean_high_msrp_rebate
  • return where(vehicle_over_msrp_threshold, flat_amount, rebate_amount_based_on_range)

In policyengine_us/variables/gov/states/ny/nyserda/drive_clean/drive_clean_vehicle_cost.py https://github.com/PolicyEngine/policyengine-us/pull/4688#discussion_r1654746940 :

@@ -0,0 +1,10 @@ +from policyengine_us.model_api import * + +class drive_clean_vehicle_cost(Variable):

If this is a definition that is given specifically by nyserda lets move to the nyserda folder and add nyserda_ to the class and file names

In policyengine_us/variables/gov/states/ny/nyserda/drive_clean/drive_clean_vehicle_electrical_range.py https://github.com/PolicyEngine/policyengine-us/pull/4688#discussion_r1654747478 :

@@ -0,0 +1,10 @@ +from policyengine_us.model_api import * + +class drive_clean_vehicle_electric_range(Variable):

same suggestion as for the drive_clean_vehicle_cost

In policyengine_us/variables/gov/states/ny/nyserda/drive_clean/drive_clean_rebate.py https://github.com/PolicyEngine/policyengine-us/pull/4688#discussion_r1654745580 :

  • if vehicle_cost >= p.drive_clean_high_msrp:
  • cost_rebate = p.drive_clean_high_msrp_rebate
  • return cost_rebate
  • else:
  • vehicle_all_electric_range = tax_unit("drive_clean_vehicle_electric_range", period)
  • range_rebate = p.rebate.calc(vehicle_all_electric_range)

adjust the parameter paths based on the suggestions above

— Reply to this email directly, view it on GitHub https://github.com/PolicyEngine/policyengine-us/pull/4688#pullrequestreview-2141612181, or unsubscribe https://github.com/notifications/unsubscribe-auth/AVLHGDFBAV7OYTYH2JXGR4TZJKZKVAVCNFSM6AAAAABJ4DHGLOVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDCNBRGYYTEMJYGE . You are receiving this because you authored the thread.Message ID: @.***>