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

Merge subproblem parameters into main container #3

Merged
merged 1 commit into from
Apr 2, 2024

Conversation

daniel-thom
Copy link
Contributor

No description provided.

@daniel-thom daniel-thom requested a review from jd-lara April 2, 2024 16:44
Comment on lines +45 to +66
main_problem = PSI.OptimizationContainer(sys, settings, nothing, U),
subproblems = subproblems,
time_steps = 1:1,
resolution = IS.time_period_conversion(resolution),
settings = settings,
settings_copy = PSI.copy_for_serialization(settings),
variables = Dict{PSI.VariableKey, AbstractArray}(),
aux_variables = Dict{PSI.AuxVarKey, AbstractArray}(),
duals = Dict{PSI.ConstraintKey, AbstractArray}(),
constraints = Dict{PSI.ConstraintKey, AbstractArray}(),
objective_function = PSI.ObjectiveFunction(),
expressions = Dict{PSI.ExpressionKey, AbstractArray}(),
parameters = Dict{PSI.ParameterKey, PSI.ParameterContainer}(),
primal_values_cache = PSI.PrimalValuesCache(),
initial_conditions = Dict{PSI.ICKey, Vector{PSI.InitialCondition}}(),
initial_conditions_data = PSI.InitialConditionsData(),
base_power = PSY.get_base_power(sys),
optimizer_stats = PSI.OptimizerStats(),
built_for_recurrent_solves = false,
metadata = PSI.OptimizationContainerMetadata(),
default_time_series_type = U,
mpi_info = nothing,
Copy link

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
main_problem = PSI.OptimizationContainer(sys, settings, nothing, U),
subproblems = subproblems,
time_steps = 1:1,
resolution = IS.time_period_conversion(resolution),
settings = settings,
settings_copy = PSI.copy_for_serialization(settings),
variables = Dict{PSI.VariableKey, AbstractArray}(),
aux_variables = Dict{PSI.AuxVarKey, AbstractArray}(),
duals = Dict{PSI.ConstraintKey, AbstractArray}(),
constraints = Dict{PSI.ConstraintKey, AbstractArray}(),
objective_function = PSI.ObjectiveFunction(),
expressions = Dict{PSI.ExpressionKey, AbstractArray}(),
parameters = Dict{PSI.ParameterKey, PSI.ParameterContainer}(),
primal_values_cache = PSI.PrimalValuesCache(),
initial_conditions = Dict{PSI.ICKey, Vector{PSI.InitialCondition}}(),
initial_conditions_data = PSI.InitialConditionsData(),
base_power = PSY.get_base_power(sys),
optimizer_stats = PSI.OptimizerStats(),
built_for_recurrent_solves = false,
metadata = PSI.OptimizationContainerMetadata(),
default_time_series_type = U,
mpi_info = nothing,
main_problem=PSI.OptimizationContainer(sys, settings, nothing, U),
subproblems=subproblems,
time_steps=1:1,
resolution=IS.time_period_conversion(resolution),
settings=settings,
settings_copy=PSI.copy_for_serialization(settings),
variables=Dict{PSI.VariableKey, AbstractArray}(),
aux_variables=Dict{PSI.AuxVarKey, AbstractArray}(),
duals=Dict{PSI.ConstraintKey, AbstractArray}(),
constraints=Dict{PSI.ConstraintKey, AbstractArray}(),
objective_function=PSI.ObjectiveFunction(),
expressions=Dict{PSI.ExpressionKey, AbstractArray}(),
parameters=Dict{PSI.ParameterKey, PSI.ParameterContainer}(),
primal_values_cache=PSI.PrimalValuesCache(),
initial_conditions=Dict{PSI.ICKey, Vector{PSI.InitialCondition}}(),
initial_conditions_data=PSI.InitialConditionsData(),
base_power=PSY.get_base_power(sys),
optimizer_stats=PSI.OptimizerStats(),
built_for_recurrent_solves=false,
metadata=PSI.OptimizationContainerMetadata(),
default_time_series_type=U,
mpi_info=nothing,

@@ -123,10 +123,10 @@ function PSI.set_service_model!(
PSI.set_service_model!(
template.base_template,
service_name,
ServiceModel(service_type, formulation; use_service_name=true),
ServiceModel(service_type, formulation; use_service_name = true),
Copy link

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
ServiceModel(service_type, formulation; use_service_name = true),
ServiceModel(service_type, formulation; use_service_name=true),

)
for (id, sub_template) in get_sub_templates(template)
service_model = ServiceModel(service_type, formulation; use_service_name=true)
service_model = ServiceModel(service_type, formulation; use_service_name = true)
Copy link

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
service_model = ServiceModel(service_type, formulation; use_service_name = true)
service_model = ServiceModel(service_type, formulation; use_service_name=true)

@@ -3,7 +3,7 @@ struct MultiRegionProblem <: PSI.DecisionProblem end
function PSI.DecisionModel{MultiRegionProblem}(
template::MultiProblemTemplate,
sys::PSY.System,
::Union{Nothing, JuMP.Model}=nothing;
::Union{Nothing, JuMP.Model} = nothing;
Copy link

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
::Union{Nothing, JuMP.Model} = nothing;
::Union{Nothing, JuMP.Model}=nothing;

@jd-lara jd-lara merged commit b344ddb into main Apr 2, 2024
2 of 7 checks passed
@jd-lara jd-lara deleted the dt/merge-parameters branch April 2, 2024 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants