Skip to content

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
12rambau committed Sep 27, 2024
1 parent bfd8604 commit a47a458
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 167 deletions.
175 changes: 12 additions & 163 deletions example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,9 @@
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"True"
]
},
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"import ee \n",
"\n",
Expand All @@ -24,7 +13,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -33,7 +22,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -44,179 +33,39 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
" <style>\n",
" .geemap-dark {\n",
" --jp-widgets-color: white;\n",
" --jp-widgets-label-color: white;\n",
" --jp-ui-font-color1: white;\n",
" --jp-layout-color2: #454545;\n",
" background-color: #383838;\n",
" }\n",
"\n",
" .geemap-dark .jupyter-button {\n",
" --jp-layout-color3: #383838;\n",
" }\n",
"\n",
" .geemap-colab {\n",
" background-color: var(--colab-primary-surface-color, white);\n",
" }\n",
"\n",
" .geemap-colab .jupyter-button {\n",
" --jp-layout-color3: var(--colab-primary-surface-color, white);\n",
" }\n",
" </style>\n",
" "
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"outputs": [],
"source": [
"am = AssetManager()\n",
"am.to_sidecar()"
]
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
" <style>\n",
" .geemap-dark {\n",
" --jp-widgets-color: white;\n",
" --jp-widgets-label-color: white;\n",
" --jp-ui-font-color1: white;\n",
" --jp-layout-color2: #454545;\n",
" background-color: #383838;\n",
" }\n",
"\n",
" .geemap-dark .jupyter-button {\n",
" --jp-layout-color3: #383838;\n",
" }\n",
"\n",
" .geemap-colab {\n",
" background-color: var(--colab-primary-surface-color, white);\n",
" }\n",
"\n",
" .geemap-colab .jupyter-button {\n",
" --jp-layout-color3: var(--colab-primary-surface-color, white);\n",
" }\n",
" </style>\n",
" "
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"outputs": [],
"source": [
"#tm = TaskManager()\n",
"#tm.to_sidecar()"
]
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
" <style>\n",
" .geemap-dark {\n",
" --jp-widgets-color: white;\n",
" --jp-widgets-label-color: white;\n",
" --jp-ui-font-color1: white;\n",
" --jp-layout-color2: #454545;\n",
" background-color: #383838;\n",
" }\n",
"\n",
" .geemap-dark .jupyter-button {\n",
" --jp-layout-color3: #383838;\n",
" }\n",
"\n",
" .geemap-colab {\n",
" background-color: var(--colab-primary-surface-color, white);\n",
" }\n",
"\n",
" .geemap-colab .jupyter-button {\n",
" --jp-layout-color3: var(--colab-primary-surface-color, white);\n",
" }\n",
" </style>\n",
" "
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"outputs": [],
"source": [
"m = Map()\n",
"m.to_sidecar()"
]
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
" <style>\n",
" .geemap-dark {\n",
" --jp-widgets-color: white;\n",
" --jp-widgets-label-color: white;\n",
" --jp-ui-font-color1: white;\n",
" --jp-layout-color2: #454545;\n",
" background-color: #383838;\n",
" }\n",
"\n",
" .geemap-dark .jupyter-button {\n",
" --jp-layout-color3: #383838;\n",
" }\n",
"\n",
" .geemap-colab {\n",
" background-color: var(--colab-primary-surface-color, white);\n",
" }\n",
"\n",
" .geemap-colab .jupyter-button {\n",
" --jp-layout-color3: var(--colab-primary-surface-color, white);\n",
" }\n",
" </style>\n",
" "
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"outputs": [],
"source": [
"dataset = (\n",
" ee.ImageCollection('ECMWF/ERA5_LAND/HOURLY')\n",
Expand Down
12 changes: 8 additions & 4 deletions ipygee/asset.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,9 @@ def get_items(self) -> List[v.ListItem]:
icon = ICON_STYLE[type]["icon"]
color = ICON_STYLE[type]["color"]

action = v.ListItemAction(children=[v.Icon(color=color, small=True, children=[icon])], class_="mr-1")
action = v.ListItemAction(
children=[v.Icon(color=color, small=True, children=[icon])], class_="mr-1"
)
content = v.ListItemContent(children=[v.ListItemTitle(children=[i["name"]])])
dst_list = folder_list if type in ["FOLDER", "PROJECT"] else file_list
dst_list.append(v.ListItem(value=i["id"], children=[action, content]))
Expand All @@ -210,7 +212,9 @@ def get_items(self) -> List[v.ListItem]:
name = parent.parts[1] if parent.is_project() else parent.name
name = name or "." # special case for the root

action = v.ListItemAction(children=[v.Icon(color=color, small=True, children=[icon])], class_="mr-1")
action = v.ListItemAction(
children=[v.Icon(color=color, small=True, children=[icon])], class_="mr-1"
)
content = v.ListItemContent(children=[v.ListItemTitle(children=[name])])
item = v.ListItem(value=str(parent), children=[action, content])

Expand Down Expand Up @@ -243,9 +247,9 @@ def on_reload(self, *args):
"""Reload the current folder."""
try:
self.on_item_select(change={"new": self.folder})
except ValueError:
except ValueError:
self.on_item_select(change={"new": ee.Asset(self.folder).parent.as_posix()})

def on_copy(self, *args):
"""Copy the selected item to clipboard."""
self.send({"method": "clip", "args": [self.w_selected.v_model]})
Expand Down

0 comments on commit a47a458

Please sign in to comment.