|
13 | 13 | import numpy_financial as npf |
14 | 14 | from datetime import datetime |
15 | 15 | from scout.plots import run_plot |
16 | | -from scout.config import FilePaths as fp |
17 | | -from scout.config import Config |
| 16 | +from scout.config import Config, FilePaths as fp |
| 17 | +from scout.utils import PrintFormat as fmt |
18 | 18 | import warnings |
19 | 19 |
|
20 | 20 |
|
@@ -5022,9 +5022,6 @@ def main(opts: argparse.NameSpace): # noqa: F821 |
5022 | 5022 | of key results to an output JSON. |
5023 | 5023 | """ |
5024 | 5024 |
|
5025 | | - # Set function that only prints message when in verbose mode |
5026 | | - verboseprint = print if opts.verbose else lambda *a, **k: None |
5027 | | - |
5028 | 5025 | # Raise numpy errors as exceptions |
5029 | 5026 | numpy.seterr('raise') |
5030 | 5027 | # Initialize user opts variable (elements: S-S calculation method; |
@@ -5268,7 +5265,7 @@ def main(opts: argparse.NameSpace): # noqa: F821 |
5268 | 5265 | # Reset measure fuel split attribute to imported values |
5269 | 5266 | m.eff_fs_splt = meas_eff_fs_data |
5270 | 5267 | # Print data import message for each ECM if in verbose mode |
5271 | | - verboseprint("Imported ECM '" + m.name + "' competition data") |
| 5268 | + fmt.verboseprint(opts.verbose, f"Imported ECM {m.name} competition data") |
5272 | 5269 |
|
5273 | 5270 | # Import total absolute heating and cooling energy use data, used in |
5274 | 5271 | # removing overlaps between supply-side and demand-side heating/cooling |
@@ -5355,12 +5352,12 @@ def main(opts: argparse.NameSpace): # noqa: F821 |
5355 | 5352 | try: |
5356 | 5353 | elec_carb = elec_cost_carb['CO2 intensity of electricity']['data'] |
5357 | 5354 | elec_cost = elec_cost_carb['End-use electricity price']['data'] |
5358 | | - fmt = True # Boolean for indicating data key substructure |
| 5355 | + format_data = True # Boolean for indicating data key substructure |
5359 | 5356 | except KeyError: |
5360 | 5357 | # Data are structured as in the site_source_co2_conversions files |
5361 | 5358 | elec_carb = elec_cost_carb['electricity']['CO2 intensity']['data'] |
5362 | 5359 | elec_cost = elec_cost_carb['electricity']['price']['data'] |
5363 | | - fmt = False |
| 5360 | + format_data = False |
5364 | 5361 |
|
5365 | 5362 | # Determine regions and building types used by active measures for |
5366 | 5363 | # aggregating onsite generation data |
@@ -5401,7 +5398,7 @@ def variable_depth_dict(): return defaultdict(variable_depth_dict) |
5401 | 5398 | else: |
5402 | 5399 | bt_bin = 'commercial' |
5403 | 5400 | # Get CO2 intensity and electricity cost data and convert units |
5404 | | - if fmt: # Data (and data structure) from emm_region files |
| 5401 | + if format_data: # Data (and data structure) from emm_region files |
5405 | 5402 | # Convert Mt/TWh to Mt/MMBtu |
5406 | 5403 | carbtmp = {k: elec_carb[cz].get(k, 0)/3.41214e6 |
5407 | 5404 | for k in elec_carb[cz].keys()} |
|
0 commit comments