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

Make LevelDemand min_level and max_level optional #1430

Merged
merged 3 commits into from
Apr 29, 2024
Merged

Make LevelDemand min_level and max_level optional #1430

merged 3 commits into from
Apr 29, 2024

Conversation

visr
Copy link
Member

@visr visr commented Apr 25, 2024

As proposed in #1428 (comment)

This makes it easier to use LevelDemand in case you only care about a shortage or surplus situation.

@@ -93,7 +93,7 @@ function parse_static_and_time(

errors = false
t_end = seconds_since(config.endtime, config.starttime)
trivial_timespan = [nextfloat(-Inf), prevfloat(Inf)]
trivial_timespan = [0.0, prevfloat(Inf)]
Copy link
Member Author

Choose a reason for hiding this comment

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

Without this change we would get a NaN instead of Inf from DataInterpolations.

core/src/util.jl Outdated
Copy link
Member Author

Choose a reason for hiding this comment

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

Returning a storage of 0 for levels below the bottom seems fine to me, and is needed to support -Inf min_level.

Copy link
Collaborator

@SouthEndMusic SouthEndMusic left a comment

Choose a reason for hiding this comment

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

Good good

docs/core/usage.qmd Outdated Show resolved Hide resolved
Co-authored-by: Bart de Koning <[email protected]>
@visr visr merged commit 1112dbd into main Apr 29, 2024
20 of 21 checks passed
@visr visr deleted the minmaxlevel branch April 29, 2024 10:45
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