Before rollback
This commit is contained in:
parent
2388452d45
commit
ff78742113
60
demo.ipynb
60
demo.ipynb
@ -460,22 +460,69 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 89,
|
||||
"execution_count": 92,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"application/vnd.jupyter.widget-view+json": {
|
||||
"model_id": "db0b0312a8e44889a7bfd821b6578afe",
|
||||
"model_id": "8dc0bfb8a4b047c79e40f7d6bb2aaa83",
|
||||
"version_major": 2,
|
||||
"version_minor": 0
|
||||
},
|
||||
"text/plain": [
|
||||
"HBox(children=(Dropdown(description='Tile ID', options=('-11_7', '-12_-1', '-13_-3', '-10_-1', '-4_4', '-9_1',…"
|
||||
"VBox(children=(HBox(children=(Dropdown(description='Tile ID', options=('-11_7', '-12_-1', '-13_-3', '-10_-1', …"
|
||||
]
|
||||
},
|
||||
"metadata": {},
|
||||
"output_type": "display_data"
|
||||
},
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"Traceback (most recent call last):\n",
|
||||
" File \"/usr/lib/python3.9/site-packages/matplotlib/cbook/__init__.py\", line 224, in process\n",
|
||||
" func(*args, **kwargs)\n",
|
||||
" File \"/usr/lib/python3.9/site-packages/matplotlib/widgets.py\", line 1555, in release\n",
|
||||
" self._release(event)\n",
|
||||
" File \"/usr/lib/python3.9/site-packages/matplotlib/widgets.py\", line 2112, in _release\n",
|
||||
" self.onselect(self.eventpress, self.eventrelease)\n",
|
||||
" File \"<ipython-input-90-109bd0669182>\", line 27, in line_select_callback\n",
|
||||
" filter_dtm()\n",
|
||||
" File \"<ipython-input-90-109bd0669182>\", line 86, in filter_dtm\n",
|
||||
" X = t.get_attribute(model['x'])\n",
|
||||
" File \"/home/florent/.local/lib/python3.9/site-packages/sap/trees.py\", line 288, in get_attribute\n",
|
||||
" compute = getattr(hg, 'attribute_' + attribute_name)\n",
|
||||
"TypeError: can only concatenate str (not \"Dropdown\") to str\n",
|
||||
"<ipython-input-90-109bd0669182>:30: DeprecationWarning: `np.int` is a deprecated alias for the builtin `int`. To silence this warning, use `int` by itself. Doing this will not modify any behavior and is safe. When replacing `np.int`, you may wish to use e.g. `np.int64` or `np.int32` to specify the precision. If you wish to review your current use, check the release note link for additional information.\n",
|
||||
"Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations\n",
|
||||
" model['dtm_y1'], model['dtm_x1'] = np.int(eclick.xdata), np.int(eclick.ydata)\n",
|
||||
"<ipython-input-90-109bd0669182>:31: DeprecationWarning: `np.int` is a deprecated alias for the builtin `int`. To silence this warning, use `int` by itself. Doing this will not modify any behavior and is safe. When replacing `np.int`, you may wish to use e.g. `np.int64` or `np.int32` to specify the precision. If you wish to review your current use, check the release note link for additional information.\n",
|
||||
"Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations\n",
|
||||
" model['dtm_y2'], model['dtm_x2'] = np.int(erelease.xdata), np.int(erelease.ydata)\n",
|
||||
"<ipython-input-90-109bd0669182>:37: DeprecationWarning: `np.bool` is a deprecated alias for the builtin `bool`. To silence this warning, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here.\n",
|
||||
"Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations\n",
|
||||
" pmask = np.zeros_like(model['im'], dtype=np.bool)\n",
|
||||
"Traceback (most recent call last):\n",
|
||||
" File \"/usr/lib/python3.9/site-packages/matplotlib/cbook/__init__.py\", line 224, in process\n",
|
||||
" func(*args, **kwargs)\n",
|
||||
" File \"/usr/lib/python3.9/site-packages/matplotlib/widgets.py\", line 1555, in release\n",
|
||||
" self._release(event)\n",
|
||||
" File \"/usr/lib/python3.9/site-packages/matplotlib/widgets.py\", line 2112, in _release\n",
|
||||
" self.onselect(self.eventpress, self.eventrelease)\n",
|
||||
" File \"<ipython-input-90-109bd0669182>\", line 32, in dtm_select_callback\n",
|
||||
" filter_nodes()\n",
|
||||
" File \"<ipython-input-90-109bd0669182>\", line 41, in filter_nodes\n",
|
||||
" show_spectrum()\n",
|
||||
" File \"<ipython-input-90-109bd0669182>\", line 49, in show_spectrum\n",
|
||||
" ps = sap.spectrum2d(model['tree_cache'], x, y, 200, 100, x_log, y_log)\n",
|
||||
" File \"/home/florent/.local/lib/python3.9/site-packages/sap/spectra.py\", line 160, in spectrum2d\n",
|
||||
" x = tree.get_attribute(x_attribute)\n",
|
||||
" File \"/home/florent/.local/lib/python3.9/site-packages/sap/trees.py\", line 288, in get_attribute\n",
|
||||
" compute = getattr(hg, 'attribute_' + attribute_name)\n",
|
||||
"TypeError: can only concatenate str (not \"Dropdown\") to str\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
@ -484,6 +531,8 @@
|
||||
"model['tree_type'] = ipw.Dropdown(description='Hierarchy', value=sap.trees.MaxTree, options=inspect.getmembers(sap.trees, lambda t: inspect.isclass(t) and issubclass(t, sap.Tree) and t != sap.Tree))\n",
|
||||
"load_button = ipw.Button(description='Analyse', icon='rocket')\n",
|
||||
"\n",
|
||||
"model['x'] = ipw.Dropdown(description='Attribute X', options=sap.available_attributes().keys())\n",
|
||||
"model['y'] = ipw.Dropdown(description='Attribute Y', options=sap.available_attributes().keys())\n",
|
||||
"\n",
|
||||
"def load_change(change):\n",
|
||||
" print('Loading tile...')\n",
|
||||
@ -501,7 +550,10 @@
|
||||
"tree_type.observe(tree_change, names='value')\n",
|
||||
"load_button.on_click(load_change)\n",
|
||||
"\n",
|
||||
"ipw.HBox([model['tile_name'], model['lidar_feature'], model['tree_type'] , load_button])"
|
||||
"ipw.VBox([\n",
|
||||
" ipw.HBox([model['tile_name'], model['lidar_feature'], model['tree_type'] , load_button]),\n",
|
||||
" ipw.HBox([model['x'], model['y']])\n",
|
||||
"])"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user