Skip to content

Commit

Permalink
Update paths
Browse files Browse the repository at this point in the history
  • Loading branch information
frederique-hub committed Oct 19, 2023
1 parent 28feee3 commit a1b4473
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions examples/aggregation_zones_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@
"from pathlib import Path\n",
"import os \n",
"#Load aggregation zones as GeoDataFrames\n",
"exposure=gpd.read_file(Path(os.path.abspath(\"\")) / \"data\" / \"aggregation_zones_example\" / \"exposure\" / \"buildings.gpkg\")\n",
"base_zone=gpd.read_file(Path(os.path.abspath(\"\")) / \"data\" / \"aggregation_zones_example\" / \"aggregation_zones\" / \"base_zones.gpkg\")\n",
"exposure=gpd.read_file(Path(os.path.abspath(\"\")) / \"data\" / \"aggregation_zones\" / \"exposure\" / \"buildings.gpkg\")\n",
"base_zone=gpd.read_file(Path(os.path.abspath(\"\")) / \"data\" / \"aggregation_zones\" / \"aggregation_zones\" / \"base_zones.gpkg\")\n",
"\n",
"m = base_zone.explore(column = 'ZONE_BASE')\n",
"m = exposure.explore(m=m, color = '#FFFACD')\n",
Expand Down Expand Up @@ -179,7 +179,7 @@
"#Let's read the yaml file with the required information \n",
"#and set up the FIAT model for the two test cases. \n",
"\n",
"with open(Path(os.path.abspath(\"\")) / \"data\" / \"aggregation_zones_example\" / \"config_aggregation.yml\", 'r') as file:\n",
"with open(Path(os.path.abspath(\"\")) / \"data\" / \"aggregation_zones\" / \"config_aggregation.yml\", 'r') as file:\n",
" config_aggregation = yaml.safe_load(file)\n",
"\n",
"print(json.dumps(config_aggregation, indent=4, sort_keys=False))"
Expand Down Expand Up @@ -208,7 +208,7 @@
"outputs": [],
"source": [
"# Set up Fiat Model\n",
"root = Path(os.path.abspath(\"\")) / \"data\" / \"aggregation_zones_example\"\n",
"root = Path(os.path.abspath(\"\")) / \"data\" / \"aggregation_zones\" / \"fiat_model\"\n",
"\n",
"#If case exist\n",
"if Path(config_aggregation[\"cases\"][\"test1_single_aggregation\"][\"new_root\"]).exists():\n",
Expand Down Expand Up @@ -320,10 +320,10 @@
"outputs": [],
"source": [
"#Load *.csv into dataframe\n",
"df_single_aggregation = pd.read_csv(Path(os.path.abspath(\"\")) / \"data\" / \"aggregation_zones_example\" / \"output\" / \"aggregation_zones_test1\" / \"exposure\" / \"exposure.csv\")\n",
"df_single_aggregation = pd.read_csv(Path(os.path.abspath(\"\")) / \"data\" / \"aggregation_zones\" / \"output\" / \"aggregation_zones_test1\" / \"exposure\" / \"exposure.csv\")\n",
"\n",
"#Load original exposure geopackage into GeoDataFrame\n",
"new_exposure=gpd.read_file(Path(os.path.abspath(\"\")) / \"data\" / \"aggregation_zones_example\" / \"output\" / \"aggregation_zones_test1\" / \"exposure\" / \"buildings.gpkg\")\n",
"new_exposure=gpd.read_file(Path(os.path.abspath(\"\")) / \"data\" / \"aggregation_zones\" / \"output\" / \"aggregation_zones_test1\" / \"exposure\" / \"buildings.gpkg\")\n",
"\n",
"#Merge dataframe with GeoDataFrame\n",
"merged_gdf = new_exposure.merge(df_single_aggregation, left_on='Object ID', right_on='Object ID', how='inner')\n",
Expand Down Expand Up @@ -354,10 +354,10 @@
"outputs": [],
"source": [
"#Load *.csv into dataframe\n",
"df_multiple_aggregation = pd.read_csv(Path(os.path.abspath(\"\")) / \"data\" / \"aggregation_zones_example\" / \"output\" / \"aggregation_zones_test2\" / \"exposure\" / \"exposure.csv\")\n",
"df_multiple_aggregation = pd.read_csv(Path(os.path.abspath(\"\")) / \"data\" / \"aggregation_zones\" / \"output\" / \"aggregation_zones_test2\" / \"exposure\" / \"exposure.csv\")\n",
"\n",
"#Load original exposure geopackage into GeoDataFrame\n",
"new_exposure=gpd.read_file(Path(os.path.abspath(\"\")) / \"data\" / \"aggregation_zones_example\" / \"output\" / \"aggregation_zones_test2\" / \"exposure\" / \"buildings.gpkg\")\n",
"new_exposure=gpd.read_file(Path(os.path.abspath(\"\")) / \"data\" / \"aggregation_zones\" / \"output\" / \"aggregation_zones_test2\" / \"exposure\" / \"buildings.gpkg\")\n",
"\n",
"#Merge dataframe with GeoDataFrame\n",
"merged_gdf_multiple = new_exposure.merge(df_multiple_aggregation, left_on='Object ID', right_on='Object ID', how='inner')"
Expand Down

0 comments on commit a1b4473

Please sign in to comment.