Skip to content

Get assets by eo:bands common_name or name #1140

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

Merged
merged 5 commits into from
Jun 2, 2023

Conversation

jsignell
Copy link
Member

@jsignell jsignell commented Jun 1, 2023

Related Issue(s):

Description:

This PR adds a new get_assets method on the ItemEOExtension class:

import pystac_client
import planetary_computer
from pystac.extensions.eo import EOExtension

catalog = pystac_client.Client.open(
    "https://planetarycomputer.microsoft.com/api/stac/v1",
    modifier=planetary_computer.sign_inplace,
)

landsat = catalog.get_collection("landsat-c2-l2")
item = next(landsat.get_items())

eo_ext = EOExtension.ext(item)
eo_ext.get_assets()

image

PR Checklist:

  • pre-commit hooks pass locally
  • Tests pass (run scripts/test)
  • Documentation has been updated to reflect changes, if applicable
  • This PR maintains or improves overall codebase code coverage.
  • Changes are added to the CHANGELOG. See the docs for information about adding to the changelog.

@jsignell jsignell requested a review from gadomski June 1, 2023 17:44
@jsignell jsignell self-assigned this Jun 1, 2023
@codecov
Copy link

codecov bot commented Jun 1, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (d55cc15) 90.92% compared to head (81fff4c) 90.92%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1140   +/-   ##
=======================================
  Coverage   90.92%   90.92%           
=======================================
  Files          49       49           
  Lines        6631     6634    +3     
  Branches      975      976    +1     
=======================================
+ Hits         6029     6032    +3     
  Misses        422      422           
  Partials      180      180           
Impacted Files Coverage Δ
pystac/extensions/eo.py 93.92% <100.00%> (+0.07%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

jsignell and others added 2 commits June 1, 2023 16:50
Co-authored-by: Pete Gadomski <pete.gadomski@gmail.com>
Co-authored-by: Pete Gadomski <pete.gadomski@gmail.com>
@jsignell jsignell requested a review from gadomski June 2, 2023 13:19
@jsignell jsignell added this pull request to the merge queue Jun 2, 2023
Merged via the queue into stac-utils:main with commit 5402e71 Jun 2, 2023
@jsignell jsignell deleted the get-eo-assets branch June 2, 2023 19:29
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.

Referencing assets by eo:bands common_name
2 participants