Skip to content

Commit

Permalink
Update download.py
Browse files Browse the repository at this point in the history
  • Loading branch information
JulienGroenenboom authored Sep 13, 2023
1 parent 334d9eb commit ffb5383
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions dfm_tools/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,12 @@ def cds_credentials():
if os.path.exists(file_credentials):
print('found CDS apikey')
else:
print("Downloading CDS/ERA5 data requires a CDS apikey, copy the key from https://cds.climate.copernicus.eu/api-how-to (first register and sign in) ")
print("Downloading CDS/ERA5 data requires a CDS apikey, copy the user ID (UID) and API key from https://cds.climate.copernicus.eu/api-how-to (first register and sign in) ")
UID = getpass.getpass("\nEnter your UID: ")

Check warning on line 155 in dfm_tools/download.py

View check run for this annotation

Codecov / codecov/patch

dfm_tools/download.py#L154-L155

Added lines #L154 - L155 were not covered by tests
apikey = getpass.getpass("Enter your CDS apikey: ")
with open(file_credentials,'w') as fc:
fc.write('url: https://cds.climate.copernicus.eu/api/v2\n')
fc.write(f'key: {apikey}')
fc.write(f'key: {UID}:{apikey}')

Check warning on line 159 in dfm_tools/download.py

View check run for this annotation

Codecov / codecov/patch

dfm_tools/download.py#L159

Added line #L159 was not covered by tests


def copernicusmarine_credentials():
Expand Down

1 comment on commit ffb5383

@JulienGroenenboom
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.