Skip to content

Commit

Permalink
fix: raise error if EarthData login doesn't work
Browse files Browse the repository at this point in the history
  • Loading branch information
mdtanker committed Dec 12, 2024
1 parent 0064c05 commit 1576c00
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/polartoolkit/fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ class EarthDataDownloader:
session.
"""

def __init__(self) -> None:
def __call__(self, url: str, output_file: str, dataset: typing.Any) -> None:
auth = earthaccess.login()
auth = earthaccess.__auth__

Expand All @@ -235,7 +235,6 @@ def __init__(self) -> None:
)
raise ValueError(msg)

def __call__(self, url: str, output_file: str, dataset: typing.Any) -> None:
creds = earthaccess.auth_environ()
auth = creds.get("EARTHDATA_USERNAME"), creds.get("EARTHDATA_PASSWORD")
downloader = pooch.HTTPDownloader(auth=auth, progressbar=True)
Expand Down

0 comments on commit 1576c00

Please # to comment.