From a3d6c1a665d409cb2039cfad121b88139f380375 Mon Sep 17 00:00:00 2001 From: louis-e <44675238+louis-e@users.noreply.github.com> Date: Sun, 4 Aug 2024 23:37:51 +0200 Subject: [PATCH] Adapted code style --- .flake8 | 2 +- .gitignore | 3 ++- README.md | 3 ++- src/getData.py | 2 +- src/main.py | 25 +++++++++++++------------ 5 files changed, 19 insertions(+), 16 deletions(-) diff --git a/.flake8 b/.flake8 index d1eb644..8823017 100644 --- a/.flake8 +++ b/.flake8 @@ -2,4 +2,4 @@ ignore = E203, W503 # line length is intentionally set to 80 here because black uses Bugbear # See https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html#line-length for more details -max-line-length = 88 \ No newline at end of file +max-line-length = 95 \ No newline at end of file diff --git a/.gitignore b/.gitignore index ac8a59b..bff021c 100644 --- a/.gitignore +++ b/.gitignore @@ -163,4 +163,5 @@ cython_debug/ # Debug files arnis-debug-raw_data.json arnis-debug-processed_data.json -arnis-debug-map.png \ No newline at end of file +arnis-debug-map.png +image.img \ No newline at end of file diff --git a/README.md b/README.md index 8f986b6..0ad9558 100644 --- a/README.md +++ b/README.md @@ -53,8 +53,9 @@ docker cp CONTAINER_ID:/home/region DESTINATION_PATH - Python 3 - ```pip install -r requirements.txt``` -- To conform with style guide please format any changes +- To conform with style guide please format any changes and check the code quality ```black .``` +```flake8 src/``` - Functionality should be covered by automated tests. ```python -m pytest``` diff --git a/src/getData.py b/src/getData.py index 40e322a..60b2b54 100644 --- a/src/getData.py +++ b/src/getData.py @@ -80,7 +80,7 @@ def getData(city, state, country, bbox, file, debug, download_method="requests") query1 = f""" [out:json][bbox:{bbox[1]},{bbox[0]},{bbox[3]},{bbox[2]}]; - ( + ( nwr["building"]; nwr["highway"]; nwr["landuse"]; diff --git a/src/main.py b/src/main.py index 87b3879..dcd4112 100644 --- a/src/main.py +++ b/src/main.py @@ -50,7 +50,8 @@ # Ensure either bbox or city/state/country is provided if not args.bbox and not (args.city and args.state and args.country): print( - "Error! You must provide either a bounding box (bbox) or city/state/country (experimental) information." + """Error! You must provide either a bounding box (bbox) or city/state/country \ +(experimental) information.""" ) os._exit(1) @@ -150,22 +151,22 @@ def saveRegion(region="all"): print(f"Saved {region}") -from .tree import createTree +from .tree import createTree # noqa: E402 def run(): print( """\n - ▄████████ ▄████████ ███▄▄▄▄ ▄█ ▄████████ - ███ ███ ███ ███ ███▀▀▀██▄ ███ ███ ███ - ███ ███ ███ ███ ███ ███ ███▌ ███ █▀ - ███ ███ ▄███▄▄▄▄██▀ ███ ███ ███▌ ███ - ▀███████████ ▀▀███▀▀▀▀▀ ███ ███ ███▌ ▀███████████ - ███ ███ ▀███████████ ███ ███ ███ ███ - ███ ███ ███ ███ ███ ███ ███ ▄█ ███ - ███ █▀ ███ ███ ▀█ █▀ █▀ ▄████████▀ - ███ ███ - + ▄████████ ▄████████ ███▄▄▄▄ ▄█ ▄████████ + ███ ███ ███ ███ ███▀▀▀██▄ ███ ███ ███ + ███ ███ ███ ███ ███ ███ ███▌ ███ █▀ + ███ ███ ▄███▄▄▄▄██▀ ███ ███ ███▌ ███ + ▀███████████ ▀▀███▀▀▀▀▀ ███ ███ ███▌ ▀███████████ + ███ ███ ▀███████████ ███ ███ ███ ███ + ███ ███ ███ ███ ███ ███ ███ ▄█ ███ + ███ █▀ ███ ███ ▀█ █▀ █▀ ▄████████▀ + ███ ███ + https://github.com/louis-e/arnis """ )