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

Fixing Pumped Hydro formulation #29

Merged
merged 3 commits into from
Apr 2, 2024
Merged

Fixing Pumped Hydro formulation #29

merged 3 commits into from
Apr 2, 2024

Conversation

sourabhdalvi
Copy link
Collaborator

Fixes #28

@sourabhdalvi sourabhdalvi requested a review from jd-lara March 1, 2024 18:02
Copy link

codecov bot commented Mar 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.54%. Comparing base (d774fe6) to head (931a7de).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #29      +/-   ##
==========================================
+ Coverage   86.14%   87.54%   +1.39%     
==========================================
  Files           9        9              
  Lines         859      859              
==========================================
+ Hits          740      752      +12     
+ Misses        119      107      -12     
Flag Coverage Δ
unittests 87.54% <ø> (+1.39%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
src/core/variables.jl 100.00% <ø> (ø)
src/hydro_generation.jl 83.87% <ø> (+3.02%) ⬆️

@pesap
Copy link
Member

pesap commented Mar 1, 2024

LGTM. Wondering how we did not found this typo before. We should probably revisit the test of this constraint. Do you know where it is?

@jd-lara jd-lara self-assigned this Mar 2, 2024
Copy link
Member

@jd-lara jd-lara left a comment

Choose a reason for hiding this comment

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

Can we add a test to this?

@jd-lara jd-lara requested review from pesap, bknueven and jd-lara and removed request for bknueven March 4, 2024 00:26
@pesap
Copy link
Member

pesap commented Mar 7, 2024

Can we add a test to this?

Yes. I will add the test for this by the end of the week.

List of changes:
- Included test that validates that the PumpedHydro is operating
  correctly.

Issue #29
Comment on lines 10 to 11
model = DecisionModel(template_ed, sys_ed, name="ED", optimizer=HiGHS_optimizer,
optimizer_solve_log_print=true, store_variable_names=true)
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
model = DecisionModel(template_ed, sys_ed, name="ED", optimizer=HiGHS_optimizer,
optimizer_solve_log_print=true, store_variable_names=true)
model = DecisionModel(
template_ed,
sys_ed,
name="ED",
optimizer=HiGHS_optimizer,
optimizer_solve_log_print=true,
store_variable_names=true,
)

optimizer_solve_log_print=true, store_variable_names=true)

@test build!(model, output_dir=output_dir) == PSI.BuildStatus.BUILT
@test solve!(model; optimizer=HiGHS_optimizer, output_dir=output_dir) == RunStatus.SUCCESSFUL
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 solve!(model; optimizer=HiGHS_optimizer, output_dir=output_dir) == RunStatus.SUCCESSFUL
@test solve!(model; optimizer=HiGHS_optimizer, output_dir=output_dir) ==
RunStatus.SUCCESSFUL

@test isapprox(last_value, 0, atol=1e-5)
end


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

@pesap
Copy link
Member

pesap commented Mar 28, 2024

I opened a PR on PowerSystemTestData the update to the testing system. I think once that is live the testing should pass.

@pesap pesap merged commit 437e64d into main Apr 2, 2024
6 of 8 checks passed
@jd-lara jd-lara deleted the sd/bug_fix branch June 28, 2024 19:55
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.

Bug in Hydro Pumped storage in energy balance constraint
3 participants