|
store: ObjectStore | None = None, |
This ties to obstore specifically, but is unnecessarily strict for what's required. At the end of the day it looks like the store is only used for GeoTIFF.open
|
geotiff = await GeoTIFF.open(path, store=store) |
I'd suggest only requiring the ObspecInput type, which is just:
from typing import Protocol
from obspec import GetRangeAsync, GetRangesAsync
class ObspecInput(GetRangeAsync, GetRangesAsync, Protocol):
"""Supported obspec input to reader.
Anything that implements [GetRangeAsync][obspec.GetRangeAsync] and
[GetRangesAsync][obspec.GetRangesAsync] can be used as an input to the TIFF reader.
"""
So it's defined as requiring just GetRangeAsync and GetRangesAsync
It also seems like the typing is a bit lax:
Ideally we'd avoid the use of Any where we have a known type such as here
lazycogs/src/lazycogs/_core.py
Line 679 in 577205d
This ties to obstore specifically, but is unnecessarily strict for what's required. At the end of the day it looks like the
storeis only used forGeoTIFF.openlazycogs/src/lazycogs/_chunk_reader.py
Line 232 in 577205d
I'd suggest only requiring the
ObspecInputtype, which is just:So it's defined as requiring just
GetRangeAsyncandGetRangesAsyncIt also seems like the typing is a bit lax:
lazycogs/src/lazycogs/_backend.py
Line 85 in 577205d
Ideally we'd avoid the use of
Anywhere we have a known type such as here