Skip to content

Commit fd3fe3c

Browse files
authored
chore: Bump ruff to 0.15 (#1095)
Apply lint fixes
1 parent 39bd3e1 commit fd3fe3c

File tree

7 files changed

+35
-36
lines changed

7 files changed

+35
-36
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ repos:
1818
args: ["--maxkb=5500"]
1919

2020
- repo: https://github.com/astral-sh/ruff-pre-commit
21-
rev: v0.13.0
21+
rev: v0.15.0
2222
hooks:
2323
- id: ruff
2424
args: ["--fix"]

lonboard/_constants.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from enum import Enum
1+
from enum import Enum, StrEnum
22

33
import pyproj
44

@@ -110,7 +110,7 @@ def __str__(self) -> str:
110110
return self.value.decode()
111111

112112

113-
class Environment(str, Enum):
113+
class Environment(StrEnum):
114114
Azure = "azure"
115115
"""Azure notebook"""
116116

lonboard/_geoarrow/extension_types.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import annotations
22

33
import json
4-
from enum import Enum
4+
from enum import StrEnum
55
from typing import TYPE_CHECKING
66

77
import numpy as np
@@ -16,7 +16,7 @@
1616
from pyproj import CRS
1717

1818

19-
class CoordinateDimension(str, Enum):
19+
class CoordinateDimension(StrEnum):
2020
XY = "xy"
2121
XYZ = "xyz"
2222
XYM = "xym"

lonboard/_viz.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ def viz(
199199
)
200200
COLOR_COUNTER += 1
201201

202-
map_kwargs = map_kwargs if map_kwargs else {}
202+
map_kwargs = map_kwargs or {}
203203

204204
if "basemap_style" not in map_kwargs and "basemap" not in map_kwargs:
205205
map_kwargs["basemap"] = MaplibreBasemap(
@@ -484,7 +484,7 @@ def _viz_geoarrow_table(
484484
geometry_ext_type = geometry_field.metadata.get(b"ARROW:extension:name")
485485

486486
if geometry_ext_type in [EXTENSION_NAME.POINT, EXTENSION_NAME.MULTIPOINT]:
487-
scatterplot_kwargs = scatterplot_kwargs if scatterplot_kwargs else {}
487+
scatterplot_kwargs = scatterplot_kwargs or {}
488488

489489
if "get_fill_color" not in scatterplot_kwargs:
490490
scatterplot_kwargs["get_fill_color"] = _viz_color
@@ -513,7 +513,7 @@ def _viz_geoarrow_table(
513513
EXTENSION_NAME.LINESTRING,
514514
EXTENSION_NAME.MULTILINESTRING,
515515
]:
516-
path_kwargs = path_kwargs if path_kwargs else {}
516+
path_kwargs = path_kwargs or {}
517517

518518
if "get_color" not in path_kwargs:
519519
path_kwargs["get_color"] = _viz_color
@@ -543,7 +543,7 @@ def _viz_geoarrow_table(
543543
EXTENSION_NAME.MULTIPOLYGON,
544544
EXTENSION_NAME.BOX,
545545
]:
546-
polygon_kwargs = polygon_kwargs if polygon_kwargs else {}
546+
polygon_kwargs = polygon_kwargs or {}
547547

548548
if "get_fill_color" not in polygon_kwargs:
549549
polygon_kwargs["get_fill_color"] = _viz_color

lonboard/basemap.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from enum import Enum
5+
from enum import StrEnum
66
from typing import TYPE_CHECKING
77

88
import traitlets.traitlets as t
@@ -15,7 +15,7 @@
1515
from typing import Literal
1616

1717

18-
class CartoStyle(str, Enum):
18+
class CartoStyle(StrEnum):
1919
"""Maplibre-supported vector basemap styles provided by Carto.
2020
2121
Refer to [Carto
@@ -71,7 +71,7 @@ class CartoStyle(str, Enum):
7171
@deprecated(
7272
"CartoBasemap is deprecated, use CartoStyle instead. Will be removed in v0.14",
7373
)
74-
class CartoBasemap(str, Enum):
74+
class CartoBasemap(StrEnum):
7575
"""Maplibre-supported vector basemap styles provided by Carto.
7676
7777
Refer to [Carto

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ dev = [
9090
"pytest>=8.3.4",
9191
"pytest-ipywidgets>=1.54.0",
9292
"rasterio>=1.4.3",
93-
"ruff>=0.13.0",
93+
"ruff>=0.15.0",
9494
"sidecar>=0.7.0",
9595
"types-geopandas>=1.1.1.20250708",
9696
"types-shapely>=2.1.0.20250512",

uv.lock

Lines changed: 22 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)