Skip to content

Commit

Permalink
Fix ACPowerFlow method overwriting
Browse files Browse the repository at this point in the history
  • Loading branch information
GabrielKS committed Jan 16, 2025
1 parent 3c0ccd7 commit 17b0423
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/powerflow_types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,19 @@ abstract type ACPowerFlowSolverType end
struct KLUACPowerFlow <: ACPowerFlowSolverType end
struct NLSolveACPowerFlow <: ACPowerFlowSolverType end

Base.@kwdef struct ACPowerFlow{ACSolver <: ACPowerFlowSolverType} <:
PowerFlowEvaluationModel
check_reactive_power_limits::Bool = false
struct ACPowerFlow{ACSolver <: ACPowerFlowSolverType} <: PowerFlowEvaluationModel
check_reactive_power_limits::Bool
end

# Create a constructor for ACPowerFlow that defaults to KLUACPowerFlow
function ACPowerFlow(ACSolver::Type{<:ACPowerFlowSolverType} = KLUACPowerFlow;
ACPowerFlow{ACSolver}(;
check_reactive_power_limits::Bool = false,
)
return ACPowerFlow{ACSolver}(check_reactive_power_limits)
end
) where {ACSolver <: ACPowerFlowSolverType} =
ACPowerFlow{ACSolver}(check_reactive_power_limits)

ACPowerFlow(
ACSolver::Type{<:ACPowerFlowSolverType} = KLUACPowerFlow;
check_reactive_power_limits::Bool = false,
) = ACPowerFlow{ACSolver}(check_reactive_power_limits)

struct DCPowerFlow <: PowerFlowEvaluationModel end
struct PTDFDCPowerFlow <: PowerFlowEvaluationModel end
Expand Down

0 comments on commit 17b0423

Please sign in to comment.