Skip to content

Show each scenario's vulnerability functions - #59

Merged
benhayes21 merged 1 commit into
fix/workflow-bugsfrom
feature/vulnerability-info
Nov 6, 2026
Merged

benhayes21 merged 1 commit into
fix/workflow-bugsfrom
feature/vulnerability-info

Conversation

@benhayes21

@benhayes21 benhayes21 commented Nov 6, 2026 •

Copy link
Copy Markdown

Summary

Shows which vulnerability functions each scenario uses. Addresses #27.

The information lives with the scenario data: each model's settings describes its functions in data_settings.vulnerability (source, description, optional url), added in OasisLMF/Scenarios#9. The app only presents it.

Targets fix/workflow-bugs (#55).

Changes

  • Run a scenario: a "Vulnerability" line (source, linked where there's a URL, plus its description) in the chosen scenario's details
  • Showcase: the same, under the scenario description
  • Compare: the same for each run, and a note that losses depend on the vulnerability functions as well as the hazard, so runs of different scenarios may not be directly comparable
  • Guide: a Vulnerability functions section explaining what they are, listing which scenarios use which functions (built from the model settings), and how to run a scenario with different functions outside the tool (Scenarios repo, VulnerabilityLibrary, Oasis MDK)
  • Scenarios that don't describe their functions show "not documented"
  • modules.scenarios.vulnerability_info() reads the block; the scenario catalogue includes it

#27 coverage

  • Documentation in the user guide, including how vulnerability can be changed (outside the tool): done
  • Vulnerability shown on scenario selection: done
  • Vulnerability shown on Compare: done
  • Selecting different curves in the tool: not covered. It would need alternative function sets in the scenario data (model_settings.vulnerability_set)

Testing

  • pytest: 143 passed (new: vulnerability_info, chosen scenario and Showcase show it, undocumented case, Guide list); ruff and autopep8 clean
  • Local scenarios stack with the Scenarios branch: all 14 models register their vulnerability information; Run, Showcase, Compare and Guide checked in the browser

🤖 Generated with Claude Code

Scenarios describe their vulnerability functions in their model settings
(data_settings.vulnerability). Show them:

- Run a scenario: in the chosen scenario's details
- Showcase: under the scenario description
- Compare: for each run, with a note that losses depend on the vulnerability
  functions as well as the hazard
- Guide: what vulnerability functions are, which each scenario uses (from
  the model settings), and how to run a scenario with different ones

Scenarios that don't describe them say so. Addresses #27.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant