Skip to content

Support predetermined builds after period start #137

Open
@staadecker

Description

@staadecker

Hello there!

I'm opening this issue so that we don't forget about something we recently discovered in the Switch code. We don't have time to fix it right now, however I'd like to keep track of it.

Currently if we have a period named 2020 and we have generation being pre-built in the year 2020, the following code behaves unexpectedly.

def gen_build_can_operate_in_period(m, g, build_year, period):
if build_year in m.PERIODS:
online = m.period_start[build_year]
else:
online = build_year

When this function is called for generation being pre-built in the year 2020, build_year in m.PERIODS is true despite the project not being a period build. This means the project will retire sooner than normal (i.e. generation pre-built in 2020 will retire before generation pre-built in 2019).

I don't think there's an easy fix to the problem as currently gen_build_costs.csv doesn't differentiate between pre-built generation and investment builds so there's no way to differentiate between the two. The best course of action is likely to display a warning/error if pre-build years conflict with a period label.

I wonder if the switch code wasn't designed to have pre-build years after a period starts.

Thank you!

Martin

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions