diff --git a/README.md b/README.md index a2fe61b0cf..9aa0e974fe 100755 --- a/README.md +++ b/README.md @@ -3,6 +3,14 @@ [![build](https://github.com/IMMM-SFA/naturf/actions/workflows/build.yml/badge.svg)](https://github.com/IMMM-SFA/naturf/actions/workflows/build.yml) # naturf +<<<<<<< HEAD +<<<<<<< HEAD +======= +>>>>>>> 3bda76b (add codecov badge) +======= +>>>>>>> 891f9cf (fix formatting) +======= +>>>>>>> main #### `naturf` (Neighborhood Adaptive Tissues for Urban Resilience Futures) is an open-source geospatial Python package for calculating urban building parameters to be compiled and input to the Weather Research and Forecasting model (WRF). @@ -14,7 +22,9 @@ - Prepare binary files to be fed into WRF to understand the effect of building morphology on the urban microclimate. ### Install `naturf` +<<<<<<< HEAD +<<<<<<< HEAD ```bash pip install naturf ``` @@ -42,9 +52,47 @@ The reference guide contains a detailed description of the `naturf` API. The ref To get started on development, install the pre-commit hooks to format code. +<<<<<<< HEAD +======= +======= + +```bash +pip install naturf +``` +### Check out a quickstart tutorial to run `naturf` + +Run `naturf` using the quickstart tutorial: [`naturf` Quickstarter](https://immm-sfa.github.io/naturf/quickstarter.html) + +### Getting started + +New to `naturf`? Get familiar with what `naturf` is all about in our [Getting Started](https://immm-sfa.github.io/naturf/getting_started.html) + +### User guide + +Our user guide provides in-depth information on the key concepts of `naturf` with useful background information and explanation. See our [User Guide](https://immm-sfa.github.io/naturf/user_guide.html) + +### Contributing to `naturf` + +Whether you find a typo in the documentation, find a bug, or want to develop functionality that you think will make `naturf` more robust, you are welcome to contribute! See our [Contribution Guidelines](https://immm-sfa.github.io/naturf/contributing.html) + +### API reference + +The reference guide contains a detailed description of the `naturf` API. The reference describes how the methods work and which parameters can be used. It assumes that you have an understanding of the key concepts. See [API Reference](https://immm-sfa.github.io/naturf/modules.html) + +### Developer Setup + +To get started on development, install the pre-commit hooks to format code. + +>>>>>>> main +First [install `pre-commit`](https://pre-commit.com/). + +Then install the hooks within the repo: +>>>>>>> 77584d7 (remove mac-specific pre-commit install instructions) +======= First [install `pre-commit`](https://pre-commit.com/). Then install the hooks within the repo: +>>>>>>> 891f9cf (fix formatting) ```bash $ cd /PATH/TO/NATURF $ pre-commit install diff --git a/notebooks/quickstarter.ipynb b/notebooks/quickstarter.ipynb index 5ff47f04f3..c877f9afd7 100644 --- a/notebooks/quickstarter.ipynb +++ b/notebooks/quickstarter.ipynb @@ -7,7 +7,7 @@ "source": [ "# `naturf` Quickstarter\n", "\n", - "`naturf` (Neighborhood Adaptive Tissues for Urban Resilience Futures) calculates 132 urban parameters based on shapefiles of building footprints and heights. Here we run a small example to demonstrate functionality. " + "The Neighborhood Adaptive Tissues for Urban Resilience Futures tool (`naturf`) is a Python workflow that generates files readable by the Weather Research and Forecasting (WRF) model. `naturf` uses *geopandas* and *hamilton* to calculate 132 building parameters from shapefiles with building footprint and height information. These parameters can be collected and used in many formats, and the primary output is a binary file configured for input to WRF. This workflow is a flexible adaptation of the National/World Urban Database and Access Portal Tool (NUDAPT/WUDAPT) that can be used with any study area at any spatial resolution. The climate modeling community and urban planners can identify the effects of building/neighborhood morphology on the microclimate using the urban parameters and WRF-readable files produced by `naturf`. The source code for `naturf` can be found on [GitHub](https://github.com/IMMM-SFA/naturf/tree/main), and more information on the urban parameters calculated can be found in the [documentation](https://immm-sfa.github.io/naturf/)." ] }, { @@ -22,15 +22,18 @@ }, "outputs": [], "source": [ + "from importlib.resources import files\n", "from naturf import driver" ] }, { "cell_type": "markdown", - "id": "ecbe0098-b161-483e-baaa-720109886a00", + "id": "9c781bf4-d8d6-4c79-bee0-67be5bf77c12", "metadata": {}, "source": [ - "`naturf` requires two inputs: an input dictionary with the location of the shapefile, and a list of the desired outputs. To write both the binary file and the index file required for WRF, the outputs should be `[\"write_binary\", \"write_index\"]`." + "## Case 1\n", + "\n", + "`naturf` requires two inputs: an input dictionary with the location of the shapefile, and a list of the desired outputs. For this first case, we can look at three outputs: `plan_area_fraction`, `area_weighted_mean_of_building_heights`, and `sky_view_factor`." ] }, { @@ -57,13 +60,23 @@ } ], "source": [ + "input_shapefile_path = str(files(\"naturf.data\").joinpath(\"C-5.shp\"))\n", + "\n", "inputs = {\n", - " \"input_shapefile\": \"../naturf/data/C-5.shp\",\n", + " \"input_shapefile\": input_shapefile_path,\n", "}\n", - "outputs = [\"merge_parameters\"]\n", + "outputs = [\"plan_area_fraction\",\"area_weighted_mean_of_building_heights\",\"sky_view_factor\"]\n", "model = driver.Model(inputs, outputs)" ] }, + { + "cell_type": "markdown", + "id": "c0f999e9", + "metadata": {}, + "source": [ + "Render the Directed Acyclic Graph(DAG) to show which functions the model calls in order to create the desired output. Note that the model doesn't execute!" + ] + }, { "cell_type": "code", "execution_count": 3, @@ -88,932 +101,1589 @@ "\n", "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", "\n", "cluster__legend\n", - "\n", - "Legend\n", + "\n", + "Legend\n", "\n", - "\n", + "\n", "\n", - "building_height\n", - "\n", - "building_height\n", - "GeoSeries\n", + "wall_length\n", + "\n", + "wall_length\n", + "DataFrame\n", "\n", - "\n", - "\n", - "grimmond_oke_roughness_length\n", - "\n", - "grimmond_oke_roughness_length\n", - "Series\n", + "\n", + "\n", + "buildings_intersecting_plan_area\n", + "\n", + "buildings_intersecting_plan_area\n", + "GeoDataFrame\n", "\n", - "\n", - "\n", - "building_height->grimmond_oke_roughness_length\n", - "\n", - "\n", + "\n", + "\n", + "wall_length->buildings_intersecting_plan_area\n", + "\n", + "\n", "\n", - "\n", + "\n", + "\n", + "plan_area_fraction\n", + "\n", + "plan_area_fraction\n", + "Series\n", + "\n", + "\n", "\n", - "raupach_roughness_length\n", - "\n", - "raupach_roughness_length\n", - "DataFrame\n", + "average_distance_between_buildings\n", + "\n", + "average_distance_between_buildings\n", + "Series\n", "\n", - "\n", - "\n", - "building_height->raupach_roughness_length\n", - "\n", - "\n", + "\n", + "\n", + "sky_view_factor\n", + "\n", + "sky_view_factor\n", + "Series\n", "\n", - "\n", + "\n", + "\n", + "average_distance_between_buildings->sky_view_factor\n", + "\n", + "\n", + "\n", + "\n", "\n", - "frontal_area_density\n", - "\n", - "frontal_area_density\n", - "DataFrame\n", + "input_shapefile_df\n", + "\n", + "input_shapefile_df\n", + "GeoDataFrame\n", "\n", - "\n", - "\n", - "building_height->frontal_area_density\n", - "\n", - "\n", + "\n", + "\n", + "target_crs\n", + "\n", + "target_crs\n", + "CRS\n", "\n", - "\n", + "\n", + "\n", + "input_shapefile_df->target_crs\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "standardize_column_names_df\n", + "\n", + "standardize_column_names_df\n", + "GeoDataFrame\n", + "\n", + "\n", + "\n", + "input_shapefile_df->standardize_column_names_df\n", + "\n", + "\n", + "\n", + "\n", "\n", - "buildings_intersecting_plan_area\n", - "\n", - "buildings_intersecting_plan_area\n", - "GeoDataFrame\n", + "building_geometry\n", + "\n", + "building_geometry\n", + "GeoSeries\n", "\n", - "\n", - "\n", - "building_height->buildings_intersecting_plan_area\n", - "\n", - "\n", + "\n", + "\n", + "total_plan_area_geometry\n", + "\n", + "total_plan_area_geometry\n", + "GeoSeries\n", "\n", - "\n", - "\n", - "building_surface_area\n", - "\n", - "building_surface_area\n", - "Series\n", + "\n", + "\n", + "building_geometry->total_plan_area_geometry\n", + "\n", + "\n", "\n", - "\n", - "\n", - "building_height->building_surface_area\n", - "\n", - "\n", + "\n", + "\n", + "building_geometry->buildings_intersecting_plan_area\n", + "\n", + "\n", "\n", - "\n", - "\n", - "macdonald_displacement_height\n", - "\n", - "macdonald_displacement_height\n", - "Series\n", + "\n", + "\n", + "building_area\n", + "\n", + "building_area\n", + "Series\n", "\n", - "\n", - "\n", - "building_height->macdonald_displacement_height\n", - "\n", - "\n", + "\n", + "\n", + "building_geometry->building_area\n", + "\n", + "\n", "\n", - "\n", - "\n", - "raupach_displacement_height\n", - "\n", - "raupach_displacement_height\n", - "DataFrame\n", + "\n", + "\n", + "wall_angle_direction_length\n", + "\n", + "wall_angle_direction_length\n", + "DataFrame\n", "\n", - "\n", - "\n", - "building_height->raupach_displacement_height\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "building_geometry->wall_angle_direction_length\n", + "\n", + "\n", "\n", - "\n", - "\n", - "macdonald_roughness_length\n", - "\n", - "macdonald_roughness_length\n", - "DataFrame\n", + "\n", + "\n", + "total_plan_area\n", + "\n", + "total_plan_area\n", + "Series\n", "\n", - "\n", - "\n", - "building_height->macdonald_roughness_length\n", - "\n", + "\n", + "\n", + "total_plan_area->plan_area_fraction\n", + "\n", + "\n", "\n", - "\n", - "\n", - "vertical_distribution_of_building_heights\n", - "\n", - "vertical_distribution_of_building_heights\n", - "DataFrame\n", + "\n", + "\n", + "target_crs->buildings_intersecting_plan_area\n", + "\n", "\n", - "\n", - "\n", - "building_height->vertical_distribution_of_building_heights\n", - "\n", - "\n", + "\n", + "\n", + "building_plan_area\n", + "\n", + "building_plan_area\n", + "Series\n", "\n", - "\n", - "\n", - "plan_area_density\n", - "\n", - "plan_area_density\n", - "DataFrame\n", + "\n", + "\n", + "building_plan_area->plan_area_fraction\n", + "\n", + "\n", "\n", - "\n", - "\n", - "building_height->plan_area_density\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "total_plan_area_geometry->total_plan_area\n", + "\n", + "\n", "\n", - "\n", - "\n", - "sky_view_factor\n", - "\n", - "sky_view_factor\n", - "Series\n", + "\n", + "\n", + "total_plan_area_geometry->buildings_intersecting_plan_area\n", + "\n", + "\n", "\n", - "\n", - "\n", - "building_height->sky_view_factor\n", - "\n", - "\n", + "\n", + "\n", + "filter_height_range\n", + "\n", + "filter_height_range\n", + "GeoDataFrame\n", "\n", - "\n", - "\n", - "grimmond_oke_displacement_height\n", - "\n", - "grimmond_oke_displacement_height\n", - "Series\n", + "\n", + "\n", + "standardize_column_names_df->filter_height_range\n", + "\n", + "\n", "\n", - "\n", - "\n", - "building_height->grimmond_oke_displacement_height\n", - "\n", - "\n", + "\n", + "\n", + "area_weighted_mean_of_building_heights\n", + "\n", + "area_weighted_mean_of_building_heights\n", + "Series\n", "\n", - "\n", - "\n", - "frontal_area\n", - "\n", - "frontal_area\n", - "DataFrame\n", + "\n", + "\n", + "filter_height_range->building_geometry\n", + "\n", + "\n", "\n", - "\n", - "\n", - "building_height->frontal_area\n", - "\n", - "\n", + "\n", + "\n", + "building_id\n", + "\n", + "building_id\n", + "GeoSeries\n", "\n", - "\n", - "\n", - "merge_parameters\n", - "\n", - "merge_parameters\n", - "GeoDataFrame\n", + "\n", + "\n", + "filter_height_range->building_id\n", + "\n", + "\n", "\n", - "\n", - "\n", - "grimmond_oke_roughness_length->merge_parameters\n", - "\n", - "\n", + "\n", + "\n", + "building_height\n", + "\n", + "building_height\n", + "GeoSeries\n", "\n", - "\n", - "\n", - "raupach_roughness_length->merge_parameters\n", - "\n", - "\n", + "\n", + "\n", + "filter_height_range->building_height\n", + "\n", + "\n", "\n", - "\n", - "\n", - "frontal_area_density->merge_parameters\n", - "\n", + "\n", + "\n", + "buildings_intersecting_plan_area->building_plan_area\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "buildings_intersecting_plan_area->area_weighted_mean_of_building_heights\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "distance_between_buildings\n", - "\n", - "distance_between_buildings\n", - "Series\n", + "\n", + "distance_between_buildings\n", + "Series\n", "\n", "\n", - "\n", + "\n", "buildings_intersecting_plan_area->distance_between_buildings\n", - "\n", - "\n", + "\n", + "\n", "\n", - "\n", - "\n", - "frontal_length\n", - "\n", - "frontal_length\n", - "DataFrame\n", + "\n", + "\n", + "distance_between_buildings->average_distance_between_buildings\n", + "\n", + "\n", "\n", - "\n", - "\n", - "buildings_intersecting_plan_area->frontal_length\n", - "\n", - "\n", + "\n", + "\n", + "building_id->buildings_intersecting_plan_area\n", + "\n", + "\n", "\n", - "\n", - "\n", - "mean_building_height\n", - "\n", - "mean_building_height\n", - "Series\n", + "\n", + "\n", + "building_area->buildings_intersecting_plan_area\n", + "\n", + "\n", + "\n", "\n", - "\n", - "\n", - "buildings_intersecting_plan_area->mean_building_height\n", - "\n", - "\n", + "\n", + "\n", + "building_height->buildings_intersecting_plan_area\n", + "\n", + "\n", "\n", - "\n", - "\n", - "building_plan_area\n", - "\n", - "building_plan_area\n", - "Series\n", + "\n", + "\n", + "building_height->sky_view_factor\n", + "\n", + "\n", "\n", - "\n", - "\n", - "buildings_intersecting_plan_area->building_plan_area\n", - "\n", - "\n", + "\n", + "\n", + "wall_angle_direction_length->wall_length\n", + "\n", + "\n", "\n", - "\n", - "\n", - "area_weighted_mean_of_building_heights\n", - "\n", - "area_weighted_mean_of_building_heights\n", - "Series\n", + "\n", + "\n", + "_input_shapefile_df_inputs\n", + "\n", + "input_shapefile\n", + "str\n", "\n", - "\n", - "\n", - "buildings_intersecting_plan_area->area_weighted_mean_of_building_heights\n", - "\n", - "\n", + "\n", + "\n", + "_input_shapefile_df_inputs->input_shapefile_df\n", + "\n", + "\n", "\n", - "\n", + "\n", + "\n", + "_building_plan_area_inputs\n", + "\n", + "join_predicate\n", + "str\n", + "join_rsuffix\n", + "str\n", + "\n", + "\n", + "\n", + "_building_plan_area_inputs->building_plan_area\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "_total_plan_area_geometry_inputs\n", + "\n", + "radius\n", + "int\n", + "cap_style\n", + "int\n", + "\n", + "\n", + "\n", + "_total_plan_area_geometry_inputs->total_plan_area_geometry\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "_buildings_intersecting_plan_area_inputs\n", + "\n", + "join_predicate\n", + "str\n", + "join_lsuffix\n", + "str\n", + "join_type\n", + "str\n", + "join_rsuffix\n", + "str\n", + "\n", + "\n", + "\n", + "_buildings_intersecting_plan_area_inputs->buildings_intersecting_plan_area\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "input\n", + "\n", + "input\n", + "\n", + "\n", + "\n", + "function\n", + "\n", + "function\n", + "\n", + "\n", "\n", - "lot_area\n", - "\n", - "lot_area\n", - "Series\n", + "output\n", + "\n", + "output\n", "\n", - "\n", + "\n", + "\n" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 3, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Note: you will need graphviz to visualize the Directed Acyclic Graph (DAG)\n", + "# https://graphviz.org/download/\n", + "model.graph()" + ] + }, + { + "cell_type": "markdown", + "id": "1fac9404", + "metadata": {}, + "source": [ + "Execute the model." + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "eca2c34b680305f8", + "metadata": { + "ExecuteTime": { + "end_time": "2024-01-17T20:06:17.613667Z", + "start_time": "2024-01-17T20:06:17.180922Z" + }, + "collapsed": false, + "jupyter": { + "outputs_hidden": false + } + }, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "Naturf DAG -> Execution Complete! : 100%|██████████████| 19/19 [00:05<00:00, 3.26funcs/s]\n" + ] + } + ], + "source": [ + "df = model.execute()" + ] + }, + { + "cell_type": "markdown", + "id": "6207db02", + "metadata": {}, + "source": [ + "View the first three rows of the output dataframe. Note that `naturf` only outputs the desired columns, as specified above." + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "32c44419-f224-4e57-8958-91c3a068a9c1", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
plan_area_fractionarea_weighted_mean_of_building_heightssky_view_factor
00.0090732.6600000.168611
10.0105282.6600000.168611
20.12891720.1932420.730937
\n", + "
" + ], + "text/plain": [ + " plan_area_fraction area_weighted_mean_of_building_heights sky_view_factor\n", + "0 0.009073 2.660000 0.168611\n", + "1 0.010528 2.660000 0.168611\n", + "2 0.128917 20.193242 0.730937" + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "df.head(3)" + ] + }, + { + "cell_type": "markdown", + "id": "c9b9c2a3-5036-4b73-bc35-bea844982c7a", + "metadata": {}, + "source": [ + "## Case 2\n", + "\n", + "Now we can run the full model in order to get the required inputs to WRF. WRF requires two files: a binary file with the urban parameter data gridded and written row-by-row into binary and an index file that tells WRF where to put and how to display the data. See the [WRF User Guide](https://homepages.see.leeds.ac.uk/~lecrrb/wrf/aRWUsersGuide.pdf) for more information. The nodes `write_binary` and `write_index` will write the required files to the working directory." + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "0227eb0f-fcc1-4bf3-a14f-af3e5eae38a3", + "metadata": {}, + "outputs": [], + "source": [ + "outputs = [\"merge_parameters\", \"write_binary\", \"write_index\"]\n", + "model = driver.Model(inputs, outputs)" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "1951f504-3e4a-4f71-9c9c-be598ca93b57", + "metadata": { + "scrolled": true + }, + "outputs": [ + { + "data": { + "image/svg+xml": [ + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "cluster__legend\n", + "\n", + "Legend\n", + "\n", + "\n", + "\n", + "wall_length\n", + "\n", + "wall_length\n", + "DataFrame\n", + "\n", + "\n", + "\n", + "building_surface_area\n", + "\n", + "building_surface_area\n", + "Series\n", + "\n", + "\n", + "\n", + "wall_length->building_surface_area\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "buildings_intersecting_plan_area\n", + "\n", + "buildings_intersecting_plan_area\n", + "GeoDataFrame\n", + "\n", + "\n", "\n", - "buildings_intersecting_plan_area->lot_area\n", - "\n", - "\n", + "wall_length->buildings_intersecting_plan_area\n", + "\n", + "\n", "\n", - "\n", - "\n", - "standard_deviation_of_building_heights\n", - "\n", - "standard_deviation_of_building_heights\n", - "Series\n", + "\n", + "\n", + "average_distance_between_buildings\n", + "\n", + "average_distance_between_buildings\n", + "Series\n", "\n", - "\n", - "\n", - "buildings_intersecting_plan_area->standard_deviation_of_building_heights\n", - "\n", - "\n", + "\n", + "\n", + "height_to_width_ratio\n", + "\n", + "height_to_width_ratio\n", + "Series\n", "\n", - "\n", + "\n", + "\n", + "average_distance_between_buildings->height_to_width_ratio\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "sky_view_factor\n", + "\n", + "sky_view_factor\n", + "Series\n", + "\n", + "\n", + "\n", + "average_distance_between_buildings->sky_view_factor\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "input_shapefile_df\n", + "\n", + "input_shapefile_df\n", + "GeoDataFrame\n", + "\n", + "\n", "\n", + "target_crs\n", + "\n", + "target_crs\n", + "CRS\n", + "\n", + "\n", + "\n", + "input_shapefile_df->target_crs\n", + "\n", + "\n", + "\n", + "\n", + "\n", "standardize_column_names_df\n", - "\n", - "standardize_column_names_df\n", - "GeoDataFrame\n", + "\n", + "standardize_column_names_df\n", + "GeoDataFrame\n", "\n", - "\n", - "\n", - "filter_height_range\n", - "\n", - "filter_height_range\n", - "GeoDataFrame\n", + "\n", + "\n", + "input_shapefile_df->standardize_column_names_df\n", + "\n", + "\n", "\n", - "\n", + "\n", + "\n", + "merge_parameters\n", + "\n", + "merge_parameters\n", + "GeoDataFrame\n", + "\n", + "\n", "\n", - "standardize_column_names_df->filter_height_range\n", - "\n", - "\n", + "height_to_width_ratio->merge_parameters\n", + "\n", "\n", - "\n", - "\n", - "target_crs\n", - "\n", - "target_crs\n", - "CRS\n", + "\n", + "\n", + "standard_deviation_of_building_heights\n", + "\n", + "standard_deviation_of_building_heights\n", + "Series\n", + "\n", + "\n", + "\n", + "standard_deviation_of_building_heights->merge_parameters\n", + "\n", + "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "target_crs->buildings_intersecting_plan_area\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "write_index\n", + "\n", + "write_index\n", + "str\n", + "\n", + "\n", + "\n", + "target_crs->write_index\n", + "\n", "\n", "\n", - "\n", + "\n", "target_crs->merge_parameters\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", "\n", - "\n", - "\n", - "average_distance_between_buildings\n", - "\n", - "average_distance_between_buildings\n", - "Series\n", + "\n", + "\n", + "building_plan_area\n", + "\n", + "building_plan_area\n", + "Series\n", "\n", - "\n", + "\n", + "\n", + "plan_area_density\n", + "\n", + "plan_area_density\n", + "DataFrame\n", + "\n", + "\n", + "\n", + "building_plan_area->plan_area_density\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "plan_area_fraction\n", + "\n", + "plan_area_fraction\n", + "Series\n", + "\n", + "\n", + "\n", + "building_plan_area->plan_area_fraction\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "complete_aspect_ratio\n", + "\n", + "complete_aspect_ratio\n", + "Series\n", + "\n", + "\n", + "\n", + "building_plan_area->complete_aspect_ratio\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "mean_building_height\n", + "\n", + "mean_building_height\n", + "Series\n", + "\n", + "\n", + "\n", + "mean_building_height->height_to_width_ratio\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "mean_building_height->merge_parameters\n", + "\n", + "\n", + "\n", + "\n", + "filter_height_range\n", + "\n", + "filter_height_range\n", + "GeoDataFrame\n", + "\n", + "\n", + "\n", + "standardize_column_names_df->filter_height_range\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "rasterize_parameters\n", + "\n", + "rasterize_parameters\n", + "Dataset\n", + "\n", + "\n", + "\n", + "aggregate_rasters\n", + "\n", + "aggregate_rasters\n", + "Dataset\n", + "\n", + "\n", "\n", - "distance_between_buildings->average_distance_between_buildings\n", - "\n", - "\n", + "rasterize_parameters->aggregate_rasters\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "frontal_length\n", + "\n", + "frontal_length\n", + "DataFrame\n", + "\n", + "\n", + "\n", + "frontal_area_density\n", + "\n", + "frontal_area_density\n", + "DataFrame\n", "\n", "\n", - "\n", + "\n", "frontal_length->frontal_area_density\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "frontal_area\n", + "\n", + "frontal_area\n", + "DataFrame\n", "\n", "\n", - "\n", + "\n", "frontal_length->frontal_area\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "height_to_width_ratio\n", - "\n", - "height_to_width_ratio\n", - "Series\n", + "\n", + "\n", "\n", - "\n", - "\n", - "average_distance_between_buildings->height_to_width_ratio\n", - "\n", - "\n", + "\n", + "\n", + "grimmond_oke_displacement_height\n", + "\n", + "grimmond_oke_displacement_height\n", + "Series\n", "\n", - "\n", - "\n", - "average_distance_between_buildings->sky_view_factor\n", - "\n", - "\n", + "\n", + "\n", + "grimmond_oke_displacement_height->merge_parameters\n", + "\n", + "\n", "\n", - "\n", - "\n", - "building_surface_area_to_plan_area_ratio\n", - "\n", - "building_surface_area_to_plan_area_ratio\n", - "Series\n", + "\n", + "\n", + "rooftop_area_density\n", + "\n", + "rooftop_area_density\n", + "DataFrame\n", "\n", - "\n", - "\n", - "building_surface_area->building_surface_area_to_plan_area_ratio\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "plan_area_density->rooftop_area_density\n", + "\n", + "\n", "\n", - "\n", - "\n", - "building_surface_area->lot_area\n", - "\n", - "\n", + "\n", + "\n", + "plan_area_density->merge_parameters\n", + "\n", "\n", - "\n", + "\n", "\n", - "complete_aspect_ratio\n", - "\n", - "complete_aspect_ratio\n", - "Series\n", + "building_geometry\n", + "\n", + "building_geometry\n", + "GeoSeries\n", "\n", - "\n", + "\n", + "\n", + "filter_height_range->building_geometry\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "building_id\n", + "\n", + "building_id\n", + "GeoSeries\n", + "\n", + "\n", "\n", - "building_surface_area->complete_aspect_ratio\n", - "\n", - "\n", + "filter_height_range->building_id\n", + "\n", + "\n", "\n", - "\n", - "\n", - "building_surface_area_to_plan_area_ratio->merge_parameters\n", - "\n", + "\n", + "\n", + "building_height\n", + "\n", + "building_height\n", + "GeoSeries\n", "\n", - "\n", - "\n", - "input_shapefile_df\n", - "\n", - "input_shapefile_df\n", - "GeoDataFrame\n", + "\n", + "\n", + "filter_height_range->building_height\n", + "\n", + "\n", "\n", - "\n", - "\n", - "input_shapefile_df->standardize_column_names_df\n", - "\n", - "\n", + "\n", + "\n", + "raster_to_numpy\n", + "\n", + "raster_to_numpy\n", + "ndarray\n", "\n", - "\n", - "\n", - "input_shapefile_df->target_crs\n", - "\n", - "\n", + "\n", + "\n", + "write_binary\n", + "\n", + "write_binary\n", + "NoneType\n", "\n", - "\n", - "\n", - "macdonald_displacement_height->merge_parameters\n", - "\n", + "\n", + "\n", + "raster_to_numpy->write_binary\n", + "\n", + "\n", "\n", - "\n", - "\n", - "macdonald_displacement_height->macdonald_roughness_length\n", - "\n", - "\n", + "\n", + "\n", + "numpy_to_binary\n", + "\n", + "numpy_to_binary\n", + "bytes\n", "\n", - "\n", - "\n", - "raupach_displacement_height->raupach_roughness_length\n", - "\n", - "\n", + "\n", + "\n", + "raster_to_numpy->numpy_to_binary\n", + "\n", + "\n", "\n", - "\n", - "\n", - "raupach_displacement_height->merge_parameters\n", - "\n", + "\n", + "\n", + "raster_to_numpy->write_index\n", + "\n", + "\n", "\n", - "\n", - "\n", - "wall_angle_direction_length\n", - "\n", - "wall_angle_direction_length\n", - "DataFrame\n", + "\n", + "\n", + "building_surface_area_to_plan_area_ratio\n", + "\n", + "building_surface_area_to_plan_area_ratio\n", + "Series\n", "\n", - "\n", - "\n", - "wall_length\n", - "\n", - "wall_length\n", - "DataFrame\n", + "\n", + "\n", + "building_surface_area_to_plan_area_ratio->merge_parameters\n", + "\n", + "\n", "\n", - "\n", - "\n", - "wall_angle_direction_length->wall_length\n", - "\n", - "\n", + "\n", + "\n", + "rooftop_area_density->merge_parameters\n", + "\n", "\n", - "\n", - "\n", - "macdonald_roughness_length->merge_parameters\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "vertical_distribution_of_building_heights\n", + "\n", + "vertical_distribution_of_building_heights\n", + "DataFrame\n", "\n", "\n", - "\n", + "\n", "vertical_distribution_of_building_heights->merge_parameters\n", - "\n", + "\n", "\n", - "\n", - "\n", - "mean_building_height->merge_parameters\n", - "\n", + "\n", + "\n", + "sky_view_factor->merge_parameters\n", + "\n", "\n", - "\n", - "\n", - "mean_building_height->height_to_width_ratio\n", - "\n", - "\n", + "\n", + "\n", + "macdonald_roughness_length\n", + "\n", + "macdonald_roughness_length\n", + "DataFrame\n", "\n", - "\n", - "\n", - "building_plan_area->complete_aspect_ratio\n", - "\n", - "\n", + "\n", + "\n", + "macdonald_roughness_length->merge_parameters\n", + "\n", "\n", - "\n", - "\n", - "building_plan_area->plan_area_density\n", - "\n", - "\n", + "\n", + "\n", + "numpy_to_binary->write_binary\n", + "\n", + "\n", "\n", - "\n", - "\n", - "plan_area_fraction\n", - "\n", - "plan_area_fraction\n", - "Series\n", + "\n", + "\n", + "building_surface_area->building_surface_area_to_plan_area_ratio\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "lot_area\n", + "\n", + "lot_area\n", + "Series\n", + "\n", + "\n", + "\n", + "building_surface_area->lot_area\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "building_surface_area->complete_aspect_ratio\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "wall_angle_direction_length\n", + "\n", + "wall_angle_direction_length\n", + "DataFrame\n", + "\n", + "\n", + "\n", + "wall_angle_direction_length->wall_length\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "macdonald_displacement_height\n", + "\n", + "macdonald_displacement_height\n", + "Series\n", + "\n", + "\n", + "\n", + "plan_area_fraction->macdonald_displacement_height\n", + "\n", + "\n", "\n", - "\n", - "\n", - "building_plan_area->plan_area_fraction\n", - "\n", - "\n", + "\n", + "\n", + "plan_area_fraction->merge_parameters\n", + "\n", "\n", - "\n", - "\n", - "height_to_width_ratio->merge_parameters\n", - "\n", + "\n", + "\n", + "frontal_area_density->merge_parameters\n", + "\n", "\n", - "\n", - "\n", - "building_geometry\n", - "\n", - "building_geometry\n", - "GeoSeries\n", + "\n", + "\n", + "aggregate_rasters->raster_to_numpy\n", + "\n", + "\n", "\n", - "\n", - "\n", - "building_geometry->buildings_intersecting_plan_area\n", - "\n", - "\n", + "\n", + "\n", + "grimmond_oke_roughness_length\n", + "\n", + "grimmond_oke_roughness_length\n", + "Series\n", "\n", - "\n", - "\n", - "building_geometry->merge_parameters\n", - "\n", - "\n", + "\n", + "\n", + "grimmond_oke_roughness_length->merge_parameters\n", + "\n", "\n", "\n", - "\n", + "\n", "building_geometry->wall_angle_direction_length\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "total_plan_area_geometry\n", - "\n", - "total_plan_area_geometry\n", - "GeoSeries\n", + "\n", + "total_plan_area_geometry\n", + "GeoSeries\n", "\n", "\n", - "\n", + "\n", "building_geometry->total_plan_area_geometry\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "building_geometry->buildings_intersecting_plan_area\n", + "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "building_area\n", - "\n", - "building_area\n", - "Series\n", + "\n", + "building_area\n", + "Series\n", "\n", "\n", - "\n", + "\n", "building_geometry->building_area\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", "\n", - "\n", - "\n", - "area_weighted_mean_of_building_heights->merge_parameters\n", - "\n", + "\n", + "\n", + "building_geometry->write_index\n", + "\n", + "\n", + "\n", "\n", - "\n", - "\n", - "total_plan_area_geometry->buildings_intersecting_plan_area\n", - "\n", - "\n", + "\n", + "\n", + "building_geometry->merge_parameters\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "total_plan_area\n", - "\n", - "total_plan_area\n", - "Series\n", - "\n", - "\n", - "\n", - "total_plan_area_geometry->total_plan_area\n", - "\n", - "\n", + "\n", + "total_plan_area\n", + "Series\n", "\n", - "\n", - "\n", - "lot_area->macdonald_roughness_length\n", - "\n", - "\n", + "\n", + "\n", + "total_plan_area->plan_area_density\n", + "\n", + "\n", "\n", - "\n", - "\n", - "building_area->buildings_intersecting_plan_area\n", - "\n", - "\n", + "\n", + "\n", + "total_plan_area->building_surface_area_to_plan_area_ratio\n", + "\n", + "\n", "\n", - "\n", - "\n", - "building_area->building_surface_area\n", - "\n", - "\n", + "\n", + "\n", + "total_plan_area->plan_area_fraction\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "total_plan_area->frontal_area_density\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "total_plan_area->building_surface_area_to_plan_area_ratio\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "total_plan_area->complete_aspect_ratio\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "total_plan_area->plan_area_density\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "total_plan_area->plan_area_fraction\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "frontal_area_index\n", - "\n", - "frontal_area_index\n", - "DataFrame\n", + "\n", + "frontal_area_index\n", + "DataFrame\n", "\n", "\n", - "\n", + "\n", "total_plan_area->frontal_area_index\n", - "\n", - "\n", + "\n", + "\n", "\n", - "\n", + "\n", + "\n", + "raupach_roughness_length\n", + "\n", + "raupach_roughness_length\n", + "DataFrame\n", + "\n", + "\n", + "\n", + "raupach_roughness_length->merge_parameters\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "total_plan_area_geometry->total_plan_area\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "total_plan_area_geometry->buildings_intersecting_plan_area\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "frontal_area->macdonald_roughness_length\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "frontal_area->frontal_area_index\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "area_weighted_mean_of_building_heights\n", + "\n", + "area_weighted_mean_of_building_heights\n", + "Series\n", + "\n", + "\n", + "\n", + "area_weighted_mean_of_building_heights->merge_parameters\n", + "\n", + "\n", + "\n", "\n", + "lot_area->macdonald_roughness_length\n", + "\n", + "\n", + "\n", + "\n", "complete_aspect_ratio->merge_parameters\n", - "\n", + "\n", "\n", - "\n", - "\n", - "plan_area_density->merge_parameters\n", - "\n", + "\n", + "\n", + "macdonald_displacement_height->macdonald_roughness_length\n", + "\n", + "\n", "\n", - "\n", + "\n", + "\n", + "macdonald_displacement_height->merge_parameters\n", + "\n", + "\n", + "\n", "\n", - "rooftop_area_density\n", - "\n", - "rooftop_area_density\n", - "DataFrame\n", + "raupach_displacement_height\n", + "\n", + "raupach_displacement_height\n", + "DataFrame\n", "\n", - "\n", - "\n", - "plan_area_density->rooftop_area_density\n", - "\n", - "\n", + "\n", + "\n", + "raupach_displacement_height->raupach_roughness_length\n", + "\n", + "\n", "\n", - "\n", - "\n", - "building_id\n", - "\n", - "building_id\n", - "GeoSeries\n", + "\n", + "\n", + "raupach_displacement_height->merge_parameters\n", + "\n", + "\n", + "\n", "\n", - "\n", - "\n", - "building_id->buildings_intersecting_plan_area\n", - "\n", - "\n", + "\n", + "\n", + "buildings_intersecting_plan_area->standard_deviation_of_building_heights\n", + "\n", + "\n", "\n", - "\n", - "\n", - "sky_view_factor->merge_parameters\n", - "\n", + "\n", + "\n", + "buildings_intersecting_plan_area->building_plan_area\n", + "\n", + "\n", "\n", - "\n", - "\n", - "grimmond_oke_displacement_height->merge_parameters\n", - "\n", + "\n", + "\n", + "buildings_intersecting_plan_area->mean_building_height\n", + "\n", + "\n", "\n", - "\n", - "\n", - "frontal_area->macdonald_roughness_length\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "buildings_intersecting_plan_area->frontal_length\n", + "\n", + "\n", "\n", - "\n", - "\n", - "frontal_area->frontal_area_index\n", - "\n", - "\n", + "\n", + "\n", + "buildings_intersecting_plan_area->area_weighted_mean_of_building_heights\n", + "\n", + "\n", "\n", - "\n", - "\n", - "wall_length->buildings_intersecting_plan_area\n", - "\n", - "\n", + "\n", + "\n", + "buildings_intersecting_plan_area->lot_area\n", + "\n", + "\n", "\n", - "\n", - "\n", - "wall_length->building_surface_area\n", - "\n", - "\n", + "\n", + "\n", + "distance_between_buildings\n", + "\n", + "distance_between_buildings\n", + "Series\n", "\n", - "\n", - "\n", - "plan_area_fraction->merge_parameters\n", - "\n", + "\n", + "\n", + "buildings_intersecting_plan_area->distance_between_buildings\n", + "\n", + "\n", "\n", - "\n", - "\n", - "plan_area_fraction->macdonald_displacement_height\n", - "\n", - "\n", + "\n", + "\n", + "distance_between_buildings->average_distance_between_buildings\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "building_id->buildings_intersecting_plan_area\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "building_area->building_surface_area\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "building_area->buildings_intersecting_plan_area\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "frontal_area_index->raupach_roughness_length\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "frontal_area_index->raupach_displacement_height\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "frontal_area_index->merge_parameters\n", - "\n", - "\n", + "\n", "\n", - "\n", - "\n", - "frontal_area_index->raupach_displacement_height\n", - "\n", - "\n", + "\n", + "\n", + "merge_parameters->rasterize_parameters\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "building_height->grimmond_oke_displacement_height\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "building_height->plan_area_density\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "building_height->vertical_distribution_of_building_heights\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "building_height->sky_view_factor\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "building_height->macdonald_roughness_length\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "building_height->building_surface_area\n", + "\n", + "\n", "\n", - "\n", - "\n", - "rooftop_area_density->merge_parameters\n", - "\n", + "\n", + "\n", + "building_height->frontal_area_density\n", + "\n", + "\n", "\n", - "\n", - "\n", - "filter_height_range->building_height\n", - "\n", - "\n", + "\n", + "\n", + "building_height->grimmond_oke_roughness_length\n", + "\n", + "\n", "\n", - "\n", - "\n", - "filter_height_range->building_geometry\n", - "\n", - "\n", + "\n", + "\n", + "building_height->raupach_roughness_length\n", + "\n", + "\n", "\n", - "\n", - "\n", - "filter_height_range->building_id\n", - "\n", - "\n", + "\n", + "\n", + "building_height->frontal_area\n", + "\n", + "\n", "\n", - "\n", - "\n", - "standard_deviation_of_building_heights->merge_parameters\n", - "\n", - "\n", + "\n", + "\n", + "building_height->macdonald_displacement_height\n", + "\n", + "\n", "\n", - "\n", - "\n", - "_buildings_intersecting_plan_area_inputs\n", - "\n", - "join_lsuffix\n", - "str\n", - "join_predicate\n", - "str\n", - "join_rsuffix\n", - "str\n", - "join_type\n", - "str\n", + "\n", + "\n", + "building_height->raupach_displacement_height\n", + "\n", + "\n", "\n", - "\n", - "\n", - "_buildings_intersecting_plan_area_inputs->buildings_intersecting_plan_area\n", - "\n", - "\n", + "\n", + "\n", + "building_height->buildings_intersecting_plan_area\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "_input_shapefile_df_inputs\n", - "\n", - "input_shapefile\n", - "str\n", + "\n", + "input_shapefile\n", + "str\n", "\n", "\n", - "\n", + "\n", "_input_shapefile_df_inputs->input_shapefile_df\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "_building_plan_area_inputs\n", - "\n", - "join_predicate\n", - "str\n", - "join_rsuffix\n", - "str\n", + "\n", + "join_predicate\n", + "str\n", + "join_rsuffix\n", + "str\n", "\n", "\n", - "\n", + "\n", "_building_plan_area_inputs->building_plan_area\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "_total_plan_area_geometry_inputs\n", - "\n", - "radius\n", - "int\n", - "cap_style\n", - "int\n", + "\n", + "radius\n", + "int\n", + "cap_style\n", + "int\n", "\n", "\n", - "\n", + "\n", "_total_plan_area_geometry_inputs->total_plan_area_geometry\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "_buildings_intersecting_plan_area_inputs\n", + "\n", + "join_predicate\n", + "str\n", + "join_lsuffix\n", + "str\n", + "join_type\n", + "str\n", + "join_rsuffix\n", + "str\n", + "\n", + "\n", + "\n", + "_buildings_intersecting_plan_area_inputs->buildings_intersecting_plan_area\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "_write_index_inputs\n", + "\n", + "index_filename\n", + "str\n", + "\n", + "\n", + "\n", + "_write_index_inputs->write_index\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "input\n", - "\n", - "input\n", + "\n", + "input\n", "\n", "\n", - "\n", + "\n", "function\n", - "\n", - "function\n", + "\n", + "function\n", "\n", "\n", - "\n", + "\n", "output\n", - "\n", - "output\n", + "\n", + "output\n", "\n", "\n", "\n" ], "text/plain": [ - "" + "" ] }, - "execution_count": 3, + "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "# Note: you will need graphviz to visualize the Directed Acyclic Graph (DAG)\n", - "# https://graphviz.org/download/\n", "model.graph()" ] }, { "cell_type": "code", - "execution_count": 4, - "id": "eca2c34b680305f8", - "metadata": { - "ExecuteTime": { - "end_time": "2024-01-17T20:06:17.613667Z", - "start_time": "2024-01-17T20:06:17.180922Z" - }, - "collapsed": false, - "jupyter": { - "outputs_hidden": false - } - }, + "execution_count": 8, + "id": "a07e303a-5d78-4b0d-8ae2-1e46e3ac8bfb", + "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ - "Naturf DAG -> Execution Complete! : 100%|███████████| 40/40 [00:05<00:00, 6.80funcs/s]\n" + "Naturf DAG -> Execution Complete! : 100%|███████████| 46/46 [00:08<00:00, 5.14funcs/s]\n", + "WARNING: a single pandas index was found, but there are also 2 outputs without an index. Please check whether the dataframe created matches what what you expect to happen.\n" ] - }, + } + ], + "source": [ + "df = model.execute()" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "id": "6e055093", + "metadata": {}, + "outputs": [ { "data": { "text/html": [ @@ -1035,27 +1705,27 @@ " \n", " \n", " \n", - " frontal_area_north_0\n", - " frontal_area_north_1\n", - " frontal_area_north_2\n", - " frontal_area_north_3\n", - " frontal_area_north_4\n", - " frontal_area_north_5\n", - " frontal_area_north_6\n", - " frontal_area_north_7\n", - " frontal_area_north_8\n", - " frontal_area_north_9\n", + " merge_parameters.frontal_area_north_0\n", + " merge_parameters.frontal_area_north_1\n", + " merge_parameters.frontal_area_north_2\n", + " merge_parameters.frontal_area_north_3\n", + " merge_parameters.frontal_area_north_4\n", + " merge_parameters.frontal_area_north_5\n", + " merge_parameters.frontal_area_north_6\n", + " merge_parameters.frontal_area_north_7\n", + " merge_parameters.frontal_area_north_8\n", + " merge_parameters.frontal_area_north_9\n", " ...\n", - " vertical_distribution_of_building_heights_6\n", - " vertical_distribution_of_building_heights_7\n", - " vertical_distribution_of_building_heights_8\n", - " vertical_distribution_of_building_heights_9\n", - " vertical_distribution_of_building_heights_10\n", - " vertical_distribution_of_building_heights_11\n", - " vertical_distribution_of_building_heights_12\n", - " vertical_distribution_of_building_heights_13\n", - " vertical_distribution_of_building_heights_14\n", - " building_geometry\n", + " merge_parameters.vertical_distribution_of_building_heights_9\n", + " merge_parameters.vertical_distribution_of_building_heights_10\n", + " merge_parameters.vertical_distribution_of_building_heights_11\n", + " merge_parameters.vertical_distribution_of_building_heights_12\n", + " merge_parameters.vertical_distribution_of_building_heights_13\n", + " merge_parameters.vertical_distribution_of_building_heights_14\n", + " merge_parameters.building_geometry\n", + " merge_parameters.building_count\n", + " write_binary\n", + " write_index\n", " \n", " \n", " \n", @@ -1067,21 +1737,21 @@ " 0.000000\n", " 0.000000\n", " 0.000000\n", - " 0.000000\n", - " 0.000000\n", - " 0\n", - " 0\n", - " ...\n", " 0.0\n", " 0.0\n", " 0\n", " 0\n", + " ...\n", + " 0\n", " 0\n", " 0\n", " 0\n", " 0\n", " 0\n", " POLYGON ((-77.04892 38.87526, -77.04893 38.875...\n", + " 1\n", + " None\n", + " None\n", " \n", " \n", " 1\n", @@ -1091,21 +1761,21 @@ " 0.000000\n", " 0.000000\n", " 0.000000\n", - " 0.000000\n", - " 0.000000\n", - " 0\n", - " 0\n", - " ...\n", " 0.0\n", " 0.0\n", " 0\n", " 0\n", + " ...\n", + " 0\n", " 0\n", " 0\n", " 0\n", " 0\n", " 0\n", " POLYGON ((-77.04882 38.87532, -77.04884 38.875...\n", + " 1\n", + " None\n", + " None\n", " \n", " \n", " 2\n", @@ -1115,21 +1785,21 @@ " 0.019133\n", " 0.019133\n", " 0.001569\n", - " 0.000000\n", - " 0.000000\n", - " 0\n", - " 0\n", - " ...\n", " 0.0\n", " 0.0\n", " 0\n", " 0\n", + " ...\n", + " 0\n", " 0\n", " 0\n", " 0\n", " 0\n", " 0\n", " POLYGON ((-77.02035 38.87679, -77.02036 38.876...\n", + " 1\n", + " None\n", + " None\n", " \n", " \n", " 3\n", @@ -1139,21 +1809,21 @@ " 0.000000\n", " 0.000000\n", " 0.000000\n", - " 0.000000\n", - " 0.000000\n", - " 0\n", - " 0\n", - " ...\n", " 0.0\n", " 0.0\n", " 0\n", " 0\n", + " ...\n", + " 0\n", " 0\n", " 0\n", " 0\n", " 0\n", " 0\n", " POLYGON ((-77.02585 38.87985, -77.02589 38.879...\n", + " 1\n", + " None\n", + " None\n", " \n", " \n", " 4\n", @@ -1163,351 +1833,172 @@ " 0.000000\n", " 0.000000\n", " 0.000000\n", - " 0.000000\n", - " 0.000000\n", - " 0\n", - " 0\n", - " ...\n", - " 0.0\n", - " 0.0\n", - " 0\n", - " 0\n", - " 0\n", - " 0\n", - " 0\n", - " 0\n", - " 0\n", - " POLYGON ((-77.02369 38.87912, -77.02309 38.878...\n", - " \n", - " \n", - " ...\n", - " ...\n", - " ...\n", - " ...\n", - " ...\n", - " ...\n", - " ...\n", - " ...\n", - " ...\n", - " ...\n", - " ...\n", - " ...\n", - " ...\n", - " ...\n", - " ...\n", - " ...\n", - " ...\n", - " ...\n", - " ...\n", - " ...\n", - " ...\n", - " ...\n", - " \n", - " \n", - " 187\n", - " 0.072072\n", - " 0.000000\n", - " 0.000000\n", - " 0.000000\n", - " 0.000000\n", - " 0.000000\n", - " 0.000000\n", - " 0.000000\n", - " 0\n", - " 0\n", - " ...\n", - " 0.0\n", - " 0.0\n", - " 0\n", - " 0\n", - " 0\n", - " 0\n", - " 0\n", - " 0\n", - " 0\n", - " POLYGON ((-77.03181 38.87756, -77.03183 38.877...\n", - " \n", - " \n", - " 188\n", - " 0.002350\n", - " 0.000000\n", - " 0.000000\n", - " 0.000000\n", - " 0.000000\n", - " 0.000000\n", - " 0.000000\n", - " 0.000000\n", - " 0\n", - " 0\n", - " ...\n", - " 0.0\n", - " 0.0\n", - " 0\n", - " 0\n", - " 0\n", - " 0\n", - " 0\n", - " 0\n", - " 0\n", - " POLYGON ((-77.02977 38.88182, -77.02976 38.881...\n", - " \n", - " \n", - " 189\n", - " 0.042610\n", - " 0.042610\n", - " 0.025907\n", - " 0.000000\n", - " 0.000000\n", - " 0.000000\n", - " 0.000000\n", - " 0.000000\n", - " 0\n", - " 0\n", - " ...\n", " 0.0\n", " 0.0\n", " 0\n", " 0\n", - " 0\n", - " 0\n", - " 0\n", - " 0\n", - " 0\n", - " POLYGON ((-77.03133 38.87911, -77.03136 38.879...\n", - " \n", - " \n", - " 190\n", - " 0.003648\n", - " 0.003648\n", - " 0.003648\n", - " 0.003648\n", - " 0.003648\n", - " 0.003648\n", - " 0.003648\n", - " 0.000752\n", - " 0\n", - " 0\n", - " ...\n", - " 1.0\n", - " 1.0\n", - " 0\n", - " 0\n", - " 0\n", - " 0\n", - " 0\n", - " 0\n", - " 0\n", - " POLYGON ((-77.03638 38.88165, -77.03638 38.881...\n", - " \n", - " \n", - " 191\n", - " 0.032901\n", - " 0.015003\n", - " 0.000000\n", - " 0.000000\n", - " 0.000000\n", - " 0.000000\n", - " 0.000000\n", - " 0.000000\n", - " 0\n", - " 0\n", " ...\n", - " 0.0\n", - " 0.0\n", " 0\n", " 0\n", " 0\n", " 0\n", " 0\n", " 0\n", - " 0\n", - " POLYGON ((-77.03254 38.87862, -77.03274 38.878...\n", + " POLYGON ((-77.02369 38.87912, -77.02309 38.878...\n", + " 1\n", + " None\n", + " None\n", " \n", " \n", "\n", - "

192 rows × 133 columns

\n", + "

5 rows × 136 columns

\n", "" ], "text/plain": [ - " frontal_area_north_0 frontal_area_north_1 frontal_area_north_2 \\\n", - "0 0.001903 0.000000 0.000000 \n", - "1 0.002208 0.000000 0.000000 \n", - "2 0.019133 0.019133 0.019133 \n", - "3 0.023445 0.023445 0.009331 \n", - "4 0.036085 0.036085 0.018620 \n", - ".. ... ... ... \n", - "187 0.072072 0.000000 0.000000 \n", - "188 0.002350 0.000000 0.000000 \n", - "189 0.042610 0.042610 0.025907 \n", - "190 0.003648 0.003648 0.003648 \n", - "191 0.032901 0.015003 0.000000 \n", + " merge_parameters.frontal_area_north_0 \\\n", + "0 0.001903 \n", + "1 0.002208 \n", + "2 0.019133 \n", + "3 0.023445 \n", + "4 0.036085 \n", + "\n", + " merge_parameters.frontal_area_north_1 \\\n", + "0 0.000000 \n", + "1 0.000000 \n", + "2 0.019133 \n", + "3 0.023445 \n", + "4 0.036085 \n", + "\n", + " merge_parameters.frontal_area_north_2 \\\n", + "0 0.000000 \n", + "1 0.000000 \n", + "2 0.019133 \n", + "3 0.009331 \n", + "4 0.018620 \n", + "\n", + " merge_parameters.frontal_area_north_3 \\\n", + "0 0.000000 \n", + "1 0.000000 \n", + "2 0.019133 \n", + "3 0.000000 \n", + "4 0.000000 \n", + "\n", + " merge_parameters.frontal_area_north_4 \\\n", + "0 0.000000 \n", + "1 0.000000 \n", + "2 0.019133 \n", + "3 0.000000 \n", + "4 0.000000 \n", "\n", - " frontal_area_north_3 frontal_area_north_4 frontal_area_north_5 \\\n", - "0 0.000000 0.000000 0.000000 \n", - "1 0.000000 0.000000 0.000000 \n", - "2 0.019133 0.019133 0.001569 \n", - "3 0.000000 0.000000 0.000000 \n", - "4 0.000000 0.000000 0.000000 \n", - ".. ... ... ... \n", - "187 0.000000 0.000000 0.000000 \n", - "188 0.000000 0.000000 0.000000 \n", - "189 0.000000 0.000000 0.000000 \n", - "190 0.003648 0.003648 0.003648 \n", - "191 0.000000 0.000000 0.000000 \n", + " merge_parameters.frontal_area_north_5 \\\n", + "0 0.000000 \n", + "1 0.000000 \n", + "2 0.001569 \n", + "3 0.000000 \n", + "4 0.000000 \n", "\n", - " frontal_area_north_6 frontal_area_north_7 frontal_area_north_8 \\\n", - "0 0.000000 0.000000 0 \n", - "1 0.000000 0.000000 0 \n", - "2 0.000000 0.000000 0 \n", - "3 0.000000 0.000000 0 \n", - "4 0.000000 0.000000 0 \n", - ".. ... ... ... \n", - "187 0.000000 0.000000 0 \n", - "188 0.000000 0.000000 0 \n", - "189 0.000000 0.000000 0 \n", - "190 0.003648 0.000752 0 \n", - "191 0.000000 0.000000 0 \n", + " merge_parameters.frontal_area_north_6 \\\n", + "0 0.0 \n", + "1 0.0 \n", + "2 0.0 \n", + "3 0.0 \n", + "4 0.0 \n", "\n", - " frontal_area_north_9 ... vertical_distribution_of_building_heights_6 \\\n", - "0 0 ... 0.0 \n", - "1 0 ... 0.0 \n", - "2 0 ... 0.0 \n", - "3 0 ... 0.0 \n", - "4 0 ... 0.0 \n", - ".. ... ... ... \n", - "187 0 ... 0.0 \n", - "188 0 ... 0.0 \n", - "189 0 ... 0.0 \n", - "190 0 ... 1.0 \n", - "191 0 ... 0.0 \n", + " merge_parameters.frontal_area_north_7 \\\n", + "0 0.0 \n", + "1 0.0 \n", + "2 0.0 \n", + "3 0.0 \n", + "4 0.0 \n", "\n", - " vertical_distribution_of_building_heights_7 \\\n", - "0 0.0 \n", - "1 0.0 \n", - "2 0.0 \n", - "3 0.0 \n", - "4 0.0 \n", - ".. ... \n", - "187 0.0 \n", - "188 0.0 \n", - "189 0.0 \n", - "190 1.0 \n", - "191 0.0 \n", + " merge_parameters.frontal_area_north_8 \\\n", + "0 0 \n", + "1 0 \n", + "2 0 \n", + "3 0 \n", + "4 0 \n", "\n", - " vertical_distribution_of_building_heights_8 \\\n", - "0 0 \n", - "1 0 \n", - "2 0 \n", - "3 0 \n", - "4 0 \n", - ".. ... \n", - "187 0 \n", - "188 0 \n", - "189 0 \n", - "190 0 \n", - "191 0 \n", + " merge_parameters.frontal_area_north_9 ... \\\n", + "0 0 ... \n", + "1 0 ... \n", + "2 0 ... \n", + "3 0 ... \n", + "4 0 ... \n", "\n", - " vertical_distribution_of_building_heights_9 \\\n", - "0 0 \n", - "1 0 \n", - "2 0 \n", - "3 0 \n", - "4 0 \n", - ".. ... \n", - "187 0 \n", - "188 0 \n", - "189 0 \n", - "190 0 \n", - "191 0 \n", + " merge_parameters.vertical_distribution_of_building_heights_9 \\\n", + "0 0 \n", + "1 0 \n", + "2 0 \n", + "3 0 \n", + "4 0 \n", "\n", - " vertical_distribution_of_building_heights_10 \\\n", - "0 0 \n", - "1 0 \n", - "2 0 \n", - "3 0 \n", - "4 0 \n", - ".. ... \n", - "187 0 \n", - "188 0 \n", - "189 0 \n", - "190 0 \n", - "191 0 \n", + " merge_parameters.vertical_distribution_of_building_heights_10 \\\n", + "0 0 \n", + "1 0 \n", + "2 0 \n", + "3 0 \n", + "4 0 \n", "\n", - " vertical_distribution_of_building_heights_11 \\\n", - "0 0 \n", - "1 0 \n", - "2 0 \n", - "3 0 \n", - "4 0 \n", - ".. ... \n", - "187 0 \n", - "188 0 \n", - "189 0 \n", - "190 0 \n", - "191 0 \n", + " merge_parameters.vertical_distribution_of_building_heights_11 \\\n", + "0 0 \n", + "1 0 \n", + "2 0 \n", + "3 0 \n", + "4 0 \n", "\n", - " vertical_distribution_of_building_heights_12 \\\n", - "0 0 \n", - "1 0 \n", - "2 0 \n", - "3 0 \n", - "4 0 \n", - ".. ... \n", - "187 0 \n", - "188 0 \n", - "189 0 \n", - "190 0 \n", - "191 0 \n", + " merge_parameters.vertical_distribution_of_building_heights_12 \\\n", + "0 0 \n", + "1 0 \n", + "2 0 \n", + "3 0 \n", + "4 0 \n", "\n", - " vertical_distribution_of_building_heights_13 \\\n", - "0 0 \n", - "1 0 \n", - "2 0 \n", - "3 0 \n", - "4 0 \n", - ".. ... \n", - "187 0 \n", - "188 0 \n", - "189 0 \n", - "190 0 \n", - "191 0 \n", + " merge_parameters.vertical_distribution_of_building_heights_13 \\\n", + "0 0 \n", + "1 0 \n", + "2 0 \n", + "3 0 \n", + "4 0 \n", "\n", - " vertical_distribution_of_building_heights_14 \\\n", - "0 0 \n", - "1 0 \n", - "2 0 \n", - "3 0 \n", - "4 0 \n", - ".. ... \n", - "187 0 \n", - "188 0 \n", - "189 0 \n", - "190 0 \n", - "191 0 \n", + " merge_parameters.vertical_distribution_of_building_heights_14 \\\n", + "0 0 \n", + "1 0 \n", + "2 0 \n", + "3 0 \n", + "4 0 \n", "\n", - " building_geometry \n", - "0 POLYGON ((-77.04892 38.87526, -77.04893 38.875... \n", - "1 POLYGON ((-77.04882 38.87532, -77.04884 38.875... \n", - "2 POLYGON ((-77.02035 38.87679, -77.02036 38.876... \n", - "3 POLYGON ((-77.02585 38.87985, -77.02589 38.879... \n", - "4 POLYGON ((-77.02369 38.87912, -77.02309 38.878... \n", - ".. ... \n", - "187 POLYGON ((-77.03181 38.87756, -77.03183 38.877... \n", - "188 POLYGON ((-77.02977 38.88182, -77.02976 38.881... \n", - "189 POLYGON ((-77.03133 38.87911, -77.03136 38.879... \n", - "190 POLYGON ((-77.03638 38.88165, -77.03638 38.881... \n", - "191 POLYGON ((-77.03254 38.87862, -77.03274 38.878... \n", + " merge_parameters.building_geometry \\\n", + "0 POLYGON ((-77.04892 38.87526, -77.04893 38.875... \n", + "1 POLYGON ((-77.04882 38.87532, -77.04884 38.875... \n", + "2 POLYGON ((-77.02035 38.87679, -77.02036 38.876... \n", + "3 POLYGON ((-77.02585 38.87985, -77.02589 38.879... \n", + "4 POLYGON ((-77.02369 38.87912, -77.02309 38.878... \n", "\n", - "[192 rows x 133 columns]" + " merge_parameters.building_count write_binary write_index \n", + "0 1 None None \n", + "1 1 None None \n", + "2 1 None None \n", + "3 1 None None \n", + "4 1 None None \n", + "\n", + "[5 rows x 136 columns]" ] }, - "execution_count": 4, + "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "model.execute()" + "df.head()" + ] + }, + { + "cell_type": "markdown", + "id": "6f8271e2", + "metadata": {}, + "source": [ + "We have 136 columns here, which are the 132 output parameters plus 4 other parameters: `merge_parameters.building_geometry`, `merge_parameters.building_count`, `write_binary`, and `write_index`. " ] }, { @@ -1517,9 +2008,9 @@ "source": [ "## Optional: DAGWorks Interactive Dashboard\n", "\n", - "Since we're using `hamilton` to run `naturf`, users can log each run to DAGWorks (researchers/academics have access to the free tier) by signing up at www.dagworks.io and creating a project. Then either set the environment variables DAGWORKS_API_KEY, DAGWORKS_USERNAME, and DAGWORKS_PROJECT_ID below or set it on the module directly.\n", + "Since we're using `hamilton` to run `naturf`, users can log each run to DAGWorks (researchers/academics have access to the free tier) by signing up at [dagworks.io](www.dagworks.io) and creating a project. Then either set the environment variables `DAGWORKS_API_KEY`, `DAGWORKS_USERNAME`, and `DAGWORKS_PROJECT_ID` below or set it in the module directly.\n", "\n", - "Note: The cell below is in the \"raw\" format, if you want to run it, change the cell type to \"python\"." + "Note: The cell below is in the `raw` format, if you want to run it, change the cell type to `python`." ] }, { diff --git a/paper/paper.pdf b/paper/paper.pdf deleted file mode 100644 index 8d8b855a29..0000000000 Binary files a/paper/paper.pdf and /dev/null differ