From 61d90d7457a42ef96fa61687a1cb58bedeb43762 Mon Sep 17 00:00:00 2001 From: Chen Wang Date: Tue, 24 Oct 2023 15:10:05 -0500 Subject: [PATCH 1/3] update building portforlio structure --- notebooks/portfolio_recovery.ipynb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/notebooks/portfolio_recovery.ipynb b/notebooks/portfolio_recovery.ipynb index 4f3a3119..c1d8e107 100644 --- a/notebooks/portfolio_recovery.ipynb +++ b/notebooks/portfolio_recovery.ipynb @@ -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" ] @@ -134,4 +134,4 @@ }, "nbformat": 4, "nbformat_minor": 1 -} \ No newline at end of file +} From 0b01cc4d95f5c1a50e244146444b1160490083c8 Mon Sep 17 00:00:00 2001 From: Chen Wang Date: Tue, 24 Oct 2023 15:16:41 -0500 Subject: [PATCH 2/3] update notebook --- notebooks/portfolio_recovery.ipynb | 28 ++++------------------------ 1 file changed, 4 insertions(+), 24 deletions(-) diff --git a/notebooks/portfolio_recovery.ipynb b/notebooks/portfolio_recovery.ipynb index c1d8e107..e5965308 100644 --- a/notebooks/portfolio_recovery.ipynb +++ b/notebooks/portfolio_recovery.ipynb @@ -82,27 +82,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()" ] }, { @@ -115,7 +95,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -129,9 +109,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 } From e7234d9a1abc981682ea6fc9ffeaedbbd5d88086 Mon Sep 17 00:00:00 2001 From: Chen Wang Date: Tue, 24 Oct 2023 15:20:04 -0500 Subject: [PATCH 3/3] changelog --- CHANGELOG.md | 1 + notebooks/portfolio_recovery.ipynb | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ca84dbdd..8b08ccf0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/notebooks/portfolio_recovery.ipynb b/notebooks/portfolio_recovery.ipynb index e5965308..5c7d4aa8 100644 --- a/notebooks/portfolio_recovery.ipynb +++ b/notebooks/portfolio_recovery.ipynb @@ -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" ] }, {