Support inflate delta
This commit is contained in:
@@ -3,7 +3,7 @@ from .s35_vd_cal import *
|
||||
from .s35_vd import get_all_virtual_district_ids
|
||||
from .batch_exe import execute_batch_command
|
||||
|
||||
def generate_virtual_district(name: str, centers: list[str]) -> ChangeSet:
|
||||
def generate_virtual_district(name: str, centers: list[str], inflate_delta: float = 0.5) -> ChangeSet:
|
||||
cs = ChangeSet()
|
||||
|
||||
for id in get_all_virtual_district_ids(name):
|
||||
@@ -15,7 +15,7 @@ def generate_virtual_district(name: str, centers: list[str]) -> ChangeSet:
|
||||
center = vd['center']
|
||||
nodes = vd['nodes']
|
||||
boundary = calculate_boundary(name, nodes)
|
||||
boundary = inflate_boundary(name, boundary)
|
||||
boundary = inflate_boundary(name, boundary, inflate_delta)
|
||||
cs.add({ 'type': 'virtual_district', 'id': f"VD_{center}", 'boundary': boundary, 'center': center, 'nodes': nodes })
|
||||
|
||||
return execute_batch_command(name, cs)
|
||||
|
||||
Reference in New Issue
Block a user