Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jd/hvdc model #1003

Merged
merged 76 commits into from
Sep 13, 2023
Merged

Jd/hvdc model #1003

merged 76 commits into from
Sep 13, 2023

Conversation

jd-lara
Copy link
Member

@jd-lara jd-lara commented Sep 6, 2023

closes #926
closes #917

@@ -27,6 +27,7 @@ const JuMPVariableMatrix = DenseAxisArray{
const JuMPFloatArray = DenseAxisArray{Float64}
const JuMPVariableArray = DenseAxisArray{JuMP.VariableRef}

const TwoTerminalHVDCTypes = Union{PSY.TwoTerminalHVDCLine, PSY.TwoTerminalVSCDCLine}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be an abstract type?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think there is much value in an additional abstraction in PSY for this.

src/core/formulations.jl Show resolved Hide resolved
devices =
get_available_components(T, sys, get_attribute(model, "filter_function"))
add_constraints!(container, FlowRateConstraint, devices, model, network_model)
add_constraint_dual!(container, sys, model)
return
end

# Repeated method to avoid ambiguity between HVDCP2PUnbounded and HVDCP2PLossless
# Repeated method to avoid ambiguity between HVDCTwoTerminalUnbounded and HVDCTwoTerminalLossless
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be worth refactoring to make each duplicate function call a common function such that no logic is duplicated?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would still cause the same issue because the arguments will still be ambiguous

src/devices_models/devices/HVDCsystems.jl Show resolved Hide resolved
@jd-lara jd-lara marked this pull request as ready for review September 13, 2023 21:35
@@ -26,7 +26,7 @@ function attach_feedforward!(
ff_ = T(;
component_type = get_component_type(ff),
source = get_entry_type(get_optimization_container_key(ff)),
affected_values = [get_entry_type(get_optimization_container_key(ff))],
affected_values = affected_values = get_entry_type.(get_affected_values(ff)),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
affected_values = affected_values = get_entry_type.(get_affected_values(ff)),
affected_values = affected_values =
get_entry_type.(get_affected_values(ff)),

@jd-lara jd-lara merged commit 0f4628b into main Sep 13, 2023
2 of 6 checks passed
@jd-lara
Copy link
Member Author

jd-lara commented Sep 13, 2023

image

@jd-lara jd-lara deleted the jd/hvdc_model branch September 13, 2023 23:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants