feat: Add TIFF.open_sync to synchronously open a TIFF#176
feat: Add TIFF.open_sync to synchronously open a TIFF#176kylebarron wants to merge 6 commits intomainfrom
TIFF.open_sync to synchronously open a TIFF#176Conversation
I would then say that you don't even need to have The whole library is named |
The idea is that an end user might need to just construct the GeoTIFF instance to pass to a library. But where the user themselves doesn't want or know how to touch async. As in the example I provided above with Lonboard. The question is whether it's better to have
The former is more "async-native" while the latter maintains better compatibility with obstore. Obstore is similar in the sense that users should use the async API over the sync one, but it also makes you suffix with |
|
I don't want to be a blocker here and if it's the same with obstore let's use |
|
+1 on mirroring obstore's naming conventions |
|
Another option is to use different names entirely:
Since in Python |
|
+1 for I agree with @vincentsarago that the name of the library suggests |
I would lean towards keeping things async only. Unlike obstore/object_store which has a manageable spec, (Geo)TIFF has too many things going on at the low level (see advice from #7), and I think doubling the amount of methods would lead to more confusion (see zarr-python's async and sync APIs). Also it looks duplicative if someone does import async_tiff
await async_tiff.open_async(...)We could make _async/_sync versions in |
|
I'm leaning now towards:
Any final thoughts? |
TIFF.open_sync to synchronously open a TIFF
|
I'm inclined to not merge this for the current release, and then we can keep thinking about whether this is useful |
|
I'm still not super convinced by one or the other. To be honest I was mostly surprised that async-tiff would provide synchronous methods. If this not a user request, I would put this on hold to be honest. I would not go for |
Change list
TIFF.open_sync.Questions
I think the "primary" API of the library should be async, in the sense that if someone is doing synchronous operations, there's not much of a point of using async-tiff over rasterio.
But I think it makes sense to have sync operations because 1) it's not hard to implement sync wrappers and 2) it's useful for testing.
But if we do have sync operations, then we need to be consistent on naming, and it seems like the most consistent naming is to make the async method end with an
_asyncsuffix.