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

Make RioDataset public API #115

Open
gerritholl opened this issue Nov 16, 2022 · 1 comment
Open

Make RioDataset public API #115

gerritholl opened this issue Nov 16, 2022 · 1 comment

Comments

@gerritholl
Copy link
Member

Feature Request

Is your feature request related to a problem? Please describe.

The RioDataset class is defined in the module _xrimage_rasterio. The leading underscore suggests this is considered private API. In trollimage, I want to test whether a dataset is a RioDataset (for rationale, see pytroll/trollflow2#168). A way way to do that would be with isinstance(x, RioDataset), but this requires importing from a private module.

Describe the solution you'd like

I would like that RioDataset is publicly exposed.

Describe any changes to existing user workflow

N/A, I think.

Additional context

I could do type testing based on the name. This would eliminate the need to import the class. That's not very Pythonic.

I could rely on duck-typing and EAFP. Considering the potential diversity of types returned from satpys Scene.save_datasets, I'm not sure if that's a good idea.

@djhoese
Copy link
Member

djhoese commented Nov 16, 2022

What are you doing with the instance what you've determined that it is a RioDataset?

I'd prefer not to make this public API as we home to move to rioxarray in the future which has no concept of this. I don't know enough about how rioxarray does it to know if it will need to return an object and if so what object it will return (alongside the src dask array).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants