Skip to content

Commit

Permalink
chore: remove noqa comments following cost curve refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
lanesmith authored and Jon Hagg committed Mar 26, 2021
1 parent 9f1598e commit 5bb27f8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
12 changes: 6 additions & 6 deletions powersimdata/design/generation/cost_curves.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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]:
Expand All @@ -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)
Expand Down
18 changes: 9 additions & 9 deletions powersimdata/design/generation/tests/test_cost_curves.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -239,7 +239,7 @@ def test_ks_test():
225,
max(capacity_data1),
]
price_data2 = [ # noqa: N806
price_data2 = [
23.00,
23.00,
27.00,
Expand Down

0 comments on commit 5bb27f8

Please sign in to comment.