Skip to content

Commit

Permalink
add error message
Browse files Browse the repository at this point in the history
  • Loading branch information
jd-lara committed Jan 5, 2025
1 parent 8aa3bba commit e173a0f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/core/network_model.jl
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,16 @@ function instantiate_network_model(
model.PTDF_matrix =
PNM.PTDF(sys; reduce_radial_branches = model.reduce_radial_branches)
end

if !model.reduce_radial_branches && !isempty(model.PTDF_matrix.radial_network_reduction)
throw(
IS.ConflictingInputsError(
"The provided PTDF Matrix has reduced radial branches and mismatches the network \\
model specification radial_network_reduction = false. Set the keyword argument \\
radial_network_reduction = true in your network model" )
)
end

if model.reduce_radial_branches
@assert !isempty(model.PTDF_matrix.radial_network_reduction)
model.radial_network_reduction = model.PTDF_matrix.radial_network_reduction
Expand Down

0 comments on commit e173a0f

Please sign in to comment.