You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here we collect small non critical issues to be addressed for the new forecast classes.
Add coment in the forecast base class to explain how the inheritance of the ImpactForecast and HazardForecast classes work on the level of the super.
Add check of array size in the inits of ImpactForecast and HazardForecast to make sure data is coherent.
Check that the frequency of the events is equal to 1/#ensemble memebers in the HazardForecast Class.
The init of the ImpactForecast class should set the eai_exp to an empty array of length equal to coord_exp and aai_agg to a non-definit value. This is in addition to having a property for these attributes that would return the correct values, namely the eai_exp and the aai_agg for each lead time.
hmmm but then this means that the ImpactForecast object at initialization is not consistent right?
Same behavior as Impact base class. We could, however, remove the two parameters from the ImpactForecast initialization and set them inside the class. This might be a more elegant solution for ImpactCalc, but it might have some unexpected consequences. ImpactForecast.from_impact(imp) would then ignore the two attributes from imp and not copy them into the new object.
This is not generally enforced by the class, but from_xarray_raster currently sets it so.
Consistency between values of the different hazard/exposure/impact attributes is never enforced anywhere in CLIMADA. HazardForecast currently checks if member and lead_time have the right size, the base class does not even check that (during init).
Activity
peanutfun commentedon Jan 12, 2026
This is not generally enforced by the class, but
from_xarray_rastercurrently sets it so.peanutfun commentedon Jan 12, 2026
The init of ImpactForecast does not implement that, but ImpactCalc does when computing the impact from a HazardForecast.
peanutfun commentedon Jun 10, 2026
@chahank Does this resolve the issues you raised? Could you add the requested comment to the base classes?
[-]Collect small issues for forecast classes[/-][+]Minor issues with forecast classes[/+]chahank commentedon Jun 11, 2026
hmmm but then this means that the ImpactForecast object at initialization is not consistent right?
chahank commentedon Jun 11, 2026
Any reason for this? This is a potential (in)consistency trap imho.
peanutfun commentedon Jun 11, 2026
Same behavior as Impact base class. We could, however, remove the two parameters from the ImpactForecast initialization and set them inside the class. This might be a more elegant solution for
ImpactCalc, but it might have some unexpected consequences.ImpactForecast.from_impact(imp)would then ignore the two attributes fromimpand not copy them into the new object.Consistency between values of the different hazard/exposure/impact attributes is never enforced anywhere in CLIMADA. HazardForecast currently checks if
memberandlead_timehave the right size, the base class does not even check that (during init).