Skip to content

Commit

Permalink
Merge pull request #760 from dopplershift/fix-759
Browse files Browse the repository at this point in the history
Fix dataset parsing for Hyrax catalogs
  • Loading branch information
dcamron committed May 13, 2024
2 parents 7c24f40 + 7bd7afd commit 30de53f
Show file tree
Hide file tree
Showing 3 changed files with 1,044 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/siphon/catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,12 +314,11 @@ def __init__(self, catalog_url):
current_dataset = child.attrib['name']
self._process_dataset(child)

if previous_dataset:
# see if the previously processed dataset has access elements as children
# if so, these datasets need to be processed specially when making
# access_urls
if self.datasets[previous_dataset].access_element_info:
self.ds_with_access_elements_to_process.append(previous_dataset)
# see if the previously processed dataset has access elements as children
# if so, these datasets need to be processed specially when making
# access_urls
if previous_dataset and self.datasets[previous_dataset].access_element_info:
self.ds_with_access_elements_to_process.append(previous_dataset)

previous_dataset = current_dataset

Expand All @@ -346,6 +345,11 @@ def __init__(self, catalog_url):
service_skip = self.services[-1].number_of_subservices
service_skip_count = 0

# Needed if the last dataset had such info, since it's only processed looking backwards
# when a new dataset is encountered.
if previous_dataset and self.datasets[previous_dataset].access_element_info:
self.ds_with_access_elements_to_process.append(previous_dataset)

self._process_datasets()

def __str__(self):
Expand Down
Loading

0 comments on commit 30de53f

Please sign in to comment.