Skip to content

Commit e8772a1

Browse files
committed
correct exposures with total zero value
1 parent e400d9d commit e8772a1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

climada/entity/exposures/black_marble.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,4 +506,7 @@ def _set_econ_indicators(exp, gdp, inc_grp):
506506
inc_grp (float): index to weight exposures in the region
507507
"""
508508
exp.value = np.power(exp.value, 3)
509-
exp.value = exp.value/exp.value.sum()* gdp * (inc_grp+1)
509+
if exp.value.sum() > 0:
510+
exp.value = exp.value/exp.value.sum()* gdp * (inc_grp+1)
511+
else:
512+
exp.value = 0.0

0 commit comments

Comments
 (0)