Skip to content

Commit

Permalink
Update building portfolio recovery structure (#287)
Browse files Browse the repository at this point in the history
* update building portforlio structure

* update notebook

* changelog
  • Loading branch information
longshuicy authored Oct 26, 2023
1 parent 242cc7a commit 5d7d5cf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 27 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

### Changed
- Update damage analysis documentations with hazard object input [#282](https://github.com/IN-CORE/incore-docs/issues/282)
- Building Portfolio Recovery analysis notebook [286](https://github.com/IN-CORE/incore-docs/issues/286)

### Fixed
- The notebook create_network_dataset.ipynb fails on nx.info [#284](https://github.com/IN-CORE/incore-docs/issues/284)
Expand Down
35 changes: 8 additions & 27 deletions notebooks/portfolio_recovery.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"metadata": {},
"outputs": [],
"source": [
"from pyincore.analyses.buildingportfolio.recovery import BuildingPortfolioRecoveryAnalysis\n",
"from pyincore.analyses.buildingportfolio import BuildingPortfolioRecoveryAnalysis\n",
"\n",
"from pyincore import IncoreClient"
]
Expand Down Expand Up @@ -46,7 +46,8 @@
"bldg_portfolio_recovery.set_parameter(\"sample_size\", 35) # default none. Gets size form input dataset\n",
"bldg_portfolio_recovery.set_parameter(\"random_sample_size\", 50) # default 10000\n",
"bldg_portfolio_recovery.set_parameter(\"no_of_weeks\", 100) # default 250\n",
"# bldg_portfolio_recovery.set_parameter(\"num_cpu\", 1) Parallelization isn't implemented "
"bldg_portfolio_recovery.set_parameter(\"result_name\", \"memphis\")\n",
"# bldg_portfolio_recovery.set_parameter(\"num_cpu\", 1) Parallelization isn't implemented"
]
},
{
Expand Down Expand Up @@ -82,27 +83,7 @@
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd\n",
"bldg_result = pd.read_csv('building-recovery.csv')\n",
"portfolio_result = pd.read_csv('portfolio-recovery.csv')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"bldg_result.head()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"portfolio_result.head()"
"bldg_portfolio_recovery.get_output_dataset(\"result\").get_dataframe_from_csv().head()"
]
},
{
Expand All @@ -115,7 +96,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -129,9 +110,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.5"
"version": "3.11.6"
}
},
"nbformat": 4,
"nbformat_minor": 1
}
"nbformat_minor": 4
}

0 comments on commit 5d7d5cf

Please sign in to comment.