-
Notifications
You must be signed in to change notification settings - Fork 124
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
Feature/change impact total value #702
Conversation
@peanutfun : an alternative could be to have two methods: one that just computes the total sum of the exposures in the vicinity of a hazard centroid (so as it is currently) and which is used in the impact computation. Another method that would only be for the exposures object and which does what the here proposed method does (compute the value of the exposures affected by a given value of intensity). |
I like the new thing much better, however, the computation overhead could be a problem. Is |
Good idea. Before doing so, it is probably to be discussed once with users from the insurance sector (which are at the origin of this feature). Thanks! |
Co-authored-by: Lukas Riedel <[email protected]>
Ok, my suggestion is the following: We keep the total value as it is currently implemented in the impact computation. We add a new method which does compute the total people subject to a given threshold. Thus, we do not slow down the impact computation and keep backwards compatibility, and give the possibility to users to obtain the more useful value of affected people directly from the hazard and exposures. Potentially we could also simply ditch completely the tot_value from the impact computation in order to simplify the code base. |
@chahank I approve!
When? Do you want to create an issue or deprecate the value immediately? With the latter approach, I think we are more likely to get some feedback on that decision 😉 |
I would go for the more direct approach -> deprecate. |
* Replace attribute with getter/setter and declare private attribute. * Adjust writers accordningly
CHANGELOG.md
Outdated
@@ -30,13 +30,16 @@ Removed: | |||
- Added test for non-default impact function id in the `lines_polys_handler` [#676](https://github.com/CLIMADA-project/climada_python/pull/676) | |||
- The sigmoid and step impact functions now require the user to define the hazard type. [#675](https://github.com/CLIMADA-project/climada_python/pull/675) | |||
- Improved error messages produced by `ImpactCalc.impact()` in case hazard type is not found in exposures/impf_set [#691](https://github.com/CLIMADA-project/climada_python/pull/691) | |||
- `Exposures.affected_total_value` now takes a hazard intensity threshold as argument. [#702](https://github.com/CLIMADA-project/climada_python/pull/702) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- `Exposures.affected_total_value` now takes a hazard intensity threshold as argument. [#702](https://github.com/CLIMADA-project/climada_python/pull/702) | |
- `Exposures.affected_total_value` now takes a hazard intensity threshold as argument. [#702](https://github.com/CLIMADA-project/climada_python/pull/702) | |
- Bugfix for the `Hazard.select` method: any iterable are now accepted for `event_id` and `event_names` [#719](https://github.com/CLIMADA-project/climada_python/pull/719) |
I sneaked-in the missing changelog entry from the pull request #719. Hope this is fine for you @peanutfun |
# Conflicts: # CHANGELOG.md
@peanutfun ready to merge? |
I personally much prefer using a separate PR for that, but let's not overcomplicate things. You'll have to add this yourself, I cannot commit your suggestion because it is outdated.
Yes! |
Changes proposed in this PR:
This PR would make the impact computation slower by roughly 10%. Do we want that?
The code can be made prettier.
This PR fixes #
PR Author Checklist
develop
)PR Reviewer Checklist