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

Feature: Allow custom CF url (-d) #1066

Closed
wants to merge 8 commits into from
Closed
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
8 changes: 7 additions & 1 deletion compliance_checker/cf/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,13 @@ def download_cf_standard_name_table(version, location=None):
if version == "latest":
url = "http://cfconventions.org/Data/cf-standard-names/current/src/cf-standard-name-table.xml"
else:
url = f"http://cfconventions.org/Data/cf-standard-names/{version}/src/cf-standard-name-table.xml"
if version.startswith('http'):
Copy link
Member

Choose a reason for hiding this comment

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

@jcermauwedu it seems that your core changes are in this commit, right? This is an easy merge IMO if you don't mind submitting just that in this PR and the rest in a linting one.

url = version
version = '"url specified"'
Copy link
Member

@ocefpaf ocefpaf May 14, 2024

Choose a reason for hiding this comment

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

Maybe we could say "custom URL"? Although, if this variable is not used anywhere we can probably remove it here.

else:
url = f"http://cfconventions.org/Data/cf-standard-names/{}/src/cf-standard-name-table.xml".format(
version
)

r = requests.get(url, allow_redirects=True)
r.raise_for_status()
Expand Down