Reason or Problem
open_geotiff and to_geotiff are the two public entry points of the geotiff subpackage, but today you can only import them from the subpackage:
from xrspatial.geotiff import open_geotiff, to_geotiff
Every other public function in xarray-spatial imports directly from the top level (from xrspatial import slope). The GeoTIFF entry points are the odd ones out, which trips people up.
Proposal
Re-export both functions from the top-level xrspatial package so either spelling works:
from xrspatial import open_geotiff, to_geotiff # new, shorter
from xrspatial.geotiff import open_geotiff, to_geotiff # still works
Design: Add two import lines to xrspatial/__init__.py next to the existing top-level re-exports. The functions themselves don't change.
Value: Same import style everywhere, and shorter imports for the GeoTIFF entry points.
Drawbacks
None worth flagging. The subpackage import keeps working, so nothing breaks.
Alternatives
Leave it as is and document the subpackage path, which keeps the inconsistency.
Reason or Problem
open_geotiffandto_geotiffare the two public entry points of thegeotiffsubpackage, but today you can only import them from the subpackage:Every other public function in xarray-spatial imports directly from the top level (
from xrspatial import slope). The GeoTIFF entry points are the odd ones out, which trips people up.Proposal
Re-export both functions from the top-level
xrspatialpackage so either spelling works:Design: Add two import lines to
xrspatial/__init__.pynext to the existing top-level re-exports. The functions themselves don't change.Value: Same import style everywhere, and shorter imports for the GeoTIFF entry points.
Drawbacks
None worth flagging. The subpackage import keeps working, so nothing breaks.
Alternatives
Leave it as is and document the subpackage path, which keeps the inconsistency.