Skip to content

Improvement of PeriodDemandSink#12

Merged
JulStraus merged 15 commits into
mainfrom
enhance/PeriodDemandSink
Jun 29, 2026
Merged

Improvement of PeriodDemandSink#12
JulStraus merged 15 commits into
mainfrom
enhance/PeriodDemandSink

Conversation

@JulStraus

Copy link
Copy Markdown
Member

The existing version of PeriodDemandSink was not really flexible with respect to the chosen time structure and potentially error prone with respect to the chosen durations. As a consequence, its application required carefulness regarding the parameter choices.

TimeStruct v0.9.12 introduced partitions of periods which allowed to simplify the overall structure. This PR adapts now the PeriodDemandSink to the new format.

Important

This PR is breaking as we change the fields of PeriodDemandSink. I still decided not to increase the version number yet as these updates will also be included for CapacityCostLink. In addition, a new subtyoe of AbstractPeriodDemandSink will be included.

@Zetison Zetison left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I suggest to bump the version to 0.4.0 already in this PR to showcase that the breaking change is present here (and rather instead skip it in the next PR).

Ideally, this issue should be resolved before a merge of this PR. This would also enable simpler rereview of this PR.

The change from period_length to period_duration should be more consistently updated in docstrings and comments.

In general, I strongly suggest to use Copilot review to do the coarse review (it picks up on most of these issues). Note that this can be done locally in VS Code.

Comment thread test/sink/test_PeriodDemandSink.jl
Comment thread src/sink/checks.jl Outdated
Comment thread src/sink/checks.jl Outdated
Comment thread src/sink/checks.jl
Comment thread src/sink/datastructures.jl Outdated
Comment thread src/sink/datastructures.jl
Comment thread docs/src/nodes/sink/perioddemand.md Outdated
Comment thread docs/src/nodes/sink/perioddemand.md Outdated
Comment thread NEWS.md Outdated
Comment thread NEWS.md Outdated

@JulStraus JulStraus left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I included all comments with the following exception:

  • Based on the approaches used so far in EMX, I do not bump the version number directly to a breaking change. This can lead to an error with respect to a registration before everything is included in main. later bugfixes for version 0.3. will anyhow checkout from the tag.

I added in addition a legacy constructor for the original approach.

Comment thread src/sink/checks.jl
Comment thread src/sink/checks.jl Outdated
Comment thread src/sink/datastructures.jl
Comment thread test/sink/test_PeriodDemandSink.jl
Comment thread NEWS.md Outdated
Comment thread test/sink/test_PeriodDemandSink.jl
@JulStraus JulStraus requested a review from Zetison June 28, 2026 13:26

@Zetison Zetison left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It looks good enough to be merged.

Comment thread src/sink/checks.jl
Comment thread src/sink/datastructures.jl
@JulStraus JulStraus merged commit 54145a7 into main Jun 29, 2026
5 checks passed
JulStraus referenced this pull request Jul 6, 2026
* New sink based on `PeriodDemandSink`
* Demand now specified per strategic period
* Individual penalties for demand periods
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants