Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ jobs:
test -f $CONDA_PREFIX/share/jupyter/labextensions/jupyter-leaflet/package.json

- name: Python Linters
uses: psf/black@stable
with:
jupyter: true
run: ruff check --output-format=github .

- name: JS Linters
run: |
Expand Down
1 change: 1 addition & 0 deletions environment-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ dependencies:
- traittypes
- pandas
- yarn~=3.0
- ruff
2 changes: 1 addition & 1 deletion examples/CanvasRenderer.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"m = Map(center=(48.1, 17.1), zoom=8, prefer_canvas=True)\n",
"\n",
"gdf = geopandas.GeoDataFrame(\n",
" geometry=[shapely.geometry.Point(l) for l in random_locs], crs=\"EPSG:4326\"\n",
" geometry=[shapely.geometry.Point(l) for loc in random_locs], crs=\"EPSG:4326\"\n",
")\n",
"\n",
"geo_data = GeoData(\n",
Expand Down
4 changes: 1 addition & 3 deletions examples/Choropleth.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,7 @@
" State name:\n",
" <b>{}\\n</b>\n",
" {}\n",
" \"\"\".format(\n",
" id, feature[\"properties\"][\"name\"]\n",
" )\n",
" \"\"\".format(id, feature[\"properties\"][\"name\"])\n",
"\n",
"\n",
"layer.on_hover(update_html)"
Expand Down
2 changes: 1 addition & 1 deletion examples/DropdownControl.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
" name = item[\"name\"]\n",
" basemap = \"basemaps.{}\".format(name)\n",
" ee_basemaps[name] = basemap_to_tiles(eval(basemap))\n",
" except:\n",
" except Exception as e:\n",
" for sub_item in item:\n",
" name = item[sub_item][\"name\"]\n",
" basemap = \"basemaps.{}\".format(name)\n",
Expand Down
4 changes: 1 addition & 3 deletions examples/GeoJson_EU_on_hover.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,7 @@
" <h4>EU population density</h4>\n",
" <h4><b>{}</b></h4>\n",
" {} people / mi^2\n",
" \"\"\".format(\n",
" feature[\"properties\"][\"name\"], feature[\"properties\"][\"pop_est\"]\n",
" )\n",
" \"\"\".format(feature[\"properties\"][\"name\"], feature[\"properties\"][\"pop_est\"])\n",
"\n",
"\n",
"geo_json.on_hover(update_html)"
Expand Down
29 changes: 15 additions & 14 deletions examples/Primitives.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Map"
"## Map\n"
]
},
{
Expand Down Expand Up @@ -94,7 +94,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Marker"
"## Marker\n"
]
},
{
Expand Down Expand Up @@ -128,7 +128,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Popup"
"## Popup\n"
]
},
{
Expand Down Expand Up @@ -163,14 +163,14 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Marker Cluster"
"## Marker Cluster\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"When we have many markers on a map, it is helpful to cluster them together at high zoom levels. First, we create a small grid of markers."
"When we have many markers on a map, it is helpful to cluster them together at high zoom levels. First, we create a small grid of markers.\n"
]
},
{
Expand All @@ -179,13 +179,14 @@
"metadata": {},
"outputs": [],
"source": [
"from itertools import product\n",
"\n",
"xscale = 5\n",
"yscale = 10\n",
"\n",
"x = [m.center[0] + i * xscale * 0.05 for i in (-1, 0, 1)]\n",
"y = [m.center[1] + i * yscale * 0.05 for i in (-1, 0, 1)]\n",
"\n",
"from itertools import product\n",
"\n",
"locations = product(x, y)\n",
"markers = [Marker(location=loc) for loc in locations]"
Expand All @@ -195,7 +196,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Then we add them all to a `MarkerCluster`, which automatically clusters them at appropriate zoom levels."
"Then we add them all to a `MarkerCluster`, which automatically clusters them at appropriate zoom levels.\n"
]
},
{
Expand All @@ -221,7 +222,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Image Overlay"
"## Image Overlay\n"
]
},
{
Expand Down Expand Up @@ -265,7 +266,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Polyline"
"## Polyline\n"
]
},
{
Expand Down Expand Up @@ -301,7 +302,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Polygon"
"## Polygon\n"
]
},
{
Expand Down Expand Up @@ -334,7 +335,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Rectangle"
"## Rectangle\n"
]
},
{
Expand All @@ -360,7 +361,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Circle"
"## Circle\n"
]
},
{
Expand Down Expand Up @@ -467,7 +468,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## CircleMarker"
"## CircleMarker\n"
]
},
{
Expand Down Expand Up @@ -519,7 +520,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Multiple Circles"
"## Multiple Circles\n"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion ipyleaflet/leaflet.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def basemap_to_tiles(basemap, day=yesterday, **kwargs):
attribution=basemap.get("html_attribution", "")
or basemap.get("attribution", ""),
name=basemap.get("name", ""),
**kwargs
**kwargs,
)


Expand Down
10 changes: 10 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,13 @@
# avoid 3.6 so we don't need the rust buildchain
requires = ["jupyter_packaging~=0.12", "jupyterlab~=4.0.8", "setuptools>=40.8.0", "wheel"]
build-backend = "setuptools.build_meta"

[tool.ruff]
extend-include = ["*.ipynb"]

[tool.ruff.lint]
select = [
# pycodestyle
"E",
]
ignore = ["E501", "E731"]