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

Add pooch downloader to workaround RtD issue #547

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
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
6 changes: 6 additions & 0 deletions cf_xarray/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,16 @@ def parse_cf_standard_name_table(source=None):
if not source:
import pooch

downloader = pooch.HTTPDownloader(
# https://github.com/readthedocs/readthedocs.org/issues/11763
headers={"User-Agent": "cf-xarray"}
)

source = pooch.retrieve(
"https://raw.githubusercontent.com/cf-convention/cf-convention.github.io/"
"master/Data/cf-standard-names/current/src/cf-standard-name-table.xml",
known_hash=None,
downloader=downloader,
)
root = ElementTree.parse(source).getroot()

Expand Down