diff --git a/tests/test_supply_curve_compute.py b/tests/test_supply_curve_compute.py index 49066eb4a..9b3b8abb8 100644 --- a/tests/test_supply_curve_compute.py +++ b/tests/test_supply_curve_compute.py @@ -591,11 +591,17 @@ def test_least_cost_simple_with_reinforcement(): assert not np.allclose(sc_simple[SupplyCurveField.TOTAL_LCOE], sc_simple_r[SupplyCurveField.TOTAL_LCOE]) + check_cols = [SupplyCurveField.POI_LAT, + SupplyCurveField.POI_LON, + SupplyCurveField.REINFORCEMENT_POI_LAT, + SupplyCurveField.REINFORCEMENT_POI_LON, + SupplyCurveField.REINFORCEMENT_COST_PER_MW, + SupplyCurveField.REINFORCEMENT_DIST_KM] nan_cols = [SupplyCurveField.POI_LAT, SupplyCurveField.POI_LON, SupplyCurveField.REINFORCEMENT_POI_LAT, SupplyCurveField.REINFORCEMENT_POI_LON] - for col in _REQUIRED_OUTPUT_COLS: + for col in check_cols: assert col in sc_simple if col in nan_cols: assert sc_simple[col].isna().all() @@ -605,6 +611,15 @@ def test_least_cost_simple_with_reinforcement(): assert col in sc_simple_r assert (sc_simple_r[col] > 0).all() + assert np.allclose( + sc_simple[SupplyCurveField.TOTAL_TRANS_CAP_COST_PER_MW] + * 0.1 + / sc_simple[SupplyCurveField.MEAN_CF_AC] + / 8760, + sc_simple[SupplyCurveField.LCOT], + atol=0.001 + ) + # pylint: disable=no-member @pytest.mark.parametrize("r_costs", [True, False]) @@ -641,6 +656,15 @@ def test_least_cost_simple_with_trans_cap_cost_per_mw(r_costs): sc_simple = pd.read_csv(sc_simple) assert (sc_simple[SupplyCurveField.TRANS_GID] == 42445).all() + assert np.allclose( + sc_simple[SupplyCurveField.TOTAL_TRANS_CAP_COST_PER_MW] + * 0.1 + / sc_simple[SupplyCurveField.MEAN_CF_AC] + / 8760, + sc_simple[SupplyCurveField.LCOT], + atol=0.001 + ) + if not r_costs: lcot = 4244.5 / (sc_simple[SupplyCurveField.MEAN_CF_AC] * 8760) assert np.allclose(lcot, sc_simple[SupplyCurveField.LCOT],