Skip to content

Commit

Permalink
FIX: Add header logic to download to resolve ADC data access issue
Browse files Browse the repository at this point in the history
  • Loading branch information
mgrover1 committed Feb 18, 2025
1 parent 960db21 commit 0aba907
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion pyart/testing/example_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@
env="PYART_DATASETS_DIR",
)

headers = {
"user-agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36"
}


def add_header_to_download(url, output_file, pooch):
download = pooch.downloaders.HTTPDownloader(headers=headers)
download(url, output_file, pooch)


with open(importlib.resources.files("pyart.testing") / "registry.txt") as registry_file:
DATASETS.load_registry(registry_file)
Expand Down Expand Up @@ -41,4 +50,4 @@ def get_test_data(file):
path_to_file = str
Local path to the desired file
"""
return DATASETS.fetch(file)
return DATASETS.fetch(file, downloader=add_header_to_download)

0 comments on commit 0aba907

Please sign in to comment.