-
Notifications
You must be signed in to change notification settings - Fork 75
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
Conversation
siphon/catalog.py
Outdated
@@ -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'] |
There was a problem hiding this comment.
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... 😁
There was a problem hiding this comment.
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...
siphon/catalog.py
Outdated
if 'urlPath' in element_node.attrib: | ||
self.url_path = element_node.attrib['urlPath'] | ||
self.id = element_node.attrib.get('ID', None) |
There was a problem hiding this comment.
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)
siphon/tests/test_catalog.py
Outdated
'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/'' |
There was a problem hiding this comment.
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.
Ok - I think everything is happy here now @dopplershift |
Supersedes #233