Reputation: 1
I'm trying to get an Impact Matrix in Climada from an impact object using the below codes:
Calculating impact matrix for present
from climada.engine import Impact
imp1 = Impact()
imp1.calc(exp, imp_set_xlsx, ts_fl, save_mat=True)
When I tried to print the impact matrix << print( imp1.mat)) >>, I received the following error:
ValueError: Attribute imp_mat is empty. Recalculate Impactinstance with parameter save_mat=True.
However, I made sure save_mat
is set True.
Upvotes: -3
Views: 69
Reputation: 125
In CLIMADA the impact matrix is accessed as imp1.imp_mat
(c.f. the documentation https://climada-python.readthedocs.io/en/stable/tutorial/climada_engine_Impact.html )
Please note also that with the latest release 3.3 the impact computation has been modified. Now, there are two classes, ImpactCalc
and Impact
.
Your code would then read
from climada.engine import Impact, ImpactCalc
impcalc = ImpactCalc(exp, imp_set_xlsx, ts_fl)
imp1 = impcacl.impact(save_mat=True)
print(imp1.imp_mat))
Upvotes: 0