parameterize routing step to work with custom data paths

This commit is contained in:
Viktor Barzin 2025-05-14 21:08:03 +00:00
parent e3abf4b373
commit ca5619976f
No known key found for this signature in database
GPG key ID: 4056458DBDBF8863
2 changed files with 11 additions and 6 deletions

View file

@ -84,9 +84,12 @@ def detect_floorplan(ctx: click.core.Context):
@cli.command()
def routing():
click.echo('Running routing')
routing_module.calculate_route()
@click.pass_context
def routing(ctx: click.core.Context):
data_dir = ctx.obj['data_dir']
click.echo(f'Running routing for listings in {data_dir}')
listing_paths = sorted(list(pathlib.Path(data_dir).glob("*/listing.json")))
routing_module.calculate_route(listing_paths)
if __name__ == '__main__':