Skip to content

Commit 528081b

Browse files
committed
Account for sub-federal appliance regulations.
Create and process new input data (./scout/supporting_data/sub_fed/state_appl_regs.csv) to represent the effects of state-level or other sub-federal regulations on the use of certain appliances (e.g., fossil-based appliances) for certain market segments, beginning in certain years. The restrictions are reflected in compete_measures() as adjustments to the years a competing measure is allowed on the market (when the measure’s market is 100% restricted) or as a downward adjustment to its market share (when the measure’s market is partially restricted). Addresses issue #409.
1 parent 411609e commit 528081b

File tree

2 files changed

+63
-2
lines changed

2 files changed

+63
-2
lines changed

scout/run.py

+59-2
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,64 @@ def __init__(self, handyvars, name):
592592
self.markets[adopt_scheme][
593593
"mseg_out_break"]["stock"] = {
594594
key: copy.deepcopy(out_break_in) for key in ["baseline", "efficient"]}
595+
=======
596+
# Import/finalize input data on sub-federal regulations on certain types of appliances
597+
self.import_state_regs(handyfiles)
598+
599+
def import_state_regs(self, handyfiles):
600+
"""Import and further prepare sub-federal appliance regulation data.
601+
602+
Args:
603+
handyfiles (object): File paths.
604+
"""
605+
606+
# Try importing sub-federal appliance regulation data; if not available,
607+
# set to empty list
608+
try:
609+
state_regs_dat = pd.read_csv(handyfiles.state_appl_regs)
610+
# Initialize regulated segments list
611+
self.state_appl_reg_segs = []
612+
for index, row in state_regs_dat.iterrows():
613+
# Set applicable state(s), building type(s), building vintage(s), fuel type(s).
614+
# end use(s), and tech(s)
615+
state, bldg, vint, fuel, eu, tech = [
616+
[x.strip()] if "," not in x else [y.strip() for y in x.split(",")]
617+
for x in row.values[1:-3]]
618+
# Set start year and applicability fraction
619+
yr, frac = [[row.values[-3]], [row.values[-2]]]
620+
# Check for bundle of U.S. Climate Alliance (UCSA) states
621+
if len(state) == 1 and state[0].lower() == "usca":
622+
state = ["AZ", "CA", "CO", "CT", "DE", "HI", "IL", "ME", "MD", "MA", "MI",
623+
"MN", "NJ", "NM", "NY", "NC", "OR", "PA", "RI", "VT", "WA", "WI"]
624+
# Fill out 'all' entries across building type categories when present
625+
for b_ind, b in enumerate(bldg):
626+
if b == "all residential":
627+
bldg.extend(["single family home", "multi family home", "mobile home"])
628+
# Remove original 'all' entry
629+
bldg.remove(bldg[b_ind])
630+
elif b == "all commercial":
631+
bldg.extend(["assembly", "education", "food sales", "food service",
632+
"health care", "lodging", "large office", "small office",
633+
"mercantile/service", "warehouse", "other", "unspecified"])
634+
# Remove original 'all' entry
635+
bldg.remove(bldg[b_ind])
636+
# Fill out 'all' entries for building vintage
637+
if len(vint) == 1 and vint[0] == "all":
638+
vint = ["new", "existing"]
639+
# Fill out 'all' entries for fuel type
640+
if len(fuel) == 1 and fuel[0] == "all fossil":
641+
fuel = ["natural gas", "distillate", "other fuel"]
642+
# Fill out 'all' entries for end use
643+
if len(eu) == 1 and eu[0] == "all fossil":
644+
eu = ["heating", "water heating", "cooking", "drying"]
645+
# Put final data together into a list
646+
mseg_params = [x for x in [state, bldg, vint, fuel, eu, tech, yr, frac]]
647+
# Put all combinations of the list elements into unique rows
648+
self.state_appl_reg_segs.extend(list(itertools.product(*mseg_params)))
649+
except FileNotFoundError:
650+
# Set regulated segments list to empty
651+
self.state_appl_reg_segs = []
652+
>>>>>>> 6062783 (Account for sub-federal appliance regulations.)
595653

596654

597655
class Measure(object):
@@ -2302,8 +2360,7 @@ def state_app_reg_screen(self, measures_adj, stk_cost_dat_keys):
23022360
"""
23032361

23042362
# Look for any state (or local)-level appliance restrictions on the current microsegment
2305-
state_appl_regs = (
2306-
self.handyvars.state_appl_regs is not None and len(self.handyvars.state_appl_regs) != 0)
2363+
state_appl_regs = (len(self.handyvars.state_appl_reg_segs) != 0)
23072364
if state_appl_regs:
23082365
# Separate out components of the mseg information; use mseg information that accounts
23092366
# for any links/dependencies between mseg and other msegs the measure applies to (
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Description,State(s),Building Type(s),Building Vintage(s),Fuel Type(s),End Use(s),Tech(s),Start Year,Applicable Fraction,Fraction Notes
2+
Emissions standards effectively rule out new sales of fossil-based heating and water heating equipment starting in 2030. https://ww2.arb.ca.gov/our-work/programs/building-decarbonization/zero-emission-space-and-water-heater-standards/faq,CA,all residential,all,all fossil,"heating, water heating",all,2030,1,NA
3+
"Gas ban for new construction, starting in different years for large vs. small buildings. https://nyassembly.gov/leg/?default_fld=&leg_video=&bn=A03006&term=&Summary=Y&Text=Y",NY,"single family home, mobile home",new,"natural gas, distillate, other fuel","heating, water heating, cooking, drying",all,2026,1,NA
4+
"Gas ban for new construction, starting in different years for large vs. small buildings. https://nyassembly.gov/leg/?default_fld=&leg_video=&bn=A03006&term=&Summary=Y&Text=Y",NY,"all commercial, multi family home",new,"natural gas, distillate, other fuel","heating, water heating",all,2029,1,NA

0 commit comments

Comments
 (0)