Skip to content

Commit

Permalink
Run formatter, accept suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
GabrielKS committed Feb 20, 2024
1 parent 3f191aa commit ccdd185
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 9 deletions.
5 changes: 4 additions & 1 deletion src/PowerSystems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ export QuadraticFunctionData
export PolynomialFunctionData
export PiecewiseLinearPointData
export PiecewiseLinearSlopeData
export get_proportional_term, get_quadratic_term, get_constant_term, get_coefficients
export get_proportional_term
export get_quadratic_term
export get_constant_term
export get_coefficients
export get_slopes
export get_x_lengths
export is_convex
Expand Down
2 changes: 0 additions & 2 deletions src/models/function_data.jl
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ function _validate_piecewise_x(x_coords)
# (length(x_coords) >= 2) ||
# throw(ArgumentError("Must specify at least two x-coordinates"))
issorted(x_coords) || throw(ArgumentError("Piecewise x-coordinates must be ascending"))
# TODO are there legitimate cases where we'd want negative x-coordinates?
# (x_coords[1] >= 0) || throw(ArgumentError("Piecewise x-coordinates cannot be negative"))
end

"""
Expand Down
2 changes: 1 addition & 1 deletion src/parsers/power_system_table_data.jl
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,7 @@ function calculate_variable_cost(
for i in 2:length(var_cost)
var_cost[i] = (var_cost[i - 1][1] + var_cost[i][1], var_cost[i][2])
end
var_cost = PiecewiseLinearPointData([(x, y) for (y, x) in var_cost])
var_cost = PiecewiseLinearPointData([(x, y) for (y, x) in var_cost])

elseif length(var_cost) == 1
# if there is only one point, use it to determine the constant $/MW cost
Expand Down
35 changes: 30 additions & 5 deletions test/data_14bus_pu.jl
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,12 @@ thermal_generators14(nodes14) = [
reactive_power_limits = (min = 0.0, max = 0.1),
time_limits = nothing,
ramp_limits = nothing,
operation_cost = ThreePartCost(QuadraticFunctionData(430.292599, 2000.0, 0.0), 0.0, 0.0, 0.0),
operation_cost = ThreePartCost(
QuadraticFunctionData(430.292599, 2000.0, 0.0),
0.0,
0.0,
0.0,
),
base_power = 100.0,
),
ThermalStandard(;
Expand All @@ -671,7 +676,12 @@ thermal_generators14(nodes14) = [
reactive_power_limits = (min = -0.4, max = 0.5),
time_limits = nothing,
ramp_limits = nothing,
operation_cost = ThreePartCost(QuadraticFunctionData(2500.0, 2000.0, 0.0), 0.0, 0.0, 0.0),
operation_cost = ThreePartCost(
QuadraticFunctionData(2500.0, 2000.0, 0.0),
0.0,
0.0,
0.0,
),
base_power = 100.0,
),
ThermalStandard(;
Expand All @@ -688,7 +698,12 @@ thermal_generators14(nodes14) = [
reactive_power_limits = (min = 0.0, max = 0.4),
time_limits = nothing,
ramp_limits = nothing,
operation_cost = ThreePartCost(QuadraticFunctionData(100.0, 4000.0, 0.0), 0.0, 0.0, 0.0),
operation_cost = ThreePartCost(
QuadraticFunctionData(100.0, 4000.0, 0.0),
0.0,
0.0,
0.0,
),
base_power = 100.0,
),
ThermalStandard(;
Expand All @@ -705,7 +720,12 @@ thermal_generators14(nodes14) = [
reactive_power_limits = (min = -0.06, max = 0.24),
time_limits = nothing,
ramp_limits = nothing,
operation_cost = ThreePartCost(QuadraticFunctionData(100.0, 4000.0, 0.0), 0.0, 0.0, 0.0),
operation_cost = ThreePartCost(
QuadraticFunctionData(100.0, 4000.0, 0.0),
0.0,
0.0,
0.0,
),
base_power = 100.0,
),
ThermalStandard(;
Expand All @@ -722,7 +742,12 @@ thermal_generators14(nodes14) = [
reactive_power_limits = (min = -0.06, max = 0.24),
time_limits = nothing,
ramp_limits = nothing,
operation_cost = ThreePartCost(QuadraticFunctionData(100.0, 4000.0, 0.0), 0.0, 0.0, 0.0),
operation_cost = ThreePartCost(
QuadraticFunctionData(100.0, 4000.0, 0.0),
0.0,
0.0,
0.0,
),
base_power = 100.0,
),
]
Expand Down

0 comments on commit ccdd185

Please sign in to comment.