Code refactoring has led to circular imports and broken main branch
The recent refactoring has unfortunately led to a broken main branch of sitem1d
. This is mostly due to a messy code structure leading to circular imports.
E.g., the simple statement,
from sitem1d import cal
currently results in an AttributeError
(Note, not an ImportError
!). Trying to import cal in sitem1d/__init__.py
reveals the circular import:
ImportError: cannot import name 'EM1DThicknessChannelCollection' from partially initialized module 'sitem1d' (most likely due to a circular import)
(D:\repos\gitlab.awi.de\sitem\sitem1d\sitem1d\__init__.py)
A full code restructuring is needed to resolve this issue:
-
The _data
and_sensor
module should be moved to an internal_core
module. This module should not have no dependency to any other sub-module -
The classes of the new _core
module should be loaded directly whensitem1d
is initialized to ensure they are always available to all other sub-modules -
The deprecatedtransform
module should be removed entirely. This module is the primary source of the current import troubles. -
The deprecated transform
module should be renamed toempex
and not be referenced by other sub-modules.
Edited by Stefan Hendricks