Skip to content

Commit 6fef573

Browse files
committed
fix: fix the startcost translation calculation
1 parent 6402a6e commit 6fef573

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

packages/r2x-reeds-to-plexos/src/r2x_reeds_to_plexos/getters.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,8 @@ def gen_startup_cost(component: ReEDSGenerator, context: PluginContext) -> Resul
674674
return Ok(float(startup_cost))
675675
technology = getattr(component, "technology", "")
676676
default_startup_cost = _get_defaults(technology, "start_cost_per_MW")
677-
return Ok(float(default_startup_cost))
677+
capacity = getattr(component, "capacity", 0.0)
678+
return Ok(float(default_startup_cost) * float(capacity))
678679

679680

680681
@getter

packages/r2x-reeds-to-plexos/tests/test_getters.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,14 @@ def test_basic_getters_return_values(tmp_path):
239239
)
240240

241241

242+
def test_gen_startup_cost_scales_default_per_mw_cost_by_capacity(tmp_path, monkeypatch):
243+
context = make_context(tmp_path)
244+
objs = setup_systems(context)
245+
monkeypatch.setattr(getters, "_get_defaults", lambda *_args, **_kwargs: 5.3)
246+
247+
assert getters.gen_startup_cost(objs["thermal"], context).unwrap() == 265.0
248+
249+
242250
def test_get_load_participation_factor(tmp_path):
243251
"""get_load_participation_factor always returns 1.0.
244252

0 commit comments

Comments
 (0)