Skip to content

Commit

Permalink
resolve ruff ruf005 rule exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
bjlittle committed Nov 30, 2023
1 parent a6f53e5 commit f5c55c7
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 10 deletions.
4 changes: 0 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,6 @@ ignore = [
# https://docs.astral.sh/ruff/rules/#pandas-vet-pd
"PD",

# Ruff-specific rules (RUF)
# https://docs.astral.sh/ruff/rules/collection-literal-concatenation/
"RUF005", # Consider {expression} instead of concatenation.

# flake8-bandit (S)
# https://docs.astral.sh/ruff/rules/assert/
"S101", # Use of assert detected.
Expand Down
2 changes: 1 addition & 1 deletion src/geovista/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

FG_COLOUR: str = "cyan"

EXAMPLES: list[str] = [ALL] + get_modules("geovista.examples")
EXAMPLES: list[str] = [ALL, *get_modules("geovista.examples")]


def _download_group(
Expand Down
8 changes: 5 additions & 3 deletions src/geovista/geodesic.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,9 +337,11 @@ def bbox_update(
npts=self._npts,
geod=self._geod,
)
self._idx_map[row, column] = (
[idx1] + list(np.arange(self._npts) + self._bbox_count) + [idx2]
)
self._idx_map[row, column] = [
idx1,
*(np.arange(self._npts) + self._bbox_count),
idx2,
]
bbox_extend(glons, glats)

# register bbox edge indices, and points
Expand Down
2 changes: 1 addition & 1 deletion tests/search/test_KDTree.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def test_cell_neighbours(lam_uk, neighbours):
kdtree = KDTree(lam_uk, preference="center")
lonlat = from_cartesian(pv.PolyData(kdtree.points))
cid = neighbours.cid
expected = [cid] + neighbours.expected
expected = [cid, *neighbours.expected]
k = len(expected)
lon, lat = lonlat[cid][0], lonlat[cid][1]
_, idx = kdtree.query(lon, lat, k=k)
Expand Down
2 changes: 1 addition & 1 deletion tests/transform/test_transform_points.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def test_transform(mocker, zoffset, reshape, roundtrip):
zs = zs.reshape(shape)
else:
shape = (size,)
shape = shape + (3,)
shape = (*shape, 3)
spy_from_crs = mocker.spy(Transformer, "from_crs")
spy_transform = mocker.spy(Transformer, "transform")
if roundtrip:
Expand Down

0 comments on commit f5c55c7

Please sign in to comment.