xarray-contrib / xdggs

Xarray extension for DGGS
Apache License 2.0
54 stars 9 forks source link

optional dependencies and third-party index implementations #43

Open keewis opened 7 months ago

keewis commented 7 months ago

We currently import all index implementations to create a mapping of registered grid types. However, this currently forces us to require all DGGS support libraries to be installed (healpy and h3ronpy, currently). This is problematic because it means we pull in potentially unused libraries, and in the case of healpy this also means that we cannot test and support windows (since healpy doesn't).

In order to avoid the above and to allow third-party index implementations we should think about creating a plugin system.

benbovy commented 7 months ago

Agreed for making dependencies optional.

Regarding third-party index implementations this might be a bit premature a this stage, though. There aren't tons of DGGS (systems, implementations and/or backend libraries) in the wild and it would add some friction if we cannot easily move forward and break the API of the base DGGS index.

keewis commented 7 months ago

Very true, my idea was to redesign with third-party implementations in mind, even if we don't publicly expose the interface (I wouldn't put too much energy into getting that to work, though, just make sure we don't need another refactor). That would make exposing it very easy, but without freezing the API at first.

keewis commented 7 months ago

regarding the DGGS implementations: I believe you're right, though that leaves us with the question of where these should live. @allixender has voiced interest in index implementations backed by dggrid, would you put these directly in xdggs or in a separate package?