Required vs. optional dependencies #662
adamjstewart
started this conversation in
General
Replies: 1 comment
-
My only suggestion is that we should be using einops more since it's more readable and provides names to dimensions, e.g. BCHW. It also has no dependencies (only depends on torch during runtime). |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
My goal is to make
pip install torchgeo
somewhat lightweight while still enabling most features by default. We do this by maintaining a set of "required" dependencies and a separate set of "optional" dependencies.pip install torchgeo
only installs the former, whilepip install torchgeo[datasets]
installs everything.I wanted to go through our current dependencies and see if any should be moved around. Here is how many features require each dependency:
Required (currently)
train.py
, trainer tests)Optional (currently)
Considerations
Results
I think einops and omegaconf should definitely be optional, they are barely used in TorchGeo. Omegaconf can be moved under the
tests
group of dependencies. If we ever add entrypoints for our top-level scripts, we may want to reconsider.I think pandas should definitely be required, it's used by a lot of datasets and is a core ML library. There are two more datasets that use
csv
that could be ported to pandas.I'm on the fence about pyproj, scikit-learn, scipy, and shapely. All are barely used in TorchGeo, but they're also core ML/geospatial libraries that most users will already need anyway.
I'm also on the fence about segmentation-models-pytorch and timm. I think we'll likely use those in more places and they'll become core to our trainer infrastructure, so we may want to keep them as required.
We should consider replacing open3d with pyvista. Open3d is a nightmare to install and lacks Python 3.10 wheels. The tests fail on macOS with mysterious seg faults. Pyvista will also be a nightmare to install, but seems better supported. It's a pure Python library, but requires VTK. VTK also lacks Python 3.10 wheels though. @isaaccorley will investigate this.
Should we rename the "datasets" extras group to "optional"? I guess it depends on how many of our optional dependencies are used outside of datasets/datamodules.
Continuation of #72
Beta Was this translation helpful? Give feedback.
All reactions