def main():
    # Whether to compute Advanced Statistics (in most cases this is NOT needed)
    ADVANCED_STATS = False

    logging.basicConfig()
    # Example logging configuration for file and console output
    # logging.json: Normal logging example
    # logging_noisy.json: Turns on all debugging information
    # logging_quiet.json: Only logs error messages
    with open("logging.json", "r") as logging_config:
        logging.config.dictConfig(json.load(logging_config))

    # Uses the 'epathermostat' logging
    logger = logging.getLogger("epathermostat")
    logger.debug("Starting...")
    # Set to True to log additional warning messages, False to only display on
    # console
    logging.captureWarnings(True)

    # data_dir = os.path.join("..", "tests", "data", "single_stage")
    # data_dir = os.path.join("..", "tests", "data", "two_stage")
    data_dir = os.path.join("..", "tests", "data", "two_stage_ert")
    metadata_filename = os.path.join(data_dir, "epa_two_stage_metadata.csv")

    # Use this to save the weather cache to local disk files
    # thermostats = from_csv(metadata_filename, verbose=True, save_cache=True,
    #                        cache_path='/tmp/epa_weather_files/')

    # Verbose will override logging to display the imported thermostats. Set to
    # "False" to use the logging level instead
    thermostats = from_csv(metadata_filename, verbose=True)

    output_dir = "."
    metrics = multiple_thermostat_calculate_epa_field_savings_metrics(thermostats)

    output_filename = os.path.join(output_dir, "thermostat_example_output.csv")
    metrics_out = metrics_to_csv(metrics, output_filename)

    stats = compute_summary_statistics(metrics_out)
    if ADVANCED_STATS:
        stats_advanced = compute_summary_statistics(
            metrics_out, advanced_filtering=True
        )

    product_id = "test_product"

    certification_filepath = os.path.join(
        data_dir, "thermostat_example_certification.csv"
    )
    certification_to_csv(stats, certification_filepath, product_id)

    stats_filepath = os.path.join(data_dir, "thermostat_example_stats.csv")
    summary_statistics_to_csv(stats, stats_filepath, product_id)

    if ADVANCED_STATS:
        stats_advanced_filepath = os.path.join(
            data_dir, "thermostat_example_stats_advanced.csv"
        )
        summary_statistics_to_csv(stats_advanced, stats_advanced_filepath, product_id)
def thermostat_ert_na_2_hp_2(request):
    thermostats = from_csv(get_data_path(request.param))
    return next(thermostats)
Beispiel #3
0
def thermostat_furnace_or_boiler_two_stage_none_single_stage(request):
    thermostats = from_csv(get_data_path(request.param))
    return next(thermostats)
Beispiel #4
0
def thermostat_fu_2_ce_2(request):
    thermostats = from_csv(get_data_path(request.param))
    return next(thermostats)
def thermostat_type_1_cache(request):
    with TemporaryDirectory() as tempdir:
        thermostats = from_csv(get_data_path(request.param),
                               save_cache=True,
                               cache_path=tempdir)
        return next(thermostats)
def thermostat_type_1_data_missing_header(request):
    thermostats = from_csv(get_data_path(request.param))
    return list(thermostats)
def thermostat_type_1(request):
    thermostats = from_csv(get_data_path(request.param))
    return next(thermostats)
def thermostat_type_1_too_many_minutes(request):
    thermostats = from_csv(get_data_path(request.param))
    return list(thermostats)
def thermostat_type_1_data_out_of_order(request):
    thermostats = from_csv(get_data_path(request.param))
    return list(thermostats)
def thermostats_multiple_same_key(request):
    thermostats = from_csv(get_data_path(request.param))
    return thermostats
def thermostat_type_1_zip_bad(request):
    thermostats = from_csv(get_data_path(request.param))
    return list(thermostats)
def thermostat_type_1_utc_bad(request):
    thermostats = from_csv(get_data_path(request.param))
def thermostat_emg_aux_constant_on_outlier(request):
    thermostats = from_csv(get_data_path(request.param))
    return thermostats
def thermostat_zero_days(request):
    thermostats = from_csv(get_data_path(request.param))
    return next(thermostats)