Implement quantiles and median for hazard and impact forecasts#1191
Merged
peanutfun merged 44 commits intoforecast-classfrom Dec 10, 2025
Merged
Implement quantiles and median for hazard and impact forecasts#1191peanutfun merged 44 commits intoforecast-classfrom
peanutfun merged 44 commits intoforecast-classfrom
Conversation
…saving impact matrix
…/CLIMADA-project/climada_python into impactCalc_return_impactForecast
…/CLIMADA-project/climada_python into impactCalc_return_impactForecast
85b92ef to
302be63
Compare
chahank
reviewed
Dec 10, 2025
|
|
||
| def mean(self): | ||
| """ | ||
| Reduce the impact matrix and at_event of an ImpactForecast to the mean value. |
Member
There was a problem hiding this comment.
If I understand correctly, you want to reduce only along the event axis (0). So this is not a single mean value. But a mean value per exposure point.
chahank
reviewed
Dec 10, 2025
|
|
||
| def _reduce_attrs(self, event_name: str): | ||
| """ | ||
| Reduce the attributes of an ImpactForecast to a single value. |
Member
There was a problem hiding this comment.
If I understand correctly, you want to reduce only along the event axis (0). So this is not a single mean value. But a reduced value per exposure point. The docstring could be clearer.
chahank
reviewed
Dec 10, 2025
Comment on lines
197
to
198
| Reduce the intensity and fraction of a HazardForecast to the minimum | ||
| value. |
Member
There was a problem hiding this comment.
Here also the docstring are misleading imho.
Suggested change
| Reduce the intensity and fraction of a HazardForecast to the minimum | |
| value. | |
| Reduce the intensity and fraction of a HazardForecast to the minimum | |
| over all events value per centroid. |
chahank
reviewed
Dec 10, 2025
| Returns | ||
| ------- | ||
| HazardForecast | ||
| A HazardForecast object with the min intensity and fraction. |
Member
There was a problem hiding this comment.
Suggested change
| A HazardForecast object with the min intensity and fraction. | |
| A HazardForecast object with the min intensity and fraction per centroid. |
chahank
reviewed
Dec 10, 2025
|
|
||
| def median(self): | ||
| """ | ||
| Reduce the impact matrix and at_event of a HazardForecast to the median value. |
Member
There was a problem hiding this comment.
Suggested change
| Reduce the impact matrix and at_event of a HazardForecast to the median value. | |
| Reduce the impact matrix and at_event of a HazardForecast to the median value over all events. |
Member
|
@chahank We'll have to rework all docstrings before merging into |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes proposed in this PR:
This PR fixes #1162
PR Author Checklist
develop)PR Reviewer Checklist