Skip to content

Commit

Permalink
Merge pull request #406 from IN-CORE/release-4.12.0
Browse files Browse the repository at this point in the history
Release 4.12.0
  • Loading branch information
longshuicy authored Jun 11, 2024
2 parents b6c6945 + 82a2db8 commit 3bd7c18
Show file tree
Hide file tree
Showing 52 changed files with 3,390 additions and 952 deletions.
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,25 @@ All notable changes to the INCORE documents generated by Sphinx package will be
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).


## [4.12.0] - 2024-06-12

### Changed
- Rename Building Portfolio Analysis to Building Cluster Recovery Analysis [#559](https://github.com/IN-CORE/pyincore/issues/559)
- Update flood input to nonstructural damage output for combined wind-wave-surge building damage [#566](https://github.com/IN-CORE/incore-docs/issues/566)
- pyincore, pyincore-viz and pyincore-data installation instructions to include how to use libmamba solver [#375](https://github.com/IN-CORE/incore-docs/issues/375)
- Update docs to reflect Non-structural Building Damage change [#562](https://github.com/IN-CORE/pyincore/issues/562)
- Rename Monte Carlo failure probability analysis to Monte Carlo limit state Probability Analysis [#557](https://github.com/IN-CORE/pyincore/issues/557)
- Add building structural damage documentation and notebook [#402](https://github.com/IN-CORE/incore-docs/issues/402)

### Added
- Gas facility damage analysis documentation and example notebook [#387](https://github.com/IN-CORE/incore-docs/issues/387)
- Traffic flow recovery analysis documentation and example notebook [#389](https://github.com/IN-CORE/incore-docs/issues/389)
- Social vulnerability score analysis documentation and example notebook [#392](https://github.com/IN-CORE/incore-docs/issues/392)
- Google Analytics to the main documentation [#399](https://github.com/IN-CORE/incore-docs/issues/399)
- Google Analytics to the api sphinx documentation [#396](https://github.com/IN-CORE/incore-docs/issues/396)
- Buyout decision analysis documentation and example notebook [#401](https://github.com/IN-CORE/incore-docs/issues/401)

## [4.11.0] - 2024-04-30

### Changed
Expand Down
8 changes: 8 additions & 0 deletions manual_jb/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,17 @@ RUN apt-get -y update

WORKDIR /src
COPY requirements.txt /src/
COPY insert_ga_to_header.py /src/
RUN python3 -m pip install -r requirements.txt


COPY content/ /src/content/
RUN jupyter-book build content/

# Run the insert_ga_to_header.py script to insert Google Analytics code
RUN python3 -m pip install beautifulsoup4
RUN python3 insert_ga_to_header.py

# ----------------------------------------------------------------------
# Building actual container
# ----------------------------------------------------------------------
Expand All @@ -22,3 +28,5 @@ FROM nginx
RUN mkdir -p /usr/share/nginx/html/doc/incore
COPY --from=builder /src/content/_build/html/ /usr/share/nginx/html/doc/incore/

COPY config /usr/share/nginx/html/doc/incore/config

3 changes: 3 additions & 0 deletions manual_jb/config/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"GA_KEY": "Test-Google-Analytics-Key-Replace-Me"
}
31 changes: 31 additions & 0 deletions manual_jb/config/googleAnalytics.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// analytics.js
(function() {
// Fetch the runtime configuration
fetch('config/config.json')
.then(response => {
if (!response.ok) {
throw new Error('Configuration file not found');
}
return response.json();
})
.then(config => {
if (!config.GA_KEY) {
throw new Error('GA_KEY is missing in the configuration');
}

// Create the script tag for Google Tag Manager
const scriptTag = document.createElement('script');
scriptTag.async = true;
scriptTag.src = `https://www.googletagmanager.com/gtag/js?id=${config.GA_KEY}`;
document.head.appendChild(scriptTag);

// Initialize Google Analytics
window.dataLayer = window.dataLayer || [];

function gtag() { dataLayer.push(arguments); }

gtag('js', new Date());
gtag('config', config.GA_KEY);
})
.catch(error => console.warn('GA setup skipped:', error.message));
})();
2 changes: 1 addition & 1 deletion manual_jb/content/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ project: "IN-CORE Manual"
author: IN-CORE Community
copyright: "2023" # Copyright year to be placed in the footer
logo: images/resilience-logo.png
version: "4.11.0" # Version is not part of JB config, we use it for autobuild of incore-docs
version: "4.12.0" # Version is not part of JB config, we use it for autobuild of incore-docs
exclude_patterns: [_build, .DS_Store, "**.ipynb_checkpoints"]

repository:
Expand Down
10 changes: 8 additions & 2 deletions manual_jb/content/_toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,13 @@ chapters:
- file: analyses
sections:
- file: analyses/bridge_dmg
- file: analyses/building_cluster_recovery
- file: analyses/building_dmg
- file: analyses/building_func
- file: analyses/building_loss
- file: analyses/building_nonstructural_dmg
- file: analyses/buyout_decision
- file: analyses/building_structural_dmg
- file: analyses/capital_shocks
- file: analyses/combined_wind_wave_surge_building_dmg
- file: analyses/combined_wind_wave_surge_building_loss
Expand All @@ -28,17 +32,17 @@ chapters:
- file: analyses/epf_restoration
- file: analyses/epn_functionality
- file: analyses/galveston_cge
- file: analyses/gas_facility_damage
- file: analyses/housing_household_recovery
- file: analyses/housing_recovery
- file: analyses/housingunitallocation
- file: analyses/indp
- file: analyses/joplin_cge
- file: analyses/joplin_empirical_restoration
- file: analyses/mean_dmg
- file: analyses/mc_failure_prob
- file: analyses/mc_limit_state_prob
- file: analyses/multi_retrofit_optimization
- file: analyses/nci_functionality
- file: analyses/non_structural_building_dmg
- file: analyses/pipeline_dmg
- file: analyses/pipeline_dmg_w_repair_rate
- file: analyses/pipeline_functionality
Expand All @@ -51,7 +55,9 @@ chapters:
- file: analyses/slc_cge
- file: analyses/seaside_cge
- file: analyses/social_vulnerability
- file: analyses/social_vulnerability_score
- file: analyses/tornadoepn_dmg
- file: analyses/traffic_flow_recovery
- file: analyses/transportation_recovery
- file: analyses/waterfacility_dmg
- file: analyses/wfn_functionality
Expand Down
89 changes: 47 additions & 42 deletions manual_jb/content/analyses.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,51 @@
# Analyses

1. [Bridge damage](analyses/bridge_dmg.md)
2. [Building damage](analyses/building_dmg)
3. [Building functionality](analyses/building_func)
2. [Building cluster recovery](analyses/building_cluster_recovery)
3. [Building damage](analyses/building_dmg)
4. [Building economic loss](analyses/building_loss)
5. [Capital shocks](analyses/capital_shocks)
6. [Combined wind wave surge building damage](analyses/combined_wind_wave_surge_building_dmg)
7. [Combined wind wave surge building loss](analyses/combined_wind_wave_surge_building_loss)
8. [Commercial building recovery](analyses/commercial_building_recovery)
9. [Cumulative building damage](analyses/cumulative_building_dmg)
10. [Electric power facility damage](analyses/epf_dmg)
11. [Electric power facility repair cost](analyses/epf_repair_cost)
12. [Electric power facility restoration](analyses/epf_restoration)
13. [Electric power network functionality](analyses/epn_functionality)
14. [Galveston Computable General Equilibrium (CGE)](analyses/galveston_cge.md)
15. [Household-level housing sequential recovery](analyses/housing_household_recovery)
16. [Housing recovery](analyses/housing_recovery)
17. [Housing unit allocation](analyses/housingunitallocation)
18. [Interdependent Network Design Problem](analyses/indp)
19. [Joplin Computable General Equilibrium (CGE)](analyses/joplin_cge)
20. [Joplin empirical building restoration](analyses/joplin_empirical_building_restoration)
21. [Machine Learning Enabled Computable General Equilibrium (CGE) - Salt Lake City](analyses/ml_slc_cge.md)
22. [Mean damage](analyses/mean_dmg)
23. [Monte Carlo failure probability](analyses/mc_failure_prob)
24. [Multi-objective retrofit optimization](analyses/multi_retrofit_optimization)
25. [Network cascading interdependency functionality](analyses/nci_functionality)
26. [Nonstructural building damage](analyses/non_structural_building_dmg)
27. [Pipeline damage](analyses/pipeline_dmg)
28. [Pipeline damage with repair rate](analyses/pipeline_dmg_w_repair_rate)
29. [Pipeline functionality](analyses/pipeline_functionality)
30. [Pipeline repair cost](analyses/pipeline_repair_cost)
31. [Pipeline restoration](analyses/pipeline_restoration)
32. [Population dislocation](analyses/populationdislocation)
33. [Portfolio recovery](analyses/portfolio_recovery)
34. [Residential building recovery](analyses/residential_building_recovery)
35. [Road damage](analyses/road_dmg)
36. [Salt Lake City Computable General Equilibrium (CGE)](analyses/slc_cge.md)
37. [Seaside Computable General Equilibrium (CGE)](analyses/seaside_cge)
38. [Social Vulnerability](analyses/social_vulnerability)
39. [Tornado electric power network (EPN) damage](analyses/tornadoepn_dmg)
40. [Transportation recovery](analyses/transportation_recovery)
41. [Water facility damage](analyses/waterfacility_dmg)
42. [Water network functionality](analyses/wfn_functionality)
43. [Water facility repair cost](analyses/water_facility_repair_cost)
44. [Water facility restoration](analyses/water_facility_restoration)
5. [Building functionality](analyses/building_func)
6. [Building nonstructural damage](analyses/building_nonstructural_dmg)
7. [Building structural damage](analyses/building_structural_dmg)
8. [Buyout decision](analyses/buyout_decision)
9. [Capital shocks](analyses/capital_shocks)
10. [Combined wind wave surge building damage](analyses/combined_wind_wave_surge_building_dmg)
11. [Combined wind wave surge building loss](analyses/combined_wind_wave_surge_building_loss)
12. [Commercial building recovery](analyses/commercial_building_recovery)
13. [Cumulative building damage](analyses/cumulative_building_dmg)
14. [Electric power facility damage](analyses/epf_dmg)
15. [Electric power facility repair cost](analyses/epf_repair_cost)
16. [Electric power facility restoration](analyses/epf_restoration)
17. [Electric power network functionality](analyses/epn_functionality)
18. [Galveston Computable General Equilibrium (CGE)](analyses/galveston_cge.md)
19. [Gas facility damage](analyses/gas_facility_damage)
20. [Household-level housing sequential recovery](analyses/housing_household_recovery)
21. [Housing recovery](analyses/housing_recovery)
22. [Housing unit allocation](analyses/housingunitallocation)
23. [Interdependent Network Design Problem](analyses/indp)
24. [Joplin Computable General Equilibrium (CGE)](analyses/joplin_cge)
25. [Joplin empirical building restoration](analyses/joplin_empirical_building_restoration)
26. [Machine Learning Enabled Computable General Equilibrium (CGE) - Salt Lake City](analyses/ml_slc_cge.md)
27. [Mean damage](analyses/mean_dmg)
28. [Monte Carlo limit state probability](analyses/mc_limit_state_prob)
29. [Multi-objective retrofit optimization](analyses/multi_retrofit_optimization)
30. [Network cascading interdependency functionality](analyses/nci_functionality)
31. [Pipeline damage](analyses/pipeline_dmg)
32. [Pipeline damage with repair rate](analyses/pipeline_dmg_w_repair_rate)
33. [Pipeline functionality](analyses/pipeline_functionality)
34. [Pipeline repair cost](analyses/pipeline_repair_cost)
35. [Pipeline restoration](analyses/pipeline_restoration)
36. [Population dislocation](analyses/populationdislocation)
37. [Residential building recovery](analyses/residential_building_recovery)
38. [Road damage](analyses/road_dmg)
39. [Salt Lake City Computable General Equilibrium (CGE)](analyses/slc_cge.md)
40. [Seaside Computable General Equilibrium (CGE)](analyses/seaside_cge)
41. [Social Vulnerability](analyses/social_vulnerability)
42. [Social Vulnerability Score](analyses/social_vulnerability_score)
43. [Tornado electric power network (EPN) damage](analyses/tornadoepn_dmg)
44. [Traffic flow recovery](analyses/traffic_flow_recovery)
45. [Transportation recovery](analyses/transportation_recovery)
46. [Water facility damage](analyses/waterfacility_dmg)
47. [Water network functionality](analyses/wfn_functionality)
48. [Water facility repair cost](analyses/water_facility_repair_cost)
49. [Water facility restoration](analyses/water_facility_restoration)
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Portfolio recovery
# Building Cluster Recovery

**Description**

The code creates two output files *building-recovery.csv* and *portfolio-recovery.csv*
The code creates two output files *building-recovery.csv* and *cluster-recovery.csv*

**Input Parameters**

Expand All @@ -29,9 +29,9 @@ key name | type | name | description

**Output Datasets**

key name | type | name | description
--- | --- | --- | ---
`result` <sup>*</sup> | [`incore:portfolioRecovery`](https://incore.ncsa.illinois.edu/semantics/api/types/incore:portfolioRecovery) | Results | A dataset containing results (format: CSV).
key name | type | name | description
--- |--------------------------------------------------------------------------------------------------------------| --- | ---
`result` <sup>*</sup> | [`incore:clusterRecovery`](https://incore.ncsa.illinois.<br/>edu/semantics/api/types/incore:clusterRecovery) | Results | A dataset containing results (format: CSV).

<small>(* required)</small>

Expand All @@ -41,25 +41,25 @@ code snippet:

```
# Create instance
bldg_portfolio_recovery = BuildingPortfolioRecoveryAnalysis(client)
bldg_cluster_recovery = BuildingClusterRecovery(client)
# Load input datasets
bldg_portfolio_recovery.load_remote_input_dataset("building_data", bldg_data_dataset)
bldg_portfolio_recovery.load_remote_input_dataset("occupancy_mapping", occupancy_dataset)
bldg_portfolio_recovery.load_remote_input_dataset("building_damage", bldg_damage_dataset)
bldg_portfolio_recovery.load_remote_input_dataset("dmg_ratios", mean_repair_dataset)
bldg_portfolio_recovery.load_remote_input_dataset("utility", utility_dataset)
bldg_portfolio_recovery.load_remote_input_dataset("utility_partial", utility_partial_dataset)
bldg_portfolio_recovery.load_remote_input_dataset("coefFL", coefFL_dataset)
bldg_cluster_recovery.load_remote_input_dataset("building_data", bldg_data_dataset)
bldg_cluster_recovery.load_remote_input_dataset("occupancy_mapping", occupancy_dataset)
bldg_cluster_recovery.load_remote_input_dataset("building_damage", bldg_damage_dataset)
bldg_cluster_recovery.load_remote_input_dataset("dmg_ratios", mean_repair_dataset)
bldg_cluster_recovery.load_remote_input_dataset("utility", utility_dataset)
bldg_cluster_recovery.load_remote_input_dataset("utility_partial", utility_partial_dataset)
bldg_cluster_recovery.load_remote_input_dataset("coefFL", coefFL_dataset)
# Set parameters
bldg_portfolio_recovery.set_parameter("uncertainty", True)
bldg_portfolio_recovery.set_parameter("sample_size", 35) # default none. Gets size form input dataset
bldg_portfolio_recovery.set_parameter("random_sample_size", 50) # default 10000
bldg_portfolio_recovery.set_parameter("no_of_weeks", 100) # default 250
bldg_cluster_recovery.set_parameter("uncertainty", True)
bldg_cluster_recovery.set_parameter("sample_size", 35) # default none. Gets size form input dataset
bldg_cluster_recovery.set_parameter("random_sample_size", 50) # default 10000
bldg_cluster_recovery.set_parameter("no_of_weeks", 100) # default 250
# Creates two output files building-recovery.csv and portfolio-recovery.csv
bldg_portfolio_recovery.run_analysis()
# Creates two output files building-recovery.csv and cluster-recovery.csv
bldg_cluster_recovery.run_analysis()
```

full analysis: [portfolio_recovery.ipynb](https://github.com/IN-CORE/incore-docs/blob/main/notebooks/portfolio_recovery.ipynb)
full analysis: [building_cluster_recovery.ipynb](https://github.com/IN-CORE/incore-docs/blob/main/notebooks/building_cluster_recovery.ipynb)
2 changes: 1 addition & 1 deletion manual_jb/content/analyses/building_func.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ If both the nearest pole to the building and the substation where buildings belo
functional, buildings are considered to be able to receive electric power.

The outputs of this analysis are 1) a CSV file with probabilities of functionality samples
for direct comparison with [MC failure probability](mc_failure_prob) outputs and
for direct comparison with [MC limit state probability](mc_limit_state_prob) outputs and
2) a CSV file with probabilities of functionality.

**Input parameters**
Expand Down
Loading

0 comments on commit 3bd7c18

Please sign in to comment.