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

Set dataset ID attribute #251

Merged
merged 2 commits into from
Oct 17, 2018
Merged

Set dataset ID attribute #251

merged 2 commits into from
Oct 17, 2018

Conversation

jrleeman
Copy link
Contributor

Supersedes #233

@@ -454,6 +454,12 @@ def __init__(self, element_node, catalog_url=''):

"""
self.name = element_node.attrib['name']

if 'ID' in element_node.attrib:
self.id = element_node.attrib['ID']
Copy link
Member

Choose a reason for hiding this comment

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

self.id = element_node.attrib.get('ID', None) would be shorter... 😁

Copy link
Member

Choose a reason for hiding this comment

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

Could technically do that to the 'urlPath' block below if you're feeling motivated...

if 'urlPath' in element_node.attrib:
self.url_path = element_node.attrib['urlPath']
self.id = element_node.attrib.get('ID', None)
Copy link
Member

Choose a reason for hiding this comment

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

Did you really mean to move this line into the block? What I meant was that you could do, outside any if block

self.id = element_node.attrib.get('ID', None)
self.url_path = element_node.attrib.get('urlPath', None)

dopplershift
dopplershift previously approved these changes Oct 17, 2018
'text/tropical/atlantic/hdob/High_density_obs_20170824.txt'})
assert (cat.datasets[0].access_urls
== {'HTTPServer': 'http://thredds-test.unidata.ucar.edu/thredds/'
'fileServer/noaaport/text/tropical/atlantic/hdob/''
Copy link
Member

Choose a reason for hiding this comment

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

Oops, note the '' at the end of the line.

@jrleeman
Copy link
Contributor Author

Ok - I think everything is happy here now @dopplershift

@dopplershift dopplershift merged commit d2d4584 into Unidata:master Oct 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants