Skip to content

Derive the cost-coefficient ratio to the system base ourselves - #166

Merged
jd-lara merged 2 commits into
mainfrom
rh/cost_coefficient_ratio
Sep 14, 2026
Merged

jd-lara merged 2 commits into
mainfrom
rh/cost_coefficient_ratio

Conversation

@rodrigomha

@rodrigomha rodrigomha commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

InfrastructureSystems 2a2494ec (IS4, 2026-09-01) moved the unit-system base arithmetic out of convert_cost_coefficient: it now takes a bare x-axis ratio, and the package that owns the base powers derives it. IOM still called the removed five-argument form, so every cost path on the IS4 head failed with MethodError: no method matching convert_cost_coefficient(::Float64, ::NaturalUnit, ::SystemBaseUnit, ...) (64 of the errors in PowerOperationsModels #300's CI, and main's own red CI).

_system_base_ratio(unit_system, system_base_power, device_base_power) derives the ratio to the system base the way IS used to (SU 1, CU sb / db, NU sb), and the four helpers in component_utils.jl pass it through. test_cost_unit_conversion.jl pins the three ratios for the proportional, quadratic, point-curve and step-curve helpers.

The test environment also could not resolve, on CI and locally: Coverage.jl caps HTTP at 1.x while the OpenAPI.jl 1.x packages need 2.x, which is what has kept main's CI red since the IS4 pin moved. CI collects coverage through julia-processcoverage and never loaded the package, so Coverage and CoverageTools leave test/Project.toml; the local lcov script runs from scripts/coverage, its own environment.

The analyze check (the performance comparison) instantiates main's test environment before this branch's, so it keeps failing on the same Coverage conflict until this merges. Locally, on the IS4 head: 1,453 tests pass plus Aqua. PowerOperationsModels #301 pins this branch until it merges.

🤖 Generated with Claude Code

InfrastructureSystems 2a2494ec moved the unit-system base arithmetic out of
convert_cost_coefficient, which now takes a bare x-axis ratio, so every cost path failed
on the IS4 head with a MethodError. _system_base_ratio derives the ratio the way IS used
to (SU 1, CU sb/db, NU sb) and the four per-system-unit helpers pass it through; a unit
test pins the three ratios for each helper.
Coverage.jl caps HTTP at 1.x and the OpenAPI.jl 1.x packages need HTTP 2.x, so the test
environment has not resolved since the IS4 pin moved, on CI and locally. CI collects
coverage through julia-processcoverage and never loaded the package; the local lcov
script now runs from scripts/coverage, its own environment.
@codecov

codecov Bot commented Sep 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.33333% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/utils/component_utils.jl 83.33% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@rodrigomha
rodrigomha requested review from jd-lara and luke-kiernan and removed request for jd-lara September 14, 2026 20:50
@jd-lara
jd-lara merged commit b3bfad7 into main Sep 14, 2026
7 of 8 checks passed
@jd-lara
jd-lara deleted the rh/cost_coefficient_ratio branch September 14, 2026 20:53
rodrigomha added a commit that referenced this pull request Sep 14, 2026
Brings IOM #166: cost conversions derive their ratio to the system base (IS 2a2494ec
changed convert_cost_coefficient), and the coverage tooling leaves the test environment.
rodrigomha added a commit that referenced this pull request Sep 14, 2026
Brings #164 (the share_template_references! hook), #165 (the ComponentBaseUnit rename) and
#166 (cost conversions derive their ratio to the system base; the coverage tooling leaves
the test environment).
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