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

Unclear warning in ImpactFunc.check() #228

Closed
bguillod opened this issue May 4, 2021 · 3 comments
Closed

Unclear warning in ImpactFunc.check() #228

bguillod opened this issue May 4, 2021 · 3 comments
Labels

Comments

@bguillod
Copy link
Collaborator

bguillod commented May 4, 2021

If I define an impact function with mdd or paa different from 0 at intensity 0, I get the following warnings from ImpactFunc.check():

climada.entity.impact_funcs.base - WARNING - For intensity = 0, mdd != 0 or paa != 0. Consider shifting the origin of the intensity scale. In impact.calc the impact is always null at intensity = 0.

To me this suggests that even if both mdd and paa are not 0 for intensity==0, impact.calc will return null to me. However, looking at the code, I do not see this condition applied anywhere. Am I overseeing something here?

Note that in my case, paa is set to 1 for all intensities, but mdd is actually 0 for intensity==0, so I actually expect 0 impact from intensity==0. However, this warning made me doubt whether I correctly understand the impact calculation for that case.

@ThomasRoosli
Copy link
Collaborator

My understanding is that this condition follows from the implementation of hazard.intensity as a sparse matrix.
In this line the impact function is only applied to nonzero elements. Meaning if mdd and paa would both be non-zero at intensity==0, this would not be recognized in the implementation as the calculation is never initiated for all elements where hazard.intensity==0.
That is why Sam and I introduced this warning at one point.

@bguillod
Copy link
Collaborator Author

bguillod commented May 5, 2021

Ok, that makes sense. However, why raise this warning if only one of mdd or paa is non-zero? This is only an issue if both are non-0, right?

@emanuel-schmid
Copy link
Collaborator

fixed with PR #436

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants