Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove hard-coded "para" logic #495

Merged
merged 2 commits into from
Jul 27, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -567,11 +567,6 @@ def check_if_file_exists(bucket, file, download=False):
if requests.head(https_file).status_code == 200:
file_exists = True
print("File does not exist on S3 (even though it should), but does exists on Google Cloud.")
elif "/para" in file:
https_file = file.replace("common/data/model/com/nwm/para", "https://para.nomads.ncep.noaa.gov/pub/data/nccf/com/nwm/para")
if requests.head(https_file).status_code == 200:
file_exists = True
print("File does not exist on S3 (even though it should), but does exists on NOMADS para.")
else:
raise Exception("Code could not handle request for file")

Expand All @@ -592,10 +587,6 @@ def check_if_file_exists(bucket, file, download=False):
except:
print(f"Failed to open {download_path}. Retrying in case file was corrupted on download")
tries +=1

if "para" in file:
print(f"Uploading {file} to {bucket}")
s3.upload_file(download_path, bucket, file)
else:
print(f"Downloading {file} from s3")
s3.download_file(bucket, file, download_path)
Expand Down