Skip to content

Commit 0d26325

Browse files
wesleyboarnbonfantesebabedin
authored
Adding a new use case - fix syntax issues (#255)
## What Did You Change? 1. [fix: use local "Open in DesignSafe" image](da0864b) 2. [fix: use 4 spaces (or tab char) for indentation](5129fe5) 3. [fix: use new lines around nested lists](993275c) 4. [fix: nest list item content correctly](b5a7386) 5. [fix: clarify two paragraphs, not just a new line](7622f4e) 6. [chore: consistent formatting for \*\*Output/s:\*\*](46d59d3) 7. [chore: remove superfluous spaces](8a83d11) 8. [feat: add to navigation](2f5e29b) ## Do You Want Support (syntax, design, etc)? I present to @nbonfante, to guide future contributions. Preview: [deploy-preview-255--ds-user-guide.netlify.app](https://deploy-preview-255--ds-user-guide.netlify.app/) | Before | After | | - | - | | <img width="900" height="470" alt="2 before" src="https://github.com/user-attachments/assets/3b49527a-3505-4aa4-8fae-73f2fcefb3c4" /> | <img width="900" height="470" alt="2 after" src="https://github.com/user-attachments/assets/8ff45727-e6e4-4163-8a28-407888641aa7" /> | | <img width="900" height="470" alt="3 before" src="https://github.com/user-attachments/assets/8f277302-208f-4455-b1eb-006086f4d9dd" /> | <img width="900" height="470" alt="3 after" src="https://github.com/user-attachments/assets/d670d0f4-1e31-4df5-a2cf-6f52a8c2de3f" /> | | <img width="900" height="470" alt="4 before" src="https://github.com/user-attachments/assets/ef9651a2-2604-477e-9b38-460982e8c61d" /> | <img width="900" height="470" alt="4 after" src="https://github.com/user-attachments/assets/c5e7b4e9-681a-472b-a47d-68c074f801cf" /> | | <img width="900" height="470" alt="5 before" src="https://github.com/user-attachments/assets/9d54dcdf-1b08-4672-819e-eb1af6f8a666" /> | <img width="900" height="470" alt="5 after" src="https://github.com/user-attachments/assets/6f4fe96b-102b-4c11-baee-1cd9145b14c3" /> | | <img width="900" height="470" alt="6 before" src="https://github.com/user-attachments/assets/2d9bce7b-c5c8-4320-a450-a74dae8ddae9" /> | <img width="900" height="470" alt="6 after" src="https://github.com/user-attachments/assets/62c9c69c-c6bd-4624-b635-62e6dfd162e4" /> | | <img width="900" height="470" alt="7 before" src="https://github.com/user-attachments/assets/9cf2c964-c571-4c24-b0eb-790a0b2d42a2" /> | <img width="900" height="470" alt="7 after" src="https://github.com/user-attachments/assets/0d09d1d7-eaba-413a-886c-29990a3f5b3f" /> | | <img width="900" height="470" alt="8 before" src="https://github.com/user-attachments/assets/8d3d271c-61f0-40e6-82e9-28bf0058fd79" /> | <img width="900" height="470" alt="8 after" src="https://github.com/user-attachments/assets/1040afc6-d3bc-4cf1-a0dc-1e09fdf076c3" /> | ## Any Reference Material Worth Sharing? Fixes issues found in #251 / #252. --------- Co-authored-by: nbonfante <nbonfante2023@my.fit.edu> Co-authored-by: Seb <sebabedin@gmail.com>
1 parent a0ccd70 commit 0d26325

File tree

2 files changed

+82
-69
lines changed

2 files changed

+82
-69
lines changed

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ nav:
160160
- Field Sensing Wind Events: usecases/pinelli/usecase.md
161161
- Hurricane Data Integration Visualization: usecases/pinelli/2usecase.md
162162
- Wind Speed Estimation and Conversion: usecases/pinelli/3usecase.md
163+
- Empirical Hurricane Vulnerability and Fragility Curves: usecases/pinelli/4usecase.md
163164
- ADCIRC Datasets: usecases/dawson/usecase2.md
164165
- Large-Scale Storm Surge: usecases/dawson/usecase.md
165166
- CFD Analysis of Winds on Structures: usecases/kareem/usecase.md

user-guide/usecases/pinelli/4usecase.md

Lines changed: 81 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ The uniqueness of this project lies in its transparency, flexibility, and modula
1717

1818
The primary audience for this project includes researchers in wind engineering, structural safety, and risk analysis who require transparent methods for vulnerability modeling. It is also intended for insurance and reinsurance professionals seeking empirically derived curves for underwriting, pricing, and capital allocation. Policy makers and engineers can use the results to support evidence-based decision making and improvements in building codes. Finally, educators and students can adopt the notebooks as teaching material for courses on catastrophe modeling, vulnerability analysis, and disaster risk reduction.
1919

20-
**Key steps:**
20+
**Key steps:**
2121

2222
- **Data Processing:** Cleaning raw datasets and producing an integrated hazard–damage file.
2323
- **Damage Ratio Calculation:** Computing losses relative to replacement value and assigning wind-speed bins.
@@ -35,62 +35,64 @@ You can access and run them directly on **DesignSafe** by clicking the link belo
3535

3636
| **Scope** | **Notebook** | **Open in DesignSafe** |
3737
|-----------|--------------|-------------------------|
38-
| Generate processed hazard & exposure dataset | `00_generator_of_processed_Info_Natural_Event.ipynb` | [![Open in DesignSafe](https://raw.githubusercontent.com/geoelements/LearnMPM/main/DesignSafe-Badge.svg)](https://www.designsafe-ci.org/data/browser/public/designsafe.storage.published/PRJ-6138?version=2) |
39-
| Compute damage ratios and define wind ranges | `03_damage_ratios_&_ranges.ipynb` | [![Open in DesignSafe](https://raw.githubusercontent.com/geoelements/LearnMPM/main/DesignSafe-Badge.svg)](https://www.designsafe-ci.org/data/browser/public/designsafe.storage.published/PRJ-6138?version=2) |
40-
| Build empirical vulnerability matrix | `05_vulnerability_matrix.ipynb` | [![Open in DesignSafe](https://raw.githubusercontent.com/geoelements/LearnMPM/main/DesignSafe-Badge.svg)](https://www.designsafe-ci.org/data/browser/public/designsafe.storage.published/PRJ-6138?version=2) |
41-
| Fit and visualize vulnerability curves | `08_vulnerability_curve_analysis.ipynb` | [![Open in DesignSafe](https://raw.githubusercontent.com/geoelements/LearnMPM/main/DesignSafe-Badge.svg)](https://www.designsafe-ci.org/data/browser/public/designsafe.storage.published/PRJ-6138?version=2) |
42-
| Generate fragility curves | `13_Fragility_curve_analysis.ipynb` | [![Open in DesignSafe](https://raw.githubusercontent.com/geoelements/LearnMPM/main/DesignSafe-Badge.svg)](https://www.designsafe-ci.org/data/browser/public/designsafe.storage.published/PRJ-6138?version=2) |
43-
| Compare curves across structural classes | `18_Comparison_of_curves_analysis.ipynb` | [![Open in DesignSafe](https://raw.githubusercontent.com/geoelements/LearnMPM/main/DesignSafe-Badge.svg)](https://www.designsafe-ci.org/data/browser/public/designsafe.storage.published/PRJ-6138?version=2) |
38+
| Generate processed hazard & exposure dataset | `00_generator_of_processed_Info_Natural_Event.ipynb` | [![Open in DesignSafe](/user-guide/img/Open-in-DesignSafe.svg)](https://www.designsafe-ci.org/data/browser/public/designsafe.storage.published/PRJ-6138?version=2) |
39+
| Compute damage ratios and define wind ranges | `03_damage_ratios_&_ranges.ipynb` | [![Open in DesignSafe](/user-guide/img/Open-in-DesignSafe.svg)](https://www.designsafe-ci.org/data/browser/public/designsafe.storage.published/PRJ-6138?version=2) |
40+
| Build empirical vulnerability matrix | `05_vulnerability_matrix.ipynb` | [![Open in DesignSafe](/user-guide/img/Open-in-DesignSafe.svg)](https://www.designsafe-ci.org/data/browser/public/designsafe.storage.published/PRJ-6138?version=2) |
41+
| Fit and visualize vulnerability curves | `08_vulnerability_curve_analysis.ipynb` | [![Open in DesignSafe](/user-guide/img/Open-in-DesignSafe.svg)](https://www.designsafe-ci.org/data/browser/public/designsafe.storage.published/PRJ-6138?version=2) |
42+
| Generate fragility curves | `13_Fragility_curve_analysis.ipynb` | [![Open in DesignSafe](/user-guide/img/Open-in-DesignSafe.svg)](https://www.designsafe-ci.org/data/browser/public/designsafe.storage.published/PRJ-6138?version=2) |
43+
| Compare curves across structural classes | `18_Comparison_of_curves_analysis.ipynb` | [![Open in DesignSafe](/user-guide/img/Open-in-DesignSafe.svg)](https://www.designsafe-ci.org/data/browser/public/designsafe.storage.published/PRJ-6138?version=2) |
4444

4545
### DesignSafe Resources
4646

4747
The following DesignSafe resources were used in developing this Use Case:
4848

49-
- [Jupyter notebook on DesignSafe JupyterHub](https://www.designsafe-ci.org/rw/workspace/jupyter/)
49+
- [Jupyter notebook on DesignSafe JupyterHub](https://www.designsafe-ci.org/rw/workspace/jupyter/)
5050
- [DesignSafe Publication: Empirical Hurricane Vulnerability and Fragility Curves (DOI: 10.17603/ds2-q60v-z247)](https://doi.org/10.17603/ds2-q60v-z247)
5151

5252
## System Requirements
5353

54-
- **Python 3.11+**
55-
- **Jupyter Notebook environment** (DesignSafe JupyterHub or local)
54+
- **Python 3.11+**
55+
- **Jupyter Notebook environment** (DesignSafe JupyterHub or local)
5656

5757
## Required Libraries
5858

5959
Before running the notebook, make sure the following Python libraries are installed:
6060

6161
| **Package** | **Description** |
6262
|-------------|-----------------|
63-
| `numpy` | Numerical operations and array handling |
64-
| `pandas` | Data manipulation and tabular data processing |
65-
| `scipy` | Curve fitting and optimization routines (`curve_fit`) |
66-
| `scikit-learn` | Regression metrics (R², MAE, RMSE) used for evaluating fitted curves |
67-
| `matplotlib` | Plotting vulnerability and fragility curves |
68-
| `seaborn` | Statistical visualization and enhanced plotting (used in damage ratio analysis) |
63+
| `numpy` | Numerical operations and array handling |
64+
| `pandas` | Data manipulation and tabular data processing |
65+
| `scipy` | Curve fitting and optimization routines (`curve_fit`) |
66+
| `scikit-learn` | Regression metrics (R², MAE, RMSE) used for evaluating fitted curves |
67+
| `matplotlib` | Plotting vulnerability and fragility curves |
68+
| `seaborn` | Statistical visualization and enhanced plotting (used in damage ratio analysis) |
6969

7070
## Steps to Run
7171

72-
1. **Download or access the repository:** [![Open in DesignSafe](https://raw.githubusercontent.com/geoelements/LearnMPM/main/DesignSafe-Badge.svg)](https://www.designsafe-ci.org/data/browser/public/designsafe.storage.published/PRJ-6138?version=2)
72+
1. **Download or access the repository:** [![Open in DesignSafe](/user-guide/img/Open-in-DesignSafe.svg)](https://www.designsafe-ci.org/data/browser/public/designsafe.storage.published/PRJ-6138?version=2)
7373

7474
2. **Open the Jupyter notebooks** located in the root directory:
75-
- `00_generator_of_processed_Info_Natural_Event.ipynb`
76-
- `03_damage_ratios_&_ranges.ipynb`
77-
- `05_vulnerability_matrix.ipynb`
78-
- `08_vulnerability_curve_analysis.ipynb`
79-
- `13_Fragility_curve_analysis.ipynb`
80-
- `18_Comparison_of_curves_analysis.ipynb`
75+
76+
- `00_generator_of_processed_Info_Natural_Event.ipynb`
77+
- `03_damage_ratios_&_ranges.ipynb`
78+
- `05_vulnerability_matrix.ipynb`
79+
- `08_vulnerability_curve_analysis.ipynb`
80+
- `13_Fragility_curve_analysis.ipynb`
81+
- `18_Comparison_of_curves_analysis.ipynb`
82+
8183
3. **Use the input CSV files already provided** inside the folder:
82-
```
83-
00_data_cleaned/
84-
```
84+
```
85+
00_data_cleaned/
86+
```
8587
4. **Execute the notebooks in sequence**, from `00_` to `18_`, ensuring that all cells run successfully.
8688
8789
5. **Processed outputs** will be automatically generated at each stage, including:
88-
- Combined and cleaned datasets
89-
- Damage ratios
90-
- Vulnerability matrices
91-
- Vulnerability curves (empirical and logistic regression)
92-
- Fragility curves
93-
- Comparative vulnerability/fragility plots
90+
- Combined and cleaned datasets
91+
- Damage ratios
92+
- Vulnerability matrices
93+
- Vulnerability curves (empirical and logistic regression)
94+
- Fragility curves
95+
- Comparative vulnerability/fragility plots
9496
9597
6. All output files are saved in the same directory as the notebooks, following the sequential numbering (00–22) generated throughout the workflow.
9698
@@ -102,63 +104,73 @@ The following guidance summarizes what each notebook does, what to expect, and h
102104
103105
1. **Generate the processed hazard–exposure dataset**
104106
105-
**Notebook:** `00_generator_of_processed_Info_Natural_Event.ipynb`
106-
This notebook loads the cleaned input files found in `00_data_cleaned/`, verifies their structure, and merges hazard data (wind speeds) with exposure and damage attributes.
107-
It produces the first standardized dataset used by all subsequent steps.
108-
**Outputs:** `01_checking_data.csv`, `02_combined_processed_files.csv`.
107+
**Notebook:** `00_generator_of_processed_Info_Natural_Event.ipynb`
108+
This notebook loads the cleaned input files found in `00_data_cleaned/`, verifies their structure, and merges hazard data (wind speeds) with exposure and damage attributes.
109+
It produces the first standardized dataset used by all subsequent steps.
109110
111+
**Outputs:**
112+
`01_checking_data.csv`,
113+
`02_combined_processed_files.csv`.
110114
111115
2. **Compute damage ratios and define wind-speed ranges**
112116
113-
**Notebook:** `03_damage_ratios_&_ranges.ipynb`
114-
This step calculates the *damage ratio* for each record (loss divided by replacement value) and assigns each row to a wind-speed bin.
115-
The notebook also produces exploratory visualizations to understand early behavior of the data.
116-
**Output:** `04_combined_processed_with_ratios.csv`.
117+
**Notebook:** `03_damage_ratios_&_ranges.ipynb`
118+
This step calculates the *damage ratio* for each record (loss divided by replacement value) and assigns each row to a wind-speed bin.
119+
The notebook also produces exploratory visualizations to understand early behavior of the data.
120+
121+
**Output:**
122+
`04_combined_processed_with_ratios.csv`.
117123
118124
3. **Build the empirical vulnerability matrix**
119125
120-
**Notebook:** `05_vulnerability_matrix.ipynb`
121-
This notebook aggregates thousands of records into an empirical vulnerability matrix, where each wind-speed bin is associated with an Expected Damage Ratio (EDR).
122-
It also generates a graphical summary of empirical EDR values.
123-
**Outputs:** `06_vulnerability_matrix.csv`, `07_vulnerability_matrix.png`.
126+
**Notebook:** `05_vulnerability_matrix.ipynb`
127+
This notebook aggregates thousands of records into an empirical vulnerability matrix, where each wind-speed bin is associated with an Expected Damage Ratio (EDR).
128+
It also generates a graphical summary of empirical EDR values.
129+
130+
**Outputs:**
131+
`06_vulnerability_matrix.csv`,
132+
`07_vulnerability_matrix.png`.
124133
125134
4. **Fit and visualize vulnerability curves**
126135
127-
**Notebook:** `08_vulnerability_curve_analysis.ipynb`
128-
This step transforms the empirical matrix into a smooth functional curve.
129-
Two representations are produced:
130-
- **Empirical curve** derived directly from observed data.
131-
- **Logistic-regression curve** that provides a smooth vulnerability function across all wind speeds.
136+
**Notebook:** `08_vulnerability_curve_analysis.ipynb`
137+
This step transforms the empirical matrix into a smooth functional curve.
138+
Two representations are produced:
132139
133-
Model performance is evaluated using R², RMSE, MAE, and visual comparison.
134-
**Outputs:** `09_vulnerability_data.csv`, `10_vulnerability_data.png`,
135-
`11_vulnerability_curve_with_logistic_regression.csv`,
136-
`12_vulnerability_curve_with_logistic_regression.png`.
140+
- **Empirical curve** derived directly from observed data.
141+
- **Logistic-regression curve** that provides a smooth vulnerability function across all wind speeds.
137142
143+
Model performance is evaluated using R², RMSE, MAE, and visual comparison.
138144
145+
**Outputs:**
146+
`09_vulnerability_data.csv`,
147+
`10_vulnerability_data.png`,
148+
`11_vulnerability_curve_with_logistic_regression.csv`,
149+
`12_vulnerability_curve_with_logistic_regression.png`.
139150
140151
5. **Generate fragility curves**
141152
142-
**Notebook:** `13_Fragility_curve_analysis.ipynb`
143-
This notebook converts vulnerability information into *fragility curves*, which express the probability that damage exceeds a specified threshold.
144-
These curves are useful for engineering applications, insurance analysis, and risk modeling.
145-
**Outputs:** `14_fragility_data.csv`, `15_fragility_data.png`,
146-
`16_fragility_curves_with_logistic_regression.csv`,
147-
`17_fragility_curves_with_logistic_regression.png`.
148-
153+
**Notebook:** `13_Fragility_curve_analysis.ipynb`
154+
This notebook converts vulnerability information into *fragility curves*, which express the probability that damage exceeds a specified threshold.
155+
These curves are useful for engineering applications, insurance analysis, and risk modeling.
149156
157+
**Outputs:**
158+
`14_fragility_data.csv`,
159+
`15_fragility_data.png`,
160+
`16_fragility_curves_with_logistic_regression.csv`,
161+
`17_fragility_curves_with_logistic_regression.png`.
150162
151163
6. **Compare vulnerability and fragility across classes**
152164
153-
**Notebook:** `18_Comparison_of_curves_analysis.ipynb`
154-
The final step allows side-by-side comparisons of vulnerability and fragility curves across construction classes, building types, or datasets.
155-
This notebook highlights differences in performance and produces publication-ready figures.
156-
**Outputs:**
157-
`19_comparison_vulnerability_curves.csv`,
158-
`20_comparison_vulnerability_curves.png`,
159-
`21_fragility_comparison_Fragility_10.csv`,
160-
`22_fragility_comparison_Fragility_10.png`.
165+
**Notebook:** `18_Comparison_of_curves_analysis.ipynb`
166+
The final step allows side-by-side comparisons of vulnerability and fragility curves across construction classes, building types, or datasets.
167+
This notebook highlights differences in performance and produces publication-ready figures.
161168
169+
**Outputs:**
170+
`19_comparison_vulnerability_curves.csv`,
171+
`20_comparison_vulnerability_curves.png`,
172+
`21_fragility_comparison_Fragility_10.csv`,
173+
`22_fragility_comparison_Fragility_10.png`.
162174
163175
164176
### Summary
@@ -200,7 +212,7 @@ This enables evaluation across construction periods, structural types, and datas
200212
## Citation
201213
> Bonfante, N., Pinelli, J.-P., Bakhshandeh, M., & Guennec, T. (2025). *Empirical Hurricane Vulnerability and Fragility Curves*. DesignSafe-CI. DOI: [10.17603/ds2-q60v-z247](https://doi.org/10.17603/ds2-q60v-z247)
202214
## Licensing
203-
**License:** BSD 3-Clause License
215+
**License:** BSD 3-Clause License
204216
205217
## Acknowledgment:
206218
This research was supported by the **National Science Foundation (NSF)** under **Award No. 1520817**, through the **NHERI DesignSafe Cyberinfrastructure**. The opinions and conclusions expressed are those of the authors and do not necessarily reflect the views of the NSF.

0 commit comments

Comments
 (0)