Xarray Assets Extension class#1161
Conversation
|
Not super ergonomic with the current extension access system, but I'm optimistic that the extension API can be revamped a la #1051 without a substantial rewrite of the classes. |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #1161 +/- ##
==========================================
+ Coverage 91.96% 91.99% +0.02%
==========================================
Files 50 51 +1
Lines 6720 6795 +75
Branches 994 1000 +6
==========================================
+ Hits 6180 6251 +71
- Misses 365 368 +3
- Partials 175 176 +1
☔ View full report in Codecov by Sentry. |
gadomski
left a comment
There was a problem hiding this comment.
Couple high level questions:
- Did you consider adding xpystac as a optional dependency (ala orjson)?
- How do you see this model working for "containers" that aren't tied to a specific extension? E.g. @TomAugspurger's proposed
to_geopandasfor anItemCollection? - I think this deserves more than just API docs, e.g. updating how-to-read-data-from-stac.ipynb to use the new extension interface?
Co-authored-by: Pete Gadomski <[email protected]>
I guess that's a good idea in case we need to pin it later on?
Because ItemCollections can't have extensions or because there would be no need for a geopandas extension? I was kind of thinking the table extension could be the geopandas extension. I guess alternatively there could be a generic reader extension but that might be too far of a stretch from what extensions are meant to be.
Yeah definitely. I wasn't sure if people would like this idea, so I didn't bother with that yet. |
Yeah, and it makes it clearer that there's pystac functionality that uses xpystac, instead of just tests.
Yup, this.
But theoretically you could want to make a dataframe out of something that doesn't have the table extension in its
👍🏼 |
Yeah but couldn't you just add the table extension in that case? |
If you don't need the table extension to put the STAC stuff into a data frame, IMO you shouldn't have to add the table extension. Otherwise, I could see a scenario where someone loads some STAC, adds the table extension to do some data frame work, then has to strip the table extension back out again before saving the STAC somewhere else -- feels hackey. |
Related Issue(s):
Description:
EDIT: I removed the
openmethod, so this is just a regular extension class now.This PR implements an extension class for xarray-assets extension with a special
openmethod for extended pystac.Assets as described in #846 (comment)PR Checklist:
pre-commithooks pass locallyscripts/test)