In some situations/contexts the openeogeotrellis.collections subpackage conflicts with the collections module of stdlib: a naive import collections somewhere (maybe even in third party lib) loads geotrellis.collections which is not intended.
It's tempting to rename openeogeotrellis.collections as a fix, but that is actually just hiding a symptom of deeper misconfiguration issue: adding the openeogeotrellis folder itself to PYTHONPATH in some way (e.g. which happens automatically when setting it as "source folder" in PyCharm). This makes every (sub)module foo under openeogeotrellis importable with just import foo. Note that we have a lot of modules there with pretty generic names: catalogs, config, integrations, ml, backend, cli, logs, testing, utils, vault, etc. The risk on other conflicts with existing packages is not zero.
It's better, e.g. in PyCharm, to mark the project root folder as "source folder", but this makes a lot more resources importable than necessary.
In some situations/contexts the
openeogeotrellis.collections
subpackage conflicts with thecollections
module of stdlib: a naiveimport collections
somewhere (maybe even in third party lib) loadsgeotrellis.collections
which is not intended.It's tempting to rename
openeogeotrellis.collections
as a fix, but that is actually just hiding a symptom of deeper misconfiguration issue: adding theopeneogeotrellis
folder itself to PYTHONPATH in some way (e.g. which happens automatically when setting it as "source folder" in PyCharm). This makes every (sub)modulefoo
underopeneogeotrellis
importable with justimport foo
. Note that we have a lot of modules there with pretty generic names: catalogs, config, integrations, ml, backend, cli, logs, testing, utils, vault, etc. The risk on other conflicts with existing packages is not zero.It's better, e.g. in PyCharm, to mark the project root folder as "source folder", but this makes a lot more resources importable than necessary.
This problem is one of the reasons to prefer the "src layout" over the more traditional "flat layout" (which we currently use) as discussed in https://packaging.python.org/en/latest/discussions/src-layout-vs-flat-layout/ .