Skip to content

Commit

Permalink
feat: write processed file paths in tmp/file_list.json (#50)
Browse files Browse the repository at this point in the history
* feat: create polygon script return temporary file path

* fix: main return value and formatting

* feat: Allow Create Polygons script to run with multiple files

* fix: argument source was not correctly set

* feat: write processed file paths in tmp/file_list.json

* fix: remove unused imports

* fix: pylint complaining about encoding
  • Loading branch information
paulfouquet authored Jul 13, 2022
1 parent 44ff66f commit 5387093
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions scripts/create_polygons.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import argparse
import json
import os
import tempfile
from collections import Counter
from typing import List
from urllib.parse import urlparse

from aws_helper import get_bucket
Expand Down Expand Up @@ -39,7 +39,7 @@ def get_pixel_count(file_path: str) -> int:
return data_pixels_count


def main() -> List[str]: # pylint: disable=too-many-locals
def main() -> None: # pylint: disable=too-many-locals
logger = get_log()

parser = argparse.ArgumentParser()
Expand Down Expand Up @@ -87,7 +87,8 @@ def main() -> List[str]: # pylint: disable=too-many-locals

output_files.append(temp_file_path)

return output_files
with open("/tmp/file_list.json", "w", encoding="utf-8") as jf:
json.dump(output_files, jf)


if __name__ == "__main__":
Expand Down

0 comments on commit 5387093

Please sign in to comment.