Refactor: add default params to index_boundaries

This commit is contained in:
James Addison
2026-02-01 18:42:24 +00:00
parent cd2f6e458b
commit 509f59b193
2 changed files with 3 additions and 3 deletions

View File

@@ -59,7 +59,7 @@ class Indexer:
if await self.index_by_rank(0, 4) > 0:
_analyze()
if await self.index_boundaries(0, 30) > 100:
if await self.index_boundaries() > 100:
_analyze()
if await self.index_by_rank(5, 25) > 100:
@@ -74,7 +74,7 @@ class Indexer:
if not self.has_pending():
break
async def index_boundaries(self, minrank: int, maxrank: int) -> int:
async def index_boundaries(self, minrank: int = 0, maxrank: int = 30) -> int:
""" Index only administrative boundaries within the given rank range.
"""
total = 0

View File

@@ -247,7 +247,7 @@ async def test_index_boundaries(test_db, threads, test_tokenizer):
assert test_db.osmline_unindexed() == 1
idx = indexer.Indexer('dbname=test_nominatim_python_unittest', test_tokenizer, threads)
await idx.index_boundaries(0, 30)
await idx.index_boundaries()
assert test_db.placex_unindexed() == 31
assert test_db.osmline_unindexed() == 1