Example #1
0
def run_dwelling(xlbook, d, can_run_fee, can_run_der, can_run_ter):
    #can_run_fee=False
    #can_run_ter=False
    write_to_excel(xlbook, d)
    runner.run_fee(d)
    runner.run_der(d)
    epctk.appendix.appendix_t.run_ter(d)
    runner.run_sap(d)

    if can_run_der:
        xlbook.set_calc_type("DER")
        check_results(xlbook, d.der_results, "DER", True)
        check_result("DER", xlbook.der, d.der_results.der_rating, "DER", 0.01)

        xlbook.set_calc_type("SAP")
        check_results(xlbook, d.er_results, "SAP", True)
        check_result("SAP", xlbook.sap, d.er_results.sap_value, "SAP", 0.01)
        return False
    if can_run_ter:
        xlbook.set_calc_type("TER")
        check_results(xlbook, d.ter_results, "TER", False)
        check_result("TER", xlbook.ter, d.ter_results.ter_rating, "TER", 0.01)

    if can_run_fee:
        xlbook.set_calc_type("FEE")
        check_results(xlbook, d.fee_results, "FEE", False)

        months_with_cooling = sum(1 if x > 0 else 0
                                  for x in d.fee_results.Q_cooling_required)
        if months_with_cooling != 3:
            logging.error("FEE is probably wrong due to cooling calculation")
            check_result("FEE", xlbook.fee, d.fee_results.fee_rating, "FEE",
                         0.01)
Example #2
0
def run_dwelling(xlbook, d, can_run_fee, can_run_der, can_run_ter):
    #can_run_fee=False
    #can_run_ter=False
    write_to_excel(xlbook, d)
    runner.run_fee(d)
    runner.run_der(d)
    epctk.appendix.appendix_t.run_ter(d)
    runner.run_sap(d)

    if can_run_der:
        xlbook.set_calc_type("DER")
        check_results(xlbook, d.der_results, "DER", True)
        check_result("DER", xlbook.der, d.der_results.der_rating, "DER", 0.01)

        xlbook.set_calc_type("SAP")
        check_results(xlbook, d.er_results, "SAP", True)
        check_result("SAP", xlbook.sap, d.er_results.sap_value, "SAP", 0.01)
        return False
    if can_run_ter:
        xlbook.set_calc_type("TER")
        check_results(xlbook, d.ter_results, "TER", False)
        check_result("TER", xlbook.ter, d.ter_results.ter_rating, "TER", 0.01)

    if can_run_fee:
        xlbook.set_calc_type("FEE")
        check_results(xlbook, d.fee_results, "FEE", False)

        months_with_cooling = sum(1 if x > 0 else 0 for x in d.fee_results.Q_cooling_required)
        if months_with_cooling != 3:
            logging.error("FEE is probably wrong due to cooling calculation")
            check_result("FEE", xlbook.fee, d.fee_results.fee_rating, "FEE", 0.01)
def run_sap_only(fname, dwelling):
    """
    Run dwelling that was loaded from fname

    :param fname: file name needed to lookup SAP region
    :param dwelling: dwelling definition loaded from file
    :return:
    """

    # FIXME !!! Bit of a hack here because our tests case files don't include sap region
    if fname in SAP_REGIONS:
        dwelling['sap_region'] = SAP_REGIONS[os.path.basename(fname)]
    elif not dwelling.get("sap_region"):
        dwelling['sap_region'] = 11

    runner.run_sap(dwelling)
Example #4
0
def sap_from_yaml(fname):
    dwelling = yaml_io.from_yaml(fname)
    runner.run_sap(dwelling)
    runner.run_der(dwelling)
    epctk.appendix.appendix_t.run_ter(dwelling)
    runner.run_fee(dwelling)

    print_header("SAP RESULTS")
    print(dwelling.er_results.report)

    print_header("DER RESULTS")
    print(dwelling.der_results.report)

    print_header("TER RESULTS")
    print(dwelling.ter_results.report)

    print_header("FEE RESULTS")
    print(dwelling.fee_results.report)
Example #5
0
def sap_from_yaml(fname):
    dwelling = yaml_io.from_yaml(fname)

    print_header("SAP RESULTS")

    sap_out = runner.run_sap(dwelling)

    print(sap_out.results)

    print_header("DER RESULTS")

    der_out = runner.run_der(dwelling)
    print(der_out.results)

    print_header("TER RESULTS")
    ter_out = epctk.appendix.appendix_t.run_ter(dwelling)
    print(ter_out.results)

    print_header("FEE RESULTS")
    fee_out = runner.run_fee(dwelling)

    print(fee_out.results)
def run_dwelling(dwelling):
    runner.run_sap(dwelling)
    epctk.appendix.appendix_t.run_improvements(dwelling)
    runner.run_fee(dwelling)
    runner.run_der(dwelling)
    epctk.appendix.appendix_t.run_ter(dwelling)
Example #7
0
 def test_sap(self):
     out = run_sap(self.dwelling)
Example #8
0
 def test_sap(self):
     out = run_sap(self.dwelling)