Skip to content

Choose between vulnerability functions in the Scenarios app #60

Open

Description

@benhayes21

Summary

Let users choose between alternative vulnerability functions for a scenario in the Scenarios app, so they can see how sensitive the losses are to vulnerability. This is the remaining part of #27; the rest was done in #59 (vulnerability information on the Run, Showcase, Compare and Guide pages).

What it needs

Scenario data (OasisLMF/Scenarios). Each scenario that offers a choice needs alternative function sets, declared with the model settings schema's model_settings.vulnerability_set:

"vulnerability_set": {
  "name": "Vulnerability functions",
  "desc": "...",
  "default": "jrc",
  "options": [
    {"id": "jrc", "desc": "JRC global flood depth-damage functions", "tooltip": "..."},
    {"id": "alt", "desc": "...", "tooltip": "..."}
  ]
}

The option id is a file suffix: oasislmf runs vulnerability_<id>.bin (or .csv / .parquet) when an analysis sets model_settings.vulnerability_set, so the files need renaming. The lookup's vulnerability ids must also exist in every set. The data_settings.vulnerability description (OasisLMF/Scenarios#9) could then move to, or be repeated in, each option's desc / tooltip.

Candidate alternatives come from the Oasis VulnerabilityLibrary (JRC, GEM, Emanuel), for example GEM functions for the earthquake scenarios. Each pairing needs the intensity measures and units to match the footprint (see OasisLMF/VulnerabilityLibrary#16 for a units problem).

App.

  • Run a scenario: offer a choice (default, plus alternatives) when the model settings list more than one vulnerability_set option. Write it to the run's model_settings.vulnerability_set, and show the chosen set in the run summary.
  • Compare: label runs with their vulnerability set, so the same scenario run with two sets can be compared side by side.
  • Showcase: possibly a run per set for scenarios that offer a choice.

Questions

  • Which scenarios should offer alternatives, and from which sources?
  • Licensing of each alternative function set.

🤖 Generated with Claude Code

Activity

  1. added
    enhancement
    on Nov 6, 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

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions