@@ -142,7 +142,7 @@ def prep_error(meas_name, handyvars, handyfiles):
142
142
# Add ECM to skipped list
143
143
handyvars.skipped_ecms.append(meas_name)
144
144
# Print error message if in verbose mode
145
- # fmt.verboseprint(opts.verbose, err_msg, "error")
145
+ # fmt.verboseprint(opts.verbose, err_msg, "error", logger )
146
146
# # Log error message to file (see ./generated)
147
147
logger.error(err_msg)
148
148
@@ -2204,7 +2204,8 @@ def fill_mkts(self, msegs, msegs_cpl, convert_data, tsv_data_init, opts,
2204
2204
opts.verbose,
2205
2205
f"ECM {self.name} missing valid baseline stock/energy data for technology "
2206
2206
f"'{str(mskeys[-2])}'; removing technology from analysis",
2207
- "warning")
2207
+ "warning",
2208
+ logger)
2208
2209
# Add to the overall number of key chains that yield "stock"/
2209
2210
# "energy" keys (but in this case, are missing data)
2210
2211
valid_keys += 1
@@ -2736,7 +2737,8 @@ def fill_mkts(self, msegs, msegs_cpl, convert_data, tsv_data_init, opts,
2736
2737
f"ECM '{self.name}' uses invalid performance units for "
2737
2738
f"technology '{str(mskeys[-2])}' (requires "
2738
2739
f"{str(perf_base_units)}); removing technology from analysis",
2739
- "warning")
2740
+ "warning",
2741
+ logger)
2740
2742
# Continue to the next microsegment
2741
2743
continue
2742
2744
# Handle case where measure units do not equal baseline
@@ -2761,7 +2763,8 @@ def fill_mkts(self, msegs, msegs_cpl, convert_data, tsv_data_init, opts,
2761
2763
f"{str(perf_base_units)}); base units changed to "
2762
2764
f"{str(perf_units)} and base values multiplied by "
2763
2765
f"{str(convert_fact)}",
2764
- "warning")
2766
+ "warning",
2767
+ logger)
2765
2768
# Convert base performance values to values in
2766
2769
# measure performance units
2767
2770
perf_base = {yr: (perf_base[yr] * convert_fact) for
@@ -2814,7 +2817,8 @@ def fill_mkts(self, msegs, msegs_cpl, convert_data, tsv_data_init, opts,
2814
2817
"residential heating and cooling end uses (both are divided "
2815
2818
"by 2 when separately considered across heating and cooling "
2816
2819
"in the raw EIA data)",
2817
- "warning")
2820
+ "warning",
2821
+ logger)
2818
2822
# Adjust residential baseline lighting lifetimes to
2819
2823
# reflect the fact that input data assume 24 h/day of
2820
2824
# lighting use, rather than 3 h/day as assumed for
@@ -2884,7 +2888,8 @@ def fill_mkts(self, msegs, msegs_cpl, convert_data, tsv_data_init, opts,
2884
2888
f"/lifetime data for technology '{str(mskeys[-2])}'; "
2885
2889
"technology will remain in analysis with cost of zero; "
2886
2890
"if lifetime data are missing, lifetime is set to 10 years",
2887
- "warning")
2891
+ "warning",
2892
+ logger)
2888
2893
2889
2894
# In all other cases, to avoid removing any msegs,
2890
2895
# set the baseline cost and performance to the measure
@@ -2928,7 +2933,8 @@ def fill_mkts(self, msegs, msegs_cpl, convert_data, tsv_data_init, opts,
2928
2933
"technology applies to special lighting case and will "
2929
2934
"remain in analysis at same cost/performance as ECM; if "
2930
2935
"lifetime data are missing, lifetime is set to 10 years",
2931
- "warning")
2936
+ "warning",
2937
+ logger)
2932
2938
else:
2933
2939
# Set baseline cost and performance characteristics for any
2934
2940
# remaining secondary microsegments to that of the measure
@@ -3167,7 +3173,8 @@ def fill_mkts(self, msegs, msegs_cpl, convert_data, tsv_data_init, opts,
3167
3173
f"ECM '{self.name}' has baseline or measure "
3168
3174
"performance of zero; baseline and measure "
3169
3175
"performance set equal",
3170
- "warning")
3176
+ "warning",
3177
+ logger)
3171
3178
# Ensure that the adjusted relative savings
3172
3179
# fraction is not greater than 1 or less
3173
3180
# than 0 if not originally specified as
@@ -3220,7 +3227,8 @@ def fill_mkts(self, msegs, msegs_cpl, convert_data, tsv_data_init, opts,
3220
3227
opts.verbose,
3221
3228
f"ECM '{self.name}' has measure performance of zero; "
3222
3229
"baseline and measure performance set equal",
3223
- "warning")
3230
+ "warning",
3231
+ logger)
3224
3232
rel_perf[yr] = 1
3225
3233
# Ensure that relative performance is a finite
3226
3234
# number; if not, set to 1
@@ -3240,7 +3248,8 @@ def fill_mkts(self, msegs, msegs_cpl, convert_data, tsv_data_init, opts,
3240
3248
opts.verbose,
3241
3249
f"ECM '{self.name}' has baseline performance of zero; "
3242
3250
"baseline and measure performance set equal",
3243
- "warning")
3251
+ "warning",
3252
+ logger)
3244
3253
rel_perf[yr] = 1
3245
3254
3246
3255
# If looping through a commercial lighting microsegment
@@ -3500,7 +3509,8 @@ def fill_mkts(self, msegs, msegs_cpl, convert_data, tsv_data_init, opts,
3500
3509
f"ECM '{self.name}' missing valid consumer choice "
3501
3510
f"data for end use '{str(mskeys[4])}'; using default "
3502
3511
"choice data for refrigeration end use",
3503
- "warning")
3512
+ "warning",
3513
+ logger)
3504
3514
choice_params = {
3505
3515
"b1": {
3506
3516
key: self.handyvars.deflt_choice[0] for
@@ -3552,7 +3562,8 @@ def fill_mkts(self, msegs, msegs_cpl, convert_data, tsv_data_init, opts,
3552
3562
f"ECM '{self.name}' missing valid consumer choice data for "
3553
3563
f"end use '{str(mskeys[4])}'; using default choice data for "
3554
3564
"refrigeration end use",
3555
- "warning")
3565
+ "warning",
3566
+ logger)
3556
3567
choice_params = {"rate distribution":
3557
3568
self.handyvars.com_timeprefs[
3558
3569
"distributions"][
@@ -5273,7 +5284,8 @@ def apply_tsv(self, load_fact, ash_cz_wts, eplus_bldg_wts,
5273
5284
"check that 8760 hourly savings fractions are available "
5274
5285
"for all baseline market segments the measure applies to "
5275
5286
f"in {self.handyfiles.tsv_shape_data}.",
5276
- "warning")
5287
+ "warning",
5288
+ logger)
5277
5289
5278
5290
else:
5279
5291
# Develop an adjustment from the generic
@@ -5882,7 +5894,7 @@ def convert_costs(self, convert_data, bldg_sect, mskeys, cost_meas,
5882
5894
user_message += " for building type '" + mskeys[2] + "'"
5883
5895
5884
5896
# Print user message
5885
- fmt.verboseprint(verbose, user_message, "info")
5897
+ fmt.verboseprint(verbose, user_message, "info", logger )
5886
5898
# Case where cost conversion has not succeeded
5887
5899
else:
5888
5900
raise ValueError(
@@ -6257,7 +6269,8 @@ def partition_microsegment(
6257
6269
f"No data available to link mseg {str(mskeys)} for measure '{self.name}' "
6258
6270
f"with {self.linked_htcl_tover_anchor_tech} "
6259
6271
f"{self.linked_htcl_tover_anchor_eu} turnover rates; unlinking turnover",
6260
- "warning")
6272
+ "warning",
6273
+ logger)
6261
6274
# In cases where no secondary heating/cooling microsegment is present,
6262
6275
# and there are no linked stock turnover rates for primary heating and
6263
6276
# cooling microsegments, set relevant adjustment variables to None
@@ -9207,7 +9220,7 @@ def breakout_mseg(self, mskeys, contrib_mseg_key, adopt_scheme, opts,
9207
9220
# Create a shorthand for baseline and efficient stock/energy/carbon/
9208
9221
# cost data to add to the breakout dict
9209
9222
base_data = [add_stock_total, add_energy_total,
9210
- add_energy_cost, add_carb_total]
9223
+ add_energy_cost, add_carb_total]
9211
9224
eff_data = [add_stock_total_meas, add_energy_total_eff,
9212
9225
add_energy_cost_eff, add_carb_total_eff]
9213
9226
@@ -9466,7 +9479,8 @@ def breakout_mseg(self, mskeys, contrib_mseg_key, adopt_scheme, opts,
9466
9479
opts.verbose,
9467
9480
f"Baseline market key chain: '{str(mskeys)}' for ECM '{self.name}' does not map to "
9468
9481
"output breakout categories, thus will not be reflected in output breakout data",
9469
- "warning")
9482
+ "warning",
9483
+ logger)
9470
9484
9471
9485
9472
9486
class MeasurePackage(Measure):
@@ -11844,14 +11858,6 @@ def prepare_measures(measures, convert_data, msegs, msegs_cpl, handyvars,
11844
11858
base_dir, handyvars, handyfiles, opts_dict, **m) for m in measures]
11845
11859
logger.info("Measure initialization complete")
11846
11860
11847
- print('Initializing measures...', end="", flush=True)
11848
- # Translate user options to a dictionary for further use in Measures
11849
- opts_dict = vars(opts)
11850
- # Initialize Measure() objects based on 'measures_update' list
11851
- meas_update_objs = [Measure(
11852
- base_dir, handyvars, handyfiles, opts_dict, **m) for m in measures]
11853
- print("Complete")
11854
-
11855
11861
# Fill in EnergyPlus-based performance information for Measure objects
11856
11862
# with a 'From EnergyPlus' flag in their 'energy_efficiency' attribute
11857
11863
0 commit comments