Skip to content

Conversation

@rabinatwayana
Copy link
Contributor

Changes proposed in this PR:
Updates to the eca_san_salvador application within the script folder:

  • Replaced Salvador_hazard_FL_2015.mat and Salvador_hazard_FL_2040_extreme_cc.mat with their corresponding .hdf5 files.
  • Updated the "cover" column in FL_entity_Acelhuate_parametric.xlsx (i.e. changed values from 0 to 500)
  • Modified the adaptation, parametric, and risk notebooks to read hazards from .hdf5 files instead of .mat files
  • Switched the base map in plot_salvador_ma (inside functions_ss.py) from Stamen Terrain to OpenStreetMap Mapnik.

Supporting Resources:
File conversion from .mat to .hdf5 can be performed in two ways:
1. Manually (link)
2. Using an older version of CLIMADA (link)

This PR fixes #1085

PR Author Checklist

PR Reviewer Checklist

@chahank
Copy link
Member

chahank commented Aug 19, 2025

Thanks for the updating of the script @rabinatwayana !

Can you quickly explain why the cover in FL_entity_Acelhuate_parametric.xlsx needs to be changed?

@rabinatwayana
Copy link
Contributor Author

Regarding the cover changes in FL_entity_Acelhuate_parametric.xlsx,

The exceedance graph plot was showing only zeros, as shown in the figure below:
Screenshot 2025-08-19 at 12 50 08

I discussed with Christopher Faieless, and he suggested changing the value of the cover column from 0 to 500, and it works as expected.

@ChrisFairless
Copy link
Collaborator

Thanks a lot Rabina!

The context for this PR is that the team at UNU-EHS like to use the San Salvador case study for teaching, but the case study doesn't run on more recent versions of CLIMADA due to the issue that Rabina raises.

The issue to the Cover column was discovered during the fix, possibly CLIMADA changed how it treated zero-valued covers at some point. So this changes the Cover to be the value of the exposure (500 everywhere).

One other thing – the Jenkins pre-commit hook is failing here, and I can't interpret the error. Is it because something is wrong with black-jupyter hook, or is it because Jenkins can't commit its changes when the pull request comes from a fork?

@chahank
Copy link
Member

chahank commented Aug 20, 2025

I understand the point, thanks updating the manuscript.

Can you please show the issue with the cover? Does putting the cover to the value of the exposure give the same results as before?

Co-authored-by: Lukas Riedel <34276446+peanutfun@users.noreply.github.com>
@rabinatwayana
Copy link
Contributor Author

Hi Chahank,
I hope the following test will make it clear about the issue with the cover.

San_Salvador_Parametric_existing_in_develop_branch

San_Salvador_Parametric_result_with_existing_cover_value_with_0.ipynb

San_Salvador_Parametric_result_after_updateing_cover_value_to_500

Please let me know if it is fine or if you want to make any changes or do other tests.

@chahank
Copy link
Member

chahank commented Aug 21, 2025

Dear @rabinatwayana ,

Thank you for the notebooks, the results look the same with the full cover. It would be good to know why changing the cover to 500 gave the same result as previously. @ChrisFairless I think it is important for your future ECA studies that you understand this.

@chahank
Copy link
Member

chahank commented Aug 21, 2025

@ChrisFairless we are considering moving this script to climada petals. Would that be fine for you?

@ChrisFairless
Copy link
Collaborator

re: changing the cover
The existing Excel file, used for demonstrating parametric insurance, provides an update to the main San Salvador exposures. It sets the value of each asset to a constant 500 USD and the cover to zero (in the main notebook the cover was undefined). It describes this as writing property-level insurance up to the level of 500 USD for each property.

(That's not how I would have implemented it: I would have left the asset values unchanged and set the cover to 500, but whatever, this PR is to fix the bug, not to change the analysis.)

In the past this must have worked, and my assumption is that when the notebook was created, CLIMADA treated 0 cover and NA cover as equivalent. Running the code now, it treats zero cover as exactly that: uninsured. I'm not very interested in finding out when and where that change was made, because I think this is now the correct behaviour. But it means that the Excel file needs to be updated to preserve its intended behaviour of generating an EP curve when each property is insured with 500 USD. That means setting the value and the cover of each asset to 500 USD.

@ChrisFairless
Copy link
Collaborator

ChrisFairless commented Aug 21, 2025

Re: moving to CLIMADA Petals
Could we keep the analysis here for now? It's part of different UNU teaching materials. We like this because it (1) uses Excel inputs, (2) isn't TC, (3) is return-period based, and (4) is small data and at a community level.

Part of our upcoming work at UNU includes proposing and updating the Entity Excel file templates (and reworking Excel inputs in general) to align with the upcoming changes in the Measures and OptionsAppraisal modules. Once that happens the San Salvador notebook will either need to be retired, updated or replaced, so that would be a good time to discuss its future.

@chahank
Copy link
Member

chahank commented Aug 21, 2025

Thanks @ChrisFairless for all the clarifications! That is all good for me then.

Copy link
Member

@chahank chahank left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick update!

@chahank chahank merged commit 355f4da into CLIMADA-project:develop Aug 28, 2025
5 of 7 checks passed
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.

4 participants