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

Support Sequence[PystacItem] as an argument to stackstac.stack() method #163

Closed
philvarner opened this issue Jul 28, 2022 · 1 comment · Fixed by #164
Closed

Support Sequence[PystacItem] as an argument to stackstac.stack() method #163

philvarner opened this issue Jul 28, 2022 · 1 comment · Fixed by #164

Comments

@philvarner
Copy link

The stack method currently supports numerous forms of data for the items parameter:

def stack(
    items: Union[ItemCollectionIsh, ItemIsh],
...

ItemSequence = Sequence[ItemDict]


ItemIsh = Union[SatstacItem, PystacItem, ItemDict]
ItemCollectionIsh = Union[
    SatstacItemCollection, PystacCatalog, PystacItemCollection, ItemSequence
]

However, one thing it doesn't support is a Sequence[PystacItem]. This would allow clean integration with pystac-client:

stack = stackstac.stack(list(Client(...).search().items()))

(also the get_all_items() method in the docs is now deprecated in favor of the items() iterator)

This change would also require a change to:

def items_to_plain(items: Union[ItemCollectionIsh, ItemIsh]) -> ItemSequence:

to handle the case where the Sequence is either a dict representing an item or a pystac.Item.

@philvarner
Copy link
Author

🎉

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 a pull request may close this issue.

1 participant