Skip to content

Commit

Permalink
Fix js_py conversion bug
Browse files Browse the repository at this point in the history
  • Loading branch information
giswqs committed Aug 8, 2020
1 parent 3b43e29 commit 6c0ebe4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
15 changes: 3 additions & 12 deletions examples/notebooks/31_unsupervised_classification.ipynb
Expand Up @@ -106,15 +106,6 @@
"Map.addLayer(image, vis_params, \"Landsat-8\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"ee.Algorithms.If(ee.List(image.propertyNames()).contains('system:time_start'), True, False).getInfo()"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down Expand Up @@ -301,7 +292,7 @@
"metadata": {},
"outputs": [],
"source": [
"geemap.ee_export_image(result, filename=out_file, scale=90)"
"# geemap.ee_export_image(result, filename=out_file, scale=90)"
]
},
{
Expand All @@ -317,7 +308,7 @@
"metadata": {},
"outputs": [],
"source": [
"geemap.ee_export_image_to_drive(result, description='clusters', folder='export', scale=90)"
"# geemap.ee_export_image_to_drive(result, description='clusters', folder='export', scale=90)"
]
}
],
Expand Down Expand Up @@ -356,7 +347,7 @@
"width": "384px"
},
"toc_section_display": true,
"toc_window_display": true
"toc_window_display": false
},
"varInspector": {
"cols": {
Expand Down
2 changes: 2 additions & 0 deletions geemap/conversion.py
Expand Up @@ -501,6 +501,8 @@ def js_snippet_to_py(in_js_snippet, add_new_cell=True, import_ee=True, import_ge
continue
else:
out_lines.append(line)
elif index == (len(lines) - 1) and lines[index].strip() != '':
out_lines.append(line)

if show_map:
out_lines.append('Map\n')
Expand Down

0 comments on commit 6c0ebe4

Please sign in to comment.