From 5bb27f8fa49b6ebd6481f0dda6b881e44fdcbf02 Mon Sep 17 00:00:00 2001 From: Lane Smith Date: Fri, 26 Mar 2021 11:08:09 -0700 Subject: [PATCH] chore: remove noqa comments following cost curve refactor --- powersimdata/design/generation/cost_curves.py | 12 ++++++------ .../generation/tests/test_cost_curves.py | 18 +++++++++--------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/powersimdata/design/generation/cost_curves.py b/powersimdata/design/generation/cost_curves.py index f1511f269..9ff257017 100644 --- a/powersimdata/design/generation/cost_curves.py +++ b/powersimdata/design/generation/cost_curves.py @@ -259,8 +259,8 @@ def build_supply_curve(grid, num_segments, area, gen_type, area_type=None, plot= supply_df = supply_df.reset_index(drop=True) # Determine the points that comprise the supply curve - capacity_data = [] # noqa: N806 - price_data = [] # noqa: N806 + capacity_data = [] + price_data = [] capacity_diff_sum = 0 for i in supply_df.index: capacity_data.append(capacity_diff_sum) @@ -315,7 +315,7 @@ def ks_test( area=None, gen_type=None, plot=True, -): # noqa: N803 +): """Runs a test that is similar to the Kolmogorov-Smirnov test. This function takes two supply curves as inputs and returns the greatest difference in price between the two supply curves. This function requires that the supply curves offer the same @@ -349,11 +349,11 @@ def ks_test( ) # Create a list that has every capacity value in which either supply curve steps up - capacity_data_all = list(set(capacity_data1) | set(capacity_data2)) # noqa: N806 + capacity_data_all = list(set(capacity_data1) | set(capacity_data2)) capacity_data_all.sort() # For each capacity value, associate the two corresponding price values - price_data_all = [] # noqa: N806 + price_data_all = [] for i in range(len(capacity_data_all)): # Determine the correpsonding price from the first supply curve if capacity_data_all[i] == capacity_data1[-1]: @@ -374,7 +374,7 @@ def ks_test( price_data_diff = [ abs(price_data_all[i][0] - price_data_all[i][1]) for i in range(len(price_data_all)) - ] # noqa: N806 + ] # Determine the maximum price difference max_diff = max(price_data_diff) diff --git a/powersimdata/design/generation/tests/test_cost_curves.py b/powersimdata/design/generation/tests/test_cost_curves.py index 38dfec72f..5ae2347bd 100644 --- a/powersimdata/design/generation/tests/test_cost_curves.py +++ b/powersimdata/design/generation/tests/test_cost_curves.py @@ -176,11 +176,11 @@ def test_get_supply_data(): def test_build_supply_curve_1seg(): - capacity_test, price_test = build_supply_curve( # noqa: N806 + capacity_test, price_test = build_supply_curve( grid, 1, "Colorado", "ng", "loadzone", plot=False ) - capacity_exp = [0, 10, 10, 30, 30, 50, 50, 100, 100, 200] # noqa: N806 - price_exp = [ # noqa: N806 + capacity_exp = [0, 10, 10, 30, 30, 50, 50, 100, 100, 200] + price_exp = [ 25.10, 25.10, 30.40, @@ -197,11 +197,11 @@ def test_build_supply_curve_1seg(): def test_build_supply_curve_2seg(): - capacity_test, price_test = build_supply_curve( # noqa: N806 + capacity_test, price_test = build_supply_curve( grid, 2, "Utah", "coal", "loadzone", plot=False ) - capacity_exp = [0, 10, 10, 20, 20, 45, 45, 70, 70, 120, 120, 170] # noqa: N806 - price_exp = [ # noqa: N806 + capacity_exp = [0, 10, 10, 20, 20, 45, 45, 70, 70, 120, 120, 170] + price_exp = [ 30.100, 30.100, 30.300, @@ -220,10 +220,10 @@ def test_build_supply_curve_2seg(): def test_ks_test(): - capacity_data1, price_data1 = build_supply_curve( # noqa: N806 + capacity_data1, price_data1 = build_supply_curve( grid, 1, "Washington", "coal", "loadzone", plot=False ) - capacity_data2 = [ # noqa: N806 + capacity_data2 = [ 0, 15, 15, @@ -239,7 +239,7 @@ def test_ks_test(): 225, max(capacity_data1), ] - price_data2 = [ # noqa: N806 + price_data2 = [ 23.00, 23.00, 27.00,