diff --git a/tests/test_hybrids.py b/tests/test_hybrids.py index b7b27c281..46eabdae3 100644 --- a/tests/test_hybrids.py +++ b/tests/test_hybrids.py @@ -102,7 +102,9 @@ def test_hybridization_profile_output_with_ratio_none(): hwp, ) = h.profiles.values() h_meta = h.hybrid_meta - h_idx = np.where(h_meta[SupplyCurveField.SC_POINT_GID] == sc_point_gid)[0][0] + h_idx = np.where( + h_meta[SupplyCurveField.SC_POINT_GID] == sc_point_gid + )[0][0] assert np.allclose(hp[:, h_idx], weighted_solar) assert np.allclose(hsp[:, h_idx], weighted_solar) diff --git a/tests/test_rep_profiles.py b/tests/test_rep_profiles.py index fe4b58ec5..bf779e041 100644 --- a/tests/test_rep_profiles.py +++ b/tests/test_rep_profiles.py @@ -104,7 +104,9 @@ def test_weighted_meanoid(): sites = np.arange(100) rev_summary = pd.DataFrame({SupplyCurveField.GEN_GIDS: sites, SupplyCurveField.RES_GIDS: sites, - SupplyCurveField.GID_COUNTS: [1] * 50 + [0] * 50}) + SupplyCurveField.GID_COUNTS: ( + [1] * 50 + [0] * 50 + )}) r = RegionRepProfile(GEN_FPATH, rev_summary) weights = r._get_region_attr(r._rev_summary, SupplyCurveField.GID_COUNTS) @@ -161,7 +163,8 @@ def test_sc_points(): SupplyCurveField.RES_GIDS: sites, 'timezone': timezone}) - rp = RepProfiles(GEN_FPATH, rev_summary, SupplyCurveField.SC_GID, weight=None) + rp = RepProfiles(GEN_FPATH, rev_summary, + SupplyCurveField.SC_GID, weight=None) rp.run(max_workers=1) with Resource(GEN_FPATH) as res: @@ -191,8 +194,10 @@ def test_agg_profile(): rp.run(scaled_precision=False, max_workers=1) for index in rev_summary.index: - gen_gids = json.loads(rev_summary.loc[index, SupplyCurveField.GEN_GIDS]) - res_gids = json.loads(rev_summary.loc[index, SupplyCurveField.RES_GIDS]) + gen_gids = json.loads(rev_summary.loc[index, + SupplyCurveField.GEN_GIDS]) + res_gids = json.loads(rev_summary.loc[index, + SupplyCurveField.RES_GIDS]) weights = np.array( json.loads(rev_summary.loc[index, SupplyCurveField.GID_COUNTS])) diff --git a/tests/test_supply_curve_aggregation.py b/tests/test_supply_curve_aggregation.py index 72687c5b2..fd26a7e02 100644 --- a/tests/test_supply_curve_aggregation.py +++ b/tests/test_supply_curve_aggregation.py @@ -47,7 +47,8 @@ def check_agg(agg_out, baseline_h5): truth = f[dset] if dset == 'meta': truth = truth.set_index('sc_gid') - for c in [SupplyCurveField.SOURCE_GIDS, SupplyCurveField.GID_COUNTS]: + for c in [SupplyCurveField.SOURCE_GIDS, + SupplyCurveField.GID_COUNTS]: test[c] = test[c].astype(str) truth = truth.fillna('none') diff --git a/tests/test_supply_curve_compute.py b/tests/test_supply_curve_compute.py index c63a28ad7..526a28760 100644 --- a/tests/test_supply_curve_compute.py +++ b/tests/test_supply_curve_compute.py @@ -182,8 +182,10 @@ def test_integrated_sc_simple_friction(): sc_simple = pd.read_csv(sc_simple) assert SupplyCurveField.MEAN_LCOE_FRICTION in sc_simple assert SupplyCurveField.TOTAL_LCOE_FRICTION in sc_simple - test = sc_simple[SupplyCurveField.MEAN_LCOE_FRICTION] + sc_simple['lcot'] - assert np.allclose(test, sc_simple[SupplyCurveField.TOTAL_LCOE_FRICTION]) + test = (sc_simple[SupplyCurveField.MEAN_LCOE_FRICTION] + + sc_simple['lcot']) + assert np.allclose(test, + sc_simple[SupplyCurveField.TOTAL_LCOE_FRICTION]) fpath_baseline = os.path.join( TESTDATADIR, "sc_out/sc_simple_out_friction.csv" @@ -279,7 +281,8 @@ def test_parallel(): assert_frame_equal(sc_full_parallel, sc_full_serial) -def verify_trans_cap(sc_table, trans_tables, cap_col=SupplyCurveField.CAPACITY): +def verify_trans_cap(sc_table, trans_tables, + cap_col=SupplyCurveField.CAPACITY): """ Verify that sc_points are connected to features in the correct capacity bins diff --git a/tests/test_supply_curve_sc_aggregation.py b/tests/test_supply_curve_sc_aggregation.py index 6ccbf5821..c38c8d663 100644 --- a/tests/test_supply_curve_sc_aggregation.py +++ b/tests/test_supply_curve_sc_aggregation.py @@ -292,9 +292,11 @@ def test_agg_extra_dsets(): for dset in h5_dsets: assert "mean_{}".format(dset) in summary.columns - check = summary['mean_lcoe_fcr-2012'] == summary[SupplyCurveField.MEAN_LCOE] + check = (summary['mean_lcoe_fcr-2012'] + == summary[SupplyCurveField.MEAN_LCOE]) assert not any(check) - check = summary['mean_lcoe_fcr-2013'] == summary[SupplyCurveField.MEAN_LCOE] + check = (summary['mean_lcoe_fcr-2013'] + == summary[SupplyCurveField.MEAN_LCOE]) assert not any(check) avg = (summary['mean_lcoe_fcr-2012'] + summary['mean_lcoe_fcr-2013']) / 2