Skip to content

Remove CAV5 in favour of quantile indexed xarray #240

Open

Description

@lispandfound

CAV is an intensity measure with a parameter. Currently, that parameter is implicit in the name of the intensity measure, but much like this repo doesn't keep the pSA_1.0s nomenclature of old iterations, it is better if CAV gained a new dimension for the threshold.

Tasks:

  1. Remove the CAV5 IM from the enum,
  2. Introduce CAV with thresholds as an array, return a dataarray with coordinates on threshold,
  3. Patch the original CAV5 and CAV functionality simple wrappers over the generic implementation + squeeze the threshold into an attribute.

This will require a follow-up PR on workflow to incorporate the change.

Activity

  1. ucgmsim commented on Oct 3, 2026

    @ucgmsim
    Contributor

    The scheduled fix job gave up on this issue:

    Skipping issue #240: this is a feature/refactor request, not a bug fix.

    The issue ("Remove CAV5 in favour of quantile indexed xarray") explicitly
    asks for a design change to the CAV intensity measure API:

    1. Remove the CAV5 entry from the IM enum.
    2. Change cumulative_absolute_velocity to accept an array of thresholds
      and return a result with a new threshold dimension/coordinate (like
      pseudo_spectral_acceleration does for period).
    3. Reimplement the current scalar-threshold CAV/CAV5 behaviour as thin
      wrappers over the new array-threshold implementation, squeezing the
      threshold dimension into an attribute.

    There is no described defect, incorrect output, or failing behaviour in the
    current CAV/CAV5 code — _cav_kernel/cumulative_absolute_velocity in
    IM/ims.py compute CAV and thresholded CAV5 correctly, and the existing tests
    (tests/test_ims.py::test_cav5, test_cav_name_depends_on_threshold) pass and
    describe the intended, correct output. The issue itself says "This will
    require a follow-up PR on workflow to incorporate the change," confirming
    it is a deliberate multi-PR API/data-model change rather than a bug report.

    Per the task instructions, this falls under "the issue asks for anything
    other than a bug fix," so no code changes were made. A reviewer who wants
    this feature should scope it as a planned refactor (enum change + public
    API/return-shape change across IM/ims.py, IM/im_calculation.py,
    IM/scripts/calculate_ims.py, and the dependent workflow repo), not a
    regression-test-driven bug fix.

    Remove ai-stuck and re-add ai-ok to retry.

  2. added
    ai-stuckThe bot tried and gave up; see its comment
    and removed
    ai-okVetted: the bot may attempt a fix
    on Oct 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ai-stuckThe bot tried and gave up; see its commentenhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions