From 3a474af71fcd5f4793e7ab64f90bce4c295fc173 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 21 Dec 2023 17:40:46 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- rules/retrieve.smk | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/rules/retrieve.smk b/rules/retrieve.smk index b3969f41..de3a6709 100644 --- a/rules/retrieve.smk +++ b/rules/retrieve.smk @@ -246,13 +246,12 @@ if config["enable"]["retrieve"]: if config["enable"]["retrieve"]: - # Some logic to find the correct file URL # Sometimes files are released delayed or ahead of schedule, check which file is currently available def check_file_exists(url): - response = requests.head(url) - return response.status_code == 200 + response = requests.head(url) + return response.status_code == 200 # Basic pattern where WDPA files can be found 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 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 # extract the main zip and then merge the contained 3 zipped shapefiles