Skip to content

Commit

Permalink
STAC search use assets directly
Browse files Browse the repository at this point in the history
Relate issue #15
After running profiling, I found that a large amount of time was spent in the python's deepcopy. The get_assets call returns a copy which we are iterating over. By using the assets directly we can avoid the copy step and save a bunch of overhead.
  • Loading branch information
ptomasula committed May 31, 2024
1 parent 6dfeec3 commit f68df03
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/catalog_to_xpublish/searchers/stac_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def _parse_assets(
dataset_info_dicts: Dict[str, Dict[str, Any]],
) -> None:
"""Adds all assets to the list + dict of datasets."""
for child_name, child in pystac_obj.get_assets().items():
for child_name, child in pystac_obj.assets.items():
# make sure the item type is supported
url_path = child.get_absolute_href()
if url_path.endswith('/'):
Expand Down

0 comments on commit f68df03

Please sign in to comment.