Skip to content

Minor issues with forecast classes #1169

Open

Description

@chahank

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.

Activity

  1. added theissue type on Dec 8, 2025
  2. peanutfun commented on Jan 12, 2026

    @peanutfun
    Member

    Check that the frequency of the events is equal to 1/#ensemble memebers in the HazardForecast Class.

    This is not generally enforced by the class, but from_xarray_raster currently sets it so.

  3. peanutfun commented on Jan 12, 2026

    @peanutfun
    Member

    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.

    The init of ImpactForecast does not implement that, but ImpactCalc does when computing the impact from a HazardForecast.

  4. peanutfun commented on Jun 10, 2026

    @peanutfun
    Member

    @chahank Does this resolve the issues you raised? Could you add the requested comment to the base classes?

  5. changed the title [-]Collect small issues for forecast classes[/-] [+]Minor issues with forecast classes[/+] on Jun 10, 2026
  6. chahank commented on Jun 11, 2026

    @chahank
    MemberAuthor

    The init of ImpactForecast does not implement that, but ImpactCalc does when computing the impact from a HazardForecast.

    hmmm but then this means that the ImpactForecast object at initialization is not consistent right?

  7. chahank commented on Jun 11, 2026

    @chahank
    MemberAuthor

    This is not generally enforced by the class, but from_xarray_raster currently sets it so.

    Any reason for this? This is a potential (in)consistency trap imho.

  8. peanutfun commented on Jun 11, 2026

    @peanutfun
    Member

    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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions