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/move structs to is #1068

Merged
merged 242 commits into from
Apr 26, 2024
Merged

Jd/move structs to is #1068

merged 242 commits into from
Apr 26, 2024

Conversation

jd-lara
Copy link
Member

@jd-lara jd-lara commented Feb 29, 2024

jd-lara and others added 9 commits February 7, 2024 16:34
* add place holders

* add requires_reconciliation trait

* afc/created test for ic

* afc/added functions on PSI for ic reconciliation

* afc/fixed rounding, tested

Still getting the same error as before on T=7

* add place holders

* add requires_reconciliation trait

* afc/created test for ic

* afc/added functions on PSI for ic reconciliation

* afc/fixed rounding, tested

Still getting the same error as before on T=7

* add place holders

* add requires_reconciliation trait

* afc/created test for ic

* afc/added functions on PSI for ic reconciliation

* afc/fixed rounding, tested

Still getting the same error as before on T=7

* add place holders

* afc/created test for ic

* afc/added functions on PSI for ic reconciliation

* afc/fixed rounding, tested

Still getting the same error as before on T=7

* formatter

---------

Co-authored-by: alefcastelli <alef.castelli@gmail.com>
Co-authored-by: lpstreitmatter <61252469+lpstreitmatter@users.noreply.github.com>
@jd-lara jd-lara requested a review from daniel-thom February 29, 2024 23:57
@jd-lara jd-lara self-assigned this Mar 4, 2024
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

@@ -123,21 +118,7 @@ function get_enum_value(enum, value::String)
return ENUM_MAPPINGS[enum][val]
end

Base.convert(::Type{BuildStatus}, val::String) = get_enum_value(BuildStatus, val)
Base.convert(::Type{SimulationBuildStatus}, val::String) = get_enum_value(SimulationBuildStatus, val)
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
Base.convert(::Type{SimulationBuildStatus}, val::String) = get_enum_value(SimulationBuildStatus, val)
Base.convert(::Type{SimulationBuildStatus}, val::String) =
get_enum_value(SimulationBuildStatus, val)

error("Simulation status is invalid, you need to rebuild the simulation")
sim_status = get_simulation_build_status(sim)
if (sim_status != SimulationBuildStatus.BUILT) || (sim_status != RunStatus.READY)
error("Simulation status $sim_status is invalid, you need to rebuild the simulation")
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
error("Simulation status $sim_status is invalid, you need to rebuild the simulation")
error(
"Simulation status $sim_status is invalid, you need to rebuild the simulation",
)

@@ -27,7 +27,7 @@ end
limits = PSY.get_flow_limits(PSY.get_component(MonitoredLine, system, "1"))
template = get_thermal_dispatch_template_network(ACPPowerModel)
model_m = DecisionModel(template, system; optimizer = ipopt_optimizer)
@test build!(model_m; output_dir = mktempdir(; cleanup = true)) == PSI.BuildStatus.BUILT
@test build!(model_m; output_dir = mktempdir(; cleanup = true)) == PSI.ModelBuildStatus.BUILT
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
@test build!(model_m; output_dir = mktempdir(; cleanup = true)) == PSI.ModelBuildStatus.BUILT
@test build!(model_m; output_dir = mktempdir(; cleanup = true)) ==
PSI.ModelBuildStatus.BUILT

set_device_model!(template, DeviceModel(TwoTerminalHVDCLine, HVDCTwoTerminalLossless))
model_m = DecisionModel(template, system; optimizer = HiGHS_optimizer)
@test build!(model_m; output_dir = mktempdir(; cleanup = true)) == PSI.BuildStatus.BUILT
@test build!(model_m; output_dir = mktempdir(; cleanup = true)) == PSI.ModelBuildStatus.BUILT
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
@test build!(model_m; output_dir = mktempdir(; cleanup = true)) == PSI.ModelBuildStatus.BUILT
@test build!(model_m; output_dir = mktempdir(; cleanup = true)) ==
PSI.ModelBuildStatus.BUILT

@@ -559,7 +571,7 @@ end
)
set_device_model!(template, DeviceModel(PhaseShiftingTransformer, PhaseAngleControl))
model_m = DecisionModel(template, system; optimizer = HiGHS_optimizer)
@test build!(model_m; output_dir = mktempdir(; cleanup = true)) == PSI.BuildStatus.BUILT
@test build!(model_m; output_dir = mktempdir(; cleanup = true)) == PSI.ModelBuildStatus.BUILT
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
@test build!(model_m; output_dir = mktempdir(; cleanup = true)) == PSI.ModelBuildStatus.BUILT
@test build!(model_m; output_dir = mktempdir(; cleanup = true)) ==
PSI.ModelBuildStatus.BUILT

@@ -57,15 +57,15 @@ end

c_sys5_uc = PSB.build_system(PSITestSystems, "c_sys5_uc"; add_reserves = true)
model = DecisionModel(template, c_sys5_uc)
@test build!(model; output_dir = mktempdir(; cleanup = true)) == PSI.BuildStatus.BUILT
@test build!(model; output_dir = mktempdir(; cleanup = true)) == PSI.ModelBuildStatus.BUILT
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
@test build!(model; output_dir = mktempdir(; cleanup = true)) == PSI.ModelBuildStatus.BUILT
@test build!(model; output_dir = mktempdir(; cleanup = true)) ==
PSI.ModelBuildStatus.BUILT

@@ -95,7 +95,7 @@ end
c_sys5_uc = PSB.build_system(PSITestSystems, "c_sys5_uc"; add_reserves = true)

model = DecisionModel(template, c_sys5_uc; optimizer = cbc_optimizer)
@test build!(model; output_dir = mktempdir(; cleanup = true)) == PSI.BuildStatus.BUILT
@test build!(model; output_dir = mktempdir(; cleanup = true)) == PSI.ModelBuildStatus.BUILT
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
@test build!(model; output_dir = mktempdir(; cleanup = true)) == PSI.ModelBuildStatus.BUILT
@test build!(model; output_dir = mktempdir(; cleanup = true)) ==
PSI.ModelBuildStatus.BUILT

@@ -112,7 +112,7 @@ end

c_sys5_uc = PSB.build_system(PSITestSystems, "c_sys5_uc_non_spin"; add_reserves = true)
model = DecisionModel(template, c_sys5_uc; optimizer = HiGHS_optimizer)
@test build!(model; output_dir = mktempdir(; cleanup = true)) == PSI.BuildStatus.BUILT
@test build!(model; output_dir = mktempdir(; cleanup = true)) == PSI.ModelBuildStatus.BUILT
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
@test build!(model; output_dir = mktempdir(; cleanup = true)) == PSI.ModelBuildStatus.BUILT
@test build!(model; output_dir = mktempdir(; cleanup = true)) ==
PSI.ModelBuildStatus.BUILT

@@ -131,7 +131,7 @@ end

c_sys5_re = PSB.build_system(PSITestSystems, "c_sys5_re"; add_reserves = true)
model = DecisionModel(template, c_sys5_re)
@test build!(model; output_dir = mktempdir(; cleanup = true)) == PSI.BuildStatus.BUILT
@test build!(model; output_dir = mktempdir(; cleanup = true)) == PSI.ModelBuildStatus.BUILT
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
@test build!(model; output_dir = mktempdir(; cleanup = true)) == PSI.ModelBuildStatus.BUILT
@test build!(model; output_dir = mktempdir(; cleanup = true)) ==
PSI.ModelBuildStatus.BUILT

@@ -154,7 +154,7 @@ end

c_sys5_hyd = PSB.build_system(PSITestSystems, "c_sys5_hyd"; add_reserves = true)
model = DecisionModel(template, c_sys5_hyd)
@test build!(model; output_dir = mktempdir(; cleanup = true)) == PSI.BuildStatus.BUILT
@test build!(model; output_dir = mktempdir(; cleanup = true)) == PSI.ModelBuildStatus.BUILT
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
@test build!(model; output_dir = mktempdir(; cleanup = true)) == PSI.ModelBuildStatus.BUILT
@test build!(model; output_dir = mktempdir(; cleanup = true)) ==
PSI.ModelBuildStatus.BUILT

@jd-lara jd-lara merged commit f76fadd into psy4 Apr 26, 2024
1 of 6 checks passed
@jd-lara jd-lara deleted the jd/move_structs_to_is branch May 8, 2024 22:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

8 participants