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

update cost functions for thermal dispatch no min #1223

Merged
merged 1 commit into from
Jan 24, 2025
Merged

Conversation

rodrigomha
Copy link
Contributor

Closes #1221

@rodrigomha rodrigomha requested a review from jd-lara January 23, 2025 19:42
@rodrigomha rodrigomha self-assigned this Jan 23, 2025
@@ -342,6 +342,29 @@ function is_time_variant(cost_function::PSY.FuelCurve{PSY.PiecewisePointCurve})
return isa(PSY.get_fuel_cost(cost_function), IS.TimeSeriesKey)
end

function create_temporary_cost_function_in_system_per_unit(
original_cost_function::PSY.CostCurve,
Copy link
Member

Choose a reason for hiding this comment

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

@rodrigomha do we need to make this a more specific type?

Copy link
Contributor Author

@rodrigomha rodrigomha Jan 23, 2025

Choose a reason for hiding this comment

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

It depends. The function just replace the data in the value curve with a new value curve, always assuming that the new point data comes in per-unit, so it does not really matter whatever the original data was from (Incremental or Point or Average).

Alternatively, using something like PSY.CostCurve{PSY.PiecewisePointCurve} and PSY.FuelCurve{PSY.PiecewisePointCurve} would work for the purposes of this PR, and will only work if the data comes from a PointCurve.

Copy link

codecov bot commented Jan 23, 2025

Codecov Report

Attention: Patch coverage is 60.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 77.08%. Comparing base (ebe76d3) to head (8f46584).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/utils/powersystems_utils.jl 50.00% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1223      +/-   ##
==========================================
- Coverage   77.18%   77.08%   -0.10%     
==========================================
  Files         122      122              
  Lines       13561    13566       +5     
==========================================
- Hits        10467    10458       -9     
- Misses       3094     3108      +14     
Flag Coverage Δ
unittests 77.08% <60.00%> (-0.10%) ⬇️

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

Files with missing lines Coverage Δ
...ices/common/objective_function/piecewise_linear.jl 87.38% <100.00%> (+0.05%) ⬆️
src/utils/powersystems_utils.jl 63.55% <50.00%> (+1.41%) ⬆️

... and 4 files with indirect coverage changes

Copy link
Contributor

Performance Results

Version Precompile Time
Main 5.858162233
This Branch 5.977440952
Version Build Time
Main-Build Time Precompile 66.654075766
Main-Build Time Postcompile 0.850279878
This Branch-Build Time Precompile 70.106747563
This Branch-Build Time Postcompile 0.858365784
Version Solve Time
Main-Solve Time Precompile 616.358063714
Main-Solve Time Postcompile 588.70680338
This Branch-Solve Time Precompile 1543.965560512
This Branch-Solve Time Postcompile 1510.845480125

@jd-lara jd-lara merged commit e91e305 into main Jan 24, 2025
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix PWL cost production when using ThermalDispatchNoMin
2 participants