Skip to content

Commit

Permalink
510 bldg functionality column renaming docs (#352)
Browse files Browse the repository at this point in the history
* update notebooks related to the functionality column naming change
* changelog
  • Loading branch information
longshuicy committed Apr 10, 2024
1 parent 83f050c commit 207b93f
Show file tree
Hide file tree
Showing 5 changed files with 361 additions and 271 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ 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/).

## [Unreleased]

### Changed
- Update notebooks related to the functionality column naming change [#510](https://github.com/IN-CORE/pyincore/issues/510)

## [Unreleased]

Expand Down
606 changes: 349 additions & 257 deletions manual_jb/content/notebooks/Joplin_testbed/Joplin_testbed.ipynb

Large diffs are not rendered by default.

Binary file modified notebooks/Joplin_testbed.zip
Binary file not shown.
13 changes: 3 additions & 10 deletions notebooks/building_func.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@
"pdm_std = np.std(pdm_guid)\n",
"\n",
"# buildings combined functionality\n",
"bfm = df_building_func[\"samples\"].str.split(pat=\",\")\n",
"bfm = df_building_func[\"failure\"].str.split(pat=\",\")\n",
"bfm = 1 - bfm.apply(pd.to_numeric)\n",
"bfm = bfm.to_numpy()\n",
"bfm = np.stack(bfm)\n",
Expand Down Expand Up @@ -456,18 +456,11 @@
"source": [
"print(func_data)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -481,7 +474,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.6"
"version": "3.12.2"
}
},
"nbformat": 4,
Expand Down
9 changes: 5 additions & 4 deletions notebooks/galveston_community_app.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,9 @@
"cell_type": "code",
"execution_count": null,
"id": "27114b4d",
"metadata": {},
"metadata": {
"scrolled": true
},
"outputs": [],
"source": [
"ret_json = DataProcessUtil.create_mapped_dmg_result_gal(\n",
Expand Down Expand Up @@ -486,15 +488,14 @@
"metadata": {},
"source": [
"df_gal_bldg_func_probability = gal_bldg_func.get_output_dataset('functionality_probability').get_dataframe_from_csv()\n",
"df_gal_bldg_func_probability = df_gal_bldg_func_probability.rename(columns={\"building_guid\": \"guid\"})\n",
"func_prob_target = 0.40\n",
"df_gal_bldg_func_probability.loc[df_gal_bldg_func_probability['probability'].isna(), 'functionality'] = 1 # Assumed to be connected to an undamaged/unanalyzed power network for now.\n",
"df_gal_bldg_func_probability.loc[df_gal_bldg_func_probability['probability'] <= func_prob_target, 'functionality'] = 0 # Non-Functional\n",
"df_gal_bldg_func_probability.loc[df_gal_bldg_func_probability['probability'] > func_prob_target, 'functionality'] = 1 # Functional\n",
"df_gal_bldg_func_probability.loc[df_gal_bldg_func_probability['probability'].isna(), 'functionality_state'] = 'Functional' # Assumed to be connected to an undamaged/unanalyzed power network for now.\n",
"df_gal_bldg_func_probability.loc[df_gal_bldg_func_probability['probability'] <= func_prob_target, 'functionality_state'] = 'Non-Functional' # Non-Functional\n",
"df_gal_bldg_func_probability.loc[df_gal_bldg_func_probability['probability'] > func_prob_target, 'functionality_state'] = 'Functional' # Functional\n",
"df_gal_bldg_func_probability.head()\n"
"df_gal_bldg_func_probability.head()"
]
},
{
Expand Down Expand Up @@ -792,7 +793,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.6"
"version": "3.12.2"
}
},
"nbformat": 4,
Expand Down

0 comments on commit 207b93f

Please sign in to comment.