[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
pre-commit-ci[bot] 2023-12-21 17:40:46 +00:00
parent 25c5751565
commit 3a474af71f

View File

@ -246,13 +246,12 @@ if config["enable"]["retrieve"]:
if config["enable"]["retrieve"]: if config["enable"]["retrieve"]:
# Some logic to find the correct file URL # Some logic to find the correct file URL
# Sometimes files are released delayed or ahead of schedule, check which file is currently available # Sometimes files are released delayed or ahead of schedule, check which file is currently available
def check_file_exists(url): def check_file_exists(url):
response = requests.head(url) response = requests.head(url)
return response.status_code == 200 return response.status_code == 200
# Basic pattern where WDPA files can be found # Basic pattern where WDPA files can be found
url_pattern = "https://d1gam3xoknrgr2.cloudfront.net/current/WDPA_{bY}_Public.zip" url_pattern = "https://d1gam3xoknrgr2.cloudfront.net/current/WDPA_{bY}_Public.zip"
@ -270,7 +269,9 @@ if config["enable"]["retrieve"]:
# If None of the three URLs are working # If None of the three URLs are working
url = False url = False
assert url, f"No WDPA files found at {url_pattern} for bY='{current_monthyear}, {prev_monthyear}, or {next_monthyear}'" assert (
url
), f"No WDPA files found at {url_pattern} for bY='{current_monthyear}, {prev_monthyear}, or {next_monthyear}'"
# Downloading protected area database from WDPA # Downloading protected area database from WDPA
# extract the main zip and then merge the contained 3 zipped shapefiles # extract the main zip and then merge the contained 3 zipped shapefiles