{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Drawing and Highlighting" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "ename": "NameError", "evalue": "name 'os' is not defined", "output_type": "error", "traceback": [ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)", "Cell \u001b[0;32mIn[1], line 10\u001b[0m\n\u001b[1;32m 4\u001b[0m logger\u001b[38;5;241m.\u001b[39msetLevel(logging\u001b[38;5;241m.\u001b[39mCRITICAL)\n\u001b[1;32m 6\u001b[0m \u001b[38;5;66;03m# Determines where configuration file is located\u001b[39;00m\n\u001b[1;32m 7\u001b[0m \u001b[38;5;66;03m# file contains directory info and model input settings\u001b[39;00m\n\u001b[1;32m 8\u001b[0m config_file \u001b[38;5;241m=\u001b[39m os\u001b[38;5;241m.\u001b[39menviron[\n\u001b[1;32m 9\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mCANOPYHYDRO_CONFIG\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[0;32m---> 10\u001b[0m ] \u001b[38;5;241m=\u001b[39m \u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;132;01m{\u001b[39;00m\u001b[43mos\u001b[49m\u001b[38;5;241m.\u001b[39mgetcwd()\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m/canopyhydro_config.toml\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 11\u001b[0m log_config \u001b[38;5;241m=\u001b[39m os\u001b[38;5;241m.\u001b[39menviron[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mCANOPYHYDRO_LOG_CONFIG\u001b[39m\u001b[38;5;124m\"\u001b[39m] \u001b[38;5;241m=\u001b[39m \u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;132;01m{\u001b[39;00mos\u001b[38;5;241m.\u001b[39mgetcwd()\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m/logging_config.yml\u001b[39m\u001b[38;5;124m\"\u001b[39m\n", "\u001b[0;31mNameError\u001b[0m: name 'os' is not defined" ] } ], "source": [ "\n", "\n", "# Determines where configuration file is located\n", "# file contains directory info and model input settings\n", "# config_file = os.environ[\n", "# \"CANOPYHYDRO_CONFIG\"\n", "# ] = f\"{os.getcwd()}/canopyhydro_config.toml\"\n", "# log_config = os.environ[\"CANOPYHYDRO_LOG_CONFIG\"] = f\"{os.getcwd()}/logging_config.yml\"\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Let's first discuss our low code approach to figure creation \\\n", "Examine the output produced by the following two cells. Note that their outputs are the same,but the former uses quite a bit more code. " ] }, { "cell_type": "markdown", "metadata": {}, "source": [] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
2024.10.14 21:20:00.045 |MainThread | INFO | CylinderCollection.py:291 - from_csv() | model - Processing <_io.TextIOWrapper name='./data/input/example_tree.csv' mode='r' encoding='UTF-8'>\n",
"\n"
],
"text/plain": [
"2024.10.14 21:20:00.045 |MainThread | INFO | CylinderCollection.py:291 - from_csv() | model - Processing <_io.TextIOWrapper name='./data/input/example_tree.csv' mode='r' encoding='UTF-8'>\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"2024.10.14 21:20:00.734 |MainThread | INFO | CylinderCollection.py:320 - from_csv() | model - ./data/input/example_tree.csv initialized with 9998 cylinders\n",
"\n"
],
"text/plain": [
"2024.10.14 21:20:00.734 |MainThread | INFO | CylinderCollection.py:320 - from_csv() | model - ./data/input/example_tree.csv initialized with 9998 cylinders\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"2024.10.14 21:20:00.737 |MainThread | INFO | CylinderCollection.py:335 - project_cylinders() | model - Projection into XZ axis begun for file example_tree.csv\n",
"\n"
],
"text/plain": [
"2024.10.14 21:20:00.737 |MainThread | INFO | CylinderCollection.py:335 - project_cylinders() | model - Projection into XZ axis begun for file example_tree.csv\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"2024.10.14 21:20:16.357 |MainThread | INFO | utils.py:190 - intermitent_log() | model - Cylinder projection: 44.3\n",
"\n"
],
"text/plain": [
"2024.10.14 21:20:16.357 |MainThread | INFO | utils.py:190 - intermitent_log() | model - Cylinder projection: 44.3\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Cylinder projection: 44.3\n"
]
},
{
"data": {
"text/html": [
"2024.10.14 21:20:35.224 |MainThread | INFO | CylinderCollection.py:344 - project_cylinders() | model - Projection into XZ axis complete for file example_tree.csv\n",
"\n"
],
"text/plain": [
"2024.10.14 21:20:35.224 |MainThread | INFO | CylinderCollection.py:344 - project_cylinders() | model - Projection into XZ axis complete for file example_tree.csv\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"2024.10.14 21:20:35.333 |MainThread | INFO | CylinderCollection.py:400 - draw() | model - 9998 cylinders matched criteria\n",
"\n"
],
"text/plain": [
"2024.10.14 21:20:35.333 |MainThread | INFO | CylinderCollection.py:400 - draw() | model - 9998 cylinders matched criteria\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"2024.10.14 21:20:35.339 |MainThread | INFO | geometry.py:563 - draw_cyls() | model - Plotting cylinder collection\n",
"\n"
],
"text/plain": [
"2024.10.14 21:20:35.339 |MainThread | INFO | geometry.py:563 - draw_cyls() | model - Plotting cylinder collection\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"2024.10.14 21:20:38.549 |MainThread | INFO | CylinderCollection.py:335 - project_cylinders() | model - Projection into YZ axis begun for file example_tree.csv\n",
"\n"
],
"text/plain": [
"2024.10.14 21:20:38.549 |MainThread | INFO | CylinderCollection.py:335 - project_cylinders() | model - Projection into YZ axis begun for file example_tree.csv\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"2024.10.14 21:21:18.265 |MainThread | INFO | CylinderCollection.py:344 - project_cylinders() | model - Projection into YZ axis complete for file example_tree.csv\n",
"\n"
],
"text/plain": [
"2024.10.14 21:21:18.265 |MainThread | INFO | CylinderCollection.py:344 - project_cylinders() | model - Projection into YZ axis complete for file example_tree.csv\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"2024.10.14 21:21:18.302 |MainThread | INFO | CylinderCollection.py:400 - draw() | model - 9998 cylinders matched criteria\n",
"\n"
],
"text/plain": [
"2024.10.14 21:21:18.302 |MainThread | INFO | CylinderCollection.py:400 - draw() | model - 9998 cylinders matched criteria\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"2024.10.14 21:21:18.308 |MainThread | INFO | geometry.py:563 - draw_cyls() | model - Plotting cylinder collection\n",
"\n"
],
"text/plain": [
"2024.10.14 21:21:18.308 |MainThread | INFO | geometry.py:563 - draw_cyls() | model - Plotting cylinder collection\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"2024.10.14 21:21:22.928 |MainThread | INFO | CylinderCollection.py:335 - project_cylinders() | model - Projection into XY axis begun for file example_tree.csv\n",
"\n"
],
"text/plain": [
"2024.10.14 21:21:22.928 |MainThread | INFO | CylinderCollection.py:335 - project_cylinders() | model - Projection into XY axis begun for file example_tree.csv\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"2024.10.14 21:21:57.637 |MainThread | INFO | CylinderCollection.py:344 - project_cylinders() | model - Projection into XY axis complete for file example_tree.csv\n",
"\n"
],
"text/plain": [
"2024.10.14 21:21:57.637 |MainThread | INFO | CylinderCollection.py:344 - project_cylinders() | model - Projection into XY axis complete for file example_tree.csv\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"2024.10.14 21:21:57.666 |MainThread | INFO | CylinderCollection.py:400 - draw() | model - 9998 cylinders matched criteria\n",
"\n"
],
"text/plain": [
"2024.10.14 21:21:57.666 |MainThread | INFO | CylinderCollection.py:400 - draw() | model - 9998 cylinders matched criteria\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"2024.10.14 21:21:57.671 |MainThread | INFO | geometry.py:563 - draw_cyls() | model - Plotting cylinder collection\n",
"\n"
],
"text/plain": [
"2024.10.14 21:21:57.671 |MainThread | INFO | geometry.py:563 - draw_cyls() | model - Plotting cylinder collection\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"2024.10.14 21:22:04.682 |MainThread | INFO | CylinderCollection.py:400 - draw() | model - 9998 cylinders matched criteria\n",
"\n"
],
"text/plain": [
"2024.10.14 21:22:04.682 |MainThread | INFO | CylinderCollection.py:400 - draw() | model - 9998 cylinders matched criteria\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"2024.10.14 21:22:04.688 |MainThread | INFO | geometry.py:563 - draw_cyls() | model - Plotting cylinder collection\n",
"\n"
],
"text/plain": [
"2024.10.14 21:22:04.688 |MainThread | INFO | geometry.py:563 - draw_cyls() | model - Plotting cylinder collection\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"2024.10.14 21:22:08.202 |MainThread | INFO | CylinderCollection.py:400 - draw() | model - 9998 cylinders matched criteria\n",
"\n"
],
"text/plain": [
"2024.10.14 21:22:08.202 |MainThread | INFO | CylinderCollection.py:400 - draw() | model - 9998 cylinders matched criteria\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"2024.10.14 21:22:08.213 |MainThread | INFO | geometry.py:563 - draw_cyls() | model - Plotting cylinder collection\n",
"\n"
],
"text/plain": [
"2024.10.14 21:22:08.213 |MainThread | INFO | geometry.py:563 - draw_cyls() | model - Plotting cylinder collection\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"2024.10.14 21:22:11.427 |MainThread | INFO | CylinderCollection.py:400 - draw() | model - 9998 cylinders matched criteria\n",
"\n"
],
"text/plain": [
"2024.10.14 21:22:11.427 |MainThread | INFO | CylinderCollection.py:400 - draw() | model - 9998 cylinders matched criteria\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"2024.10.14 21:22:11.433 |MainThread | INFO | geometry.py:563 - draw_cyls() | model - Plotting cylinder collection\n",
"\n"
],
"text/plain": [
"2024.10.14 21:22:11.433 |MainThread | INFO | geometry.py:563 - draw_cyls() | model - Plotting cylinder collection\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"2024.10.14 21:23:19.995 |MainThread | INFO | CylinderCollection.py:400 - draw() | model - 9998 cylinders matched criteria\n",
"\n"
],
"text/plain": [
"2024.10.14 21:23:19.995 |MainThread | INFO | CylinderCollection.py:400 - draw() | model - 9998 cylinders matched criteria\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"2024.10.14 21:23:20.001 |MainThread | WARNING | CylinderCollection.py:422 - draw() | model - No XY plane alpha shape found. Running watershed_boundary\n",
"\n"
],
"text/plain": [
"2024.10.14 21:23:20.001 |MainThread | WARNING | CylinderCollection.py:422 - draw() | model - No XY plane alpha shape found. Running watershed_boundary\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"2024.10.14 21:23:20.005 |MainThread | WARNING | CylinderCollection.py:493 - get_end_nodes() | model - Graph not initialized, running initialize_graph_from with default values\n",
"\n"
],
"text/plain": [
"2024.10.14 21:23:20.005 |MainThread | WARNING | CylinderCollection.py:493 - get_end_nodes() | model - Graph not initialized, running initialize_graph_from with default values\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"2024.10.14 21:23:25.943 |MainThread | INFO | geometry.py:563 - draw_cyls() | model - Plotting cylinder collection\n",
"\n"
],
"text/plain": [
"2024.10.14 21:23:25.943 |MainThread | INFO | geometry.py:563 - draw_cyls() | model - Plotting cylinder collection\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"2024.10.14 21:23:29.227 |MainThread | ERROR | geometry.py:591 - draw_cyls() | model - Overlay must be a Polygon, a list of Polygons or coordinate list\n",
"\n"
],
"text/plain": [
"2024.10.14 21:23:29.227 |MainThread | ERROR | geometry.py:591 - draw_cyls() | model - Overlay must be a Polygon, a list of Polygons or coordinate list\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"2024.10.14 21:23:30.936 |MainThread | INFO | CylinderCollection.py:400 - draw() | model - 9998 cylinders matched criteria\n",
"\n"
],
"text/plain": [
"2024.10.14 21:23:30.936 |MainThread | INFO | CylinderCollection.py:400 - draw() | model - 9998 cylinders matched criteria\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"2024.10.14 21:23:30.943 |MainThread | INFO | geometry.py:563 - draw_cyls() | model - Plotting cylinder collection\n",
"\n"
],
"text/plain": [
"2024.10.14 21:23:30.943 |MainThread | INFO | geometry.py:563 - draw_cyls() | model - Plotting cylinder collection\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"2024.10.14 21:23:34.099 |MainThread | ERROR | geometry.py:591 - draw_cyls() | model - Overlay must be a Polygon, a list of Polygons or coordinate list\n",
"\n"
],
"text/plain": [
"2024.10.14 21:23:34.099 |MainThread | ERROR | geometry.py:591 - draw_cyls() | model - Overlay must be a Polygon, a list of Polygons or coordinate list\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"