Skip to content

Refactor modules to avoid unnecessary imports #3123

@djhoese

Description

@djhoese

Feature Request

Is your feature request related to a problem? Please describe.
I have a project that uses Satpy but does not need most of the "usual" functionality that Satpy provides. Specifically I need to read ABI and AHI input data, no resampling, no compositing, and write to a NetCDF file using the "awips_tiled" writer. This project involves creating a docker image so reducing the number of unnecessary dependencies installed can make a huge difference on the size of the docker image.

Additionally, the more imports needed to do basic functionality in Satpy means longer import times overall when the functionality using those imports isn't needed.

Describe the solution you'd like
I'd like to refactor a few key modules in Satpy into a series of submodules. As part of that I'd also like to remove "alias" imports as much as possible. I started this with the "satpy.writers" sub-package in #3122, but naming still needs to be finalized. Other modules that should be looked at:

After these are refactored the __init__.py modules could get a __getattr__ function that produces a warning when someone tries to access the old import.

Describe any changes to existing user workflow
Users will need to change their imports.

Metadata

Metadata

Assignees

No one assigned

    Labels

    backwards-incompatibilityCauses backwards incompatibility or introduces a deprecationcleanupCode cleanup but otherwise no change in functionalityenhancementcode enhancements, features, improvements

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions