Skip to content

Commit

Permalink
Bump ruff to 0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
ciscorn committed Mar 22, 2024
1 parent 6f19db2 commit cb053af
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
6 changes: 2 additions & 4 deletions japanese_grids/algorithms/create_grid_square.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,6 @@ def processAlgorithm(
)

# Generate square patches
count = 0
total_count = estimate_total_count(
extent=extent_bbox,
primary="primary" in sinks,
Expand All @@ -255,15 +254,15 @@ def processAlgorithm(
quarter="quarter" in sinks,
eighth="eighth" in sinks,
)
for kind, code, bbox in iter_patch(
for count, (kind, code, bbox) in enumerate(iter_patch(
extent=extent_bbox,
primary="primary" in sinks,
secondary="secondary" in sinks,
standard="standard" in sinks,
half="half" in sinks,
quarter="quarter" in sinks,
eighth="eighth" in sinks,
):
)):
if feedback.isCanceled():
return {}

Expand All @@ -286,7 +285,6 @@ def processAlgorithm(

sink = sinks[kind]
sink.addFeature(feat, QgsFeatureSink.FastInsert)
count += 1

feedback.setProgress(100)

Expand Down
6 changes: 2 additions & 4 deletions japanese_grids/algorithms/create_legacy_grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,6 @@ def processAlgorithm(
)

# Generate square patches
count = 0
total_count = estimate_total_count(
extent=extent_bbox,
lv50000="lv50000" in sinks,
Expand All @@ -406,14 +405,14 @@ def processAlgorithm(
lv500="lv500" in sinks,
)
prefix = _PLANE_RECTANGULAR_PLANES[plane_rectangular_no]["prefix"]
for kind, code, bbox in iter_patch(
for count, (kind, code, bbox) in enumerate(iter_patch(
extent=extent_bbox,
lv50000="lv50000" in sinks,
lv5000="lv5000" in sinks,
lv2500="lv2500" in sinks,
lv1000="lv1000" in sinks,
lv500="lv500" in sinks,
):
)):
if feedback.isCanceled():
return {}

Expand All @@ -436,7 +435,6 @@ def processAlgorithm(

sink = sinks[kind]
sink.addFeature(feat, QgsFeatureSink.FastInsert)
count += 1

feedback.setProgress(100)

Expand Down
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ addopts = ["--import-mode=importlib"]
# filterwarnings = "ignore::DeprecationWarning"

[tool.ruff]
target-version = "py38"

[tool.ruff.lint]
select = [
"F",
"E",
Expand All @@ -46,7 +49,7 @@ select = [
"RUF",
]
ignore = ["N802", "E501", "RUF001"]
target-version = "py38"


[tool.coverage.run]
source = ['japanese_grids']
Expand Down

0 comments on commit cb053af

Please sign in to comment.